+2005-06-13 Jonathan Pryor <jonpryor@vt.edu>
+
+ * man/mono-shlib-cop.1: Add man page for mono-shlib-cop program.
+
+2005-06-13 Jonathan Pryor <jonpryor@vt.edu>
+
+ * data/config.in: Fix generated XML.
+
+2005-06-13 Jonathan Pryor <jonpryor@vt.edu>
+
+ * scripts/Makefile.am: Add mono-shlib-cop.
+
+2005-06-09 Ben Maurer <bmaurer@ximian.com>
+
+ * configure.in: Handle more gracefully if objdump or X isn't
+ there. Warn the user about possible breakage.
+
+2005-06-08 Ben Maurer <bmaurer@ximian.com>
+
+ * configure.in: read the SONAME from libX11. This is the same
+ thing as will be used by a shared library, so it will really
+ work.
+
+ This will have us get libX11.so.6 rather than libX11.so.6.2.
+
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: make automake 1.9 happy about LARGE_FILES.
+
+2005-06-06 Jonathan Pryor <jonpryor@vt.edu>
+
+ * configure.in: Add checks for mremap, remap_file_pages.
+
+2005-06-06 Ben Maurer <bmaurer@ximian.com>
+
+ * mono.spec.in: Remove. This is horribly out of date. A real spec
+ file is generated in the release module.
+
+ * scripts/Makefile.am: Add mono-find-*
+
+ * scripts/mono-find-*.in: provides/requires stuff for rpm is now
+ done with monodis. This makes packaging easier as it doesn't
+ depend on the gac ind DESTDIR.
+
+ * configure.in: changes for the above
+
2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* configure.in: added test for SIOCGIFCONF.
## 'tools' is not normally built
DIST_SUBDIRS = libgc mono ikvm-native support docs data runtime scripts man samples web tools
-EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
+EXTRA_DIST= mono.pc.in mint.pc.in
# Distribute the 'mcs' tree too
dist-hook:
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,1.1.7.99)
+AM_INIT_AUTOMAKE(mono,1.1.8)
AM_MAINTAINER_MODE
AC_PROG_LN_S
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
+AC_PROG_AWK
dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
: ${CCAS='$(CC)'}
# Set ASFLAGS if not already set.
# potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
# CPPFLAGS and sets $large_offt to yes if the test succeeds
large_offt=no
- AC_DEFUN(LARGE_FILES, [
+ AC_DEFUN([LARGE_FILES], [
large_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $1"
AC_TRY_RUN([
AC_CHECK_FUNCS(fgetpwent)
AC_CHECK_FUNCS(fgetpwent)
AC_CHECK_FUNCS(getfsstat)
+ AC_CHECK_FUNCS(mremap)
+ AC_CHECK_FUNCS(remap_file_pages)
AC_CHECK_FUNCS(posix_fadvise)
AC_CHECK_FUNCS(posix_fallocate)
AC_CHECK_FUNCS(posix_madvise)
if test "x$X11" = "xlibX11.so"; then
AC_PATH_X
+ AC_PATH_PROG(OBJDUMP, objdump, no)
if test "x$no_x" != "xyes"; then
- X11=`readlink $x_libraries/libX11.so`
+ if test "x$OBJDUMP" != xno; then
+ AC_MSG_CHECKING(for the soname of libX11.so)
+ X11=$($OBJDUMP -p $x_libraries/libX11.so | $AWK '/SONAME/ {print $2}')
+ AC_MSG_RESULT($X11)
+ else
+ AC_MSG_WARN([Could not find objdump. WinForms will not work if you install this mono on a box without the X -devel package.]);
+ fi
+
+ else
+ AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? WinForms may not work...]);
fi
fi
mint.pc
mono.pc
scripts/mono-nunit.pc
+scripts/mono-find-provides
+scripts/mono-find-requires
mono/Makefile
mono/utils/Makefile
mono/metadata/Makefile
samples/Makefile
support/Makefile
data/config
-mono.spec
tools/Makefile
tools/locale-builder/Makefile
runtime/Makefile
<dllmap dll="db2cli" target="libdb2_36@libsuffix@"/>
<dllmap dll="msvcrt" target="@LIBC@"/>
<dllmap dll="MonoPosixHelper" target="libMonoPosixHelper@libsuffix@"/>
- <dllmap dll="sqlite" target="@SQLITE@">
- <dllmap dll="sqlite3" target="@SQLITE3@">
- <dllmap dll="libX11" target="@X11@">
+ <dllmap dll="sqlite" target="@SQLITE@"/>
+ <dllmap dll="sqlite3" target="@SQLITE3@"/>
+ <dllmap dll="libX11" target="@X11@"/>
</configuration>
+2005-06-08 Ben Maurer <bmaurer@ximian.com>
+
+ * Makefile.am: Avoid versioning. We aren't going to be a strongly
+ versioned lib.
+
2005-05-03 Zoltan Varga <vargaz@freemail.hu>
* os.c: Update from the official version.
lib_LTLIBRARIES = libikvm-native.la
libikvm_native_la_SOURCES = jni.c os.c jni.h
+
+libikvm_native_la_LDFLAGS = -avoid-version
man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1 oldmono.1 ilasm.1 \
cert2spc.1 cilc.1 genxs.1 wsdl.1 disco.1 soapsuds.1 makecert.1 \
chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1 xsd.1 gacutil.1 \
- macpack.1 mkbundle.1 dtd2xsd.1 permview.1 prj2make.1 mono-service.1
+ macpack.1 mkbundle.1 dtd2xsd.1 permview.1 prj2make.1 mono-service.1 mono-shlib-cop.1
EXTRA_DIST = $(man_MANS)
--- /dev/null
+.TH "mono-shlib-cop" 1
+.SH NAME
+mono-shlib-cop \- Shared Library Usage Checker
+.SH SYNOPSIS
+.B mono-shlib-cop
+[OPTIONS]* [ASSEMBLY-FILE-NAME]*
+.SH OPTIONS
+.TP
+.I \-p, --prefixes=PREFIX
+Mono installation prefixes. This is to find $prefix/etc/mono/config.
+The default is based upon the location of mscorlib.dll, and is normally
+correct.
+.PP
+.SH DESCRIPTION
+.I mono-shlib-cop
+is a tool that inspects a managed assembly looking for
+erroneous or suspecious behavior of shared libraries.
+.PP
+The tool takes one or more assembly filenames, and inspects each assembly
+specified.
+.PP
+The errors checked for include:
+.TP
+*
+Does the shared library exist?
+.TP
+*
+Does the requested symbol exist within the shared library?
+.PP
+The warnings checked for include:
+.TP
+*
+Is the target shared library a versioned library? (Relevant only on Unix
+systems, not Mac OS X or Windows.)
+.PP
+In general, only versioned libraries such as libc.so.6 are present on the
+user's machine, and efforts to load libc.so will result in a
+System.DllNotFoundException. There are three solutions to this:
+.TP
+1.
+Require that the user install any -devel packages which provide the
+unversioned library. This usually requires that the user install a large
+number of additional packages, complicating the installation process.
+.TP
+2.
+Use a fully versioned name in your DllImport statements. This requires
+editing your source code and recompiling whenever you need to target a
+different version of the shared library.
+.TP
+3.
+Provide an assembly.config file which contains <dllmap/> elements to remap
+the shared library name used by your assembly to the actual versioned shared
+library present on the users system. Mono provides a number of pre-existing
+<dllmap/> entries, including libc.so and libX11.so.
+.SH EXAMPLE
+The following code contains examples of the above errors and warnings:
+.nf
+ using System.Runtime.InteropServices; // for DllImport
+ class Demo {
+ [DllImport ("bad-library-name")]
+ private static extern void BadLibraryName ();
+
+ [DllImport ("libc.so")]
+ private static extern void BadSymbolName ();
+
+ [DllImport ("libcap.so")]
+ private static extern int cap_clear (IntPtr cap_p);
+ }
+.fi
+.TP
+Bad library name
+Assuming that the library
+.B bad-library-name
+doesn't exist on your machine, Demo.BadLibraryName will generate an error, as
+it requires a shared library which doesn't exist.
+.TP
+Bad symbol name
+Demo.BadSymbolName will generate an error, as libc.so (remapped to libc.so.6
+by mono's $prefix/etc/mono/config file) doesn't contain the function
+BadSymbolName.
+.TP
+Unversioned library dependency
+Assuming you have the file libcap.so, Demo.cap_clear will generate a
+warning because, while libcap.so could be loaded, libcap.so might not exist on
+the users machine (on FC2, /lib/libcap.so is provided by
+.I libcap-devel
+, and you can't assume that end users will have any -devel packages installed).
+.SH FIXING CODE
+The fix depends on the warning or error:
+.TP
+Bad library names
+Use a valid library name in the DllImport attribute, or provide a <dllmap/>
+entry to map your existing library name to a valid library name.
+.TP
+Bad symbol names
+Reference a symbol that actually exists in the target library.
+.TP
+Unversioned library dependency
+Provide a <dllmap/> entry to reference a properly versioned library, or ignore
+the warning (see
+.B BUGS
+).
+.SH DLLMAP ENTRIES
+Mono looks for an
+.I ASSEMBLY-NAME
+\.config file for each assembly loaded, and reads this file to find Dll
+mapping information. For example, with
+.I mcs.exe
+, Mono would read
+.I mcs.exe.config
+, and for
+.I Mono.Posix.dll
+, Mono would read
+.I Mono.Posix.dll.config
+\.
+.PP
+The .config file is an XML document containing a top-level <configuration/>
+section with nested <dllmap/> entries, which contains
+.B dll
+and
+.B target
+attributes. The dll attribute should contain the same string used in your
+DllImport attribute value, and the target attribute specifies which shared
+library mono should
+.I actually
+load at runtime.
+.PP
+A sample .config file is:
+.nf
+ <configuration>
+ <dllmap dll="gtkembedmoz" target="libgtkembedmoz.so" />
+ </configuration>
+.fi
+.SH BUGS
+.I mono-shlib-cop
+currently only examines the shared library file extension to determine if a
+warning should be generated. A
+.I .so
+extension will always generate a warning, even if the .so is not a symlink,
+isn't provided in a -devel package, and there is no versioned shared library
+(possible examples including /usr/lib/libtcl8.4.so, /usr/lib/libubsec.so,
+etc.).
+.PP
+Consequently, warnings for any such libraries are useless, and incorrect.
+.PP
+Windows and Mac OS X will never generate warnings, as these
+platforms use different shared library extensions.
+.SH MAILING LISTS
+Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
+.SH WEB SITE
+Visit http://www.mono-project.com for details
.RS
.ne 8
.TP
-.I "handle-sigint"
-This option makes the runtime display the stack traces
-for all the threads running and exit when mono is interrupted (Ctrl-C)
-and print some additional messages on error conditions. It may not
-exit cleanly. Use at your own risk.
-.TP
.I "keep-delegates"
This option will leak delegate trampolines that are no longer
referenced as to present the user with more information about a
variable is 5.
.TP
.I "MONO_TRACE"
+Used for runtime tracing of method calls. The format of the comma separated
+trace options is:
+.nf
+
+ [-]M:method name
+ [-]N:namespace
+ [-]T:class name
+ [-]all
+ [-]program
+ disabled Trace output off upon start.
+
+.fi
+You can toggle trace output on/off sending a SIGUSR2 signal to the program.
+.TP
+.I "MONO_TRACE_LISTENER"
If set, enables the System.Diagnostics.DefaultTraceListener, which will
print the output of the System.Diagnostics Trace and Debug classes.
It can be set to a filename, and to Console.Out or Console.Error to display
-output to standard output or standard error, respectively.
+output to standard output or standard error, respectively. If it's set to
+Console.Out or Console.Error you can append an optional prefix that will
+be used when writing messages like this: Console.Error:MyProgramName.
See the System.Diagnostics.DefaultTraceListener documentation for more
information.
.TP
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Makefile (centum_tests): Added System.Security.
+
2005-05-20 Raja R Harinath <rharinath@novell.com>
* Makefile (centum_tests): Add System.Web and move corlib from ...
class/System.Configuration.Install \
class/System.Runtime.Remoting \
class/System.Runtime.Serialization.Formatters.Soap \
+ class/System.Security \
class/System.Web \
class/System.Web.Services \
tests \
+2005-06-07 Atsushi Enomoto <atsushi@ximian.com>
+
+ * RelaxngReader.cs : When ReadPattern() if no valid pattern appears
+ then raise an error. In Read() when there are only non RELAX NG
+ elements it resulted in an infinite loop.
+
2005-04-06 Atsushi Enomoto <atsushi@ximian.com>
* RelaxngPattern.cs : fixed incorrect use of virtual.
}\r
do {\r
if (!skipRead)\r
- b = Reader.Read ();\r
+ Reader.Read ();\r
else\r
skipRead = false;\r
switch (NodeType) {\r
loop = false;\r
break;\r
}\r
- } while (b && loop);\r
+ } while (!Reader.EOF && loop);\r
\r
switch (NodeType) {\r
case XmlNodeType.Element:\r
{\r
while (NodeType != XmlNodeType.Element)\r
if (!Read ())\r
- break;\r
+ throw new RelaxngException ("RELAX NG pattern did not appear.");\r
\r
switch (LocalName) {\r
case "element":\r
value = ((int)(cjkToJis[value])) |
(((int)(cjkToJis[value + 1])) << 8);
}
+ else if(ch >= 0xE000 && ch <= 0xE757)
+ {
+ // PrivateUse
+ int diff = ch - 0xE000;
+ value = ((int) (diff / 0xBC) << 8)
+ + (diff % 0xBC)
+ + 0xF040;
+ if (value % 0x100 >= 0x7F)
+ value++;
+ }
else if(ch >= 0xFF01 && ch <= 0xFF60)
{
value = ch - 0xFF00 + 0x20;
}
bytes[posn++] = (byte)value;
}
+ else if (value >= 0xF040 && value <= 0xF9FC)
+ {
+ // PrivateUse
+ bytes[posn++] = (byte) (value / 0x100);
+ bytes[posn++] = (byte) (value % 0x100);
+ }
else
{
// JIS X 0212 character, which Shift-JIS doesn't
{
value = (last - 0x81) * 0xBC;
}
+ else if (last >= 0xF0 && last <= 0xFC && byteval <= 0xFC)
+ {
+ // PrivateUse
+ value = 0xE000 + (last - 0xF0) * 0xBC + byteval;
+ if (byteval > 0x7F)
+ value--;
+ }
else
{
value = (last - 0xE0 + (0xA0 - 0x81)) * 0xBC;
+2005-06-13 Jackson Harper <jackson@ximian.com>
+
+ * SWF.csproj:
+ * System.Windows.Forms.dll.sources: Add MdiClientContext to the
+ build.
+
+2005-06-13 Ritvik Mayank <mritvik@novell.com>
+
+ * System.Windows.Forms_test.dll.sources : Added TextBoxTest.cs
+ and ButtonTest.cs for TextBox and Button tests respectively.
+
+2005-06-10 Peter Bartok <pbartok@novell.com>
+
+ * System.Windows.Forms.dll.sources: Add ImageListConverter.cs
+ * SWF.csproj: Updated
+
+2005-06-08 Jackson Harper <jackson@ximian.com>
+
+ * Guidelines:
+ * Design: Double buffering is handled at a different level now, so
+ I am removing mention of it. Control developers do not need to
+ know how it works.
+
2005-06-05 Peter Bartok <pbartok@novell.com>
* System.Windows.Forms.dll.sources: Add Win32DnD.cs
can be added simply by implementing XplatUIDriver for the new platform.
-2a. Double Buffering:
-=====================
-
-For drawing controls double buffering used, so that a better performance
-can be achieved. Every controls maintains a bitmap image of itself. This
-image is used for painting the screen when a paint event is raised. When
-a control property changes the look of the control, it redraws the bitmap
-image. [Please see the guidelines document]
-
-
2b. Themes:
===========
XplatUIDriver, please let us know. We will try to enhance the
driver, if *really* required.
-5. As mentioned in the design doc also, double buffering must be used
- by any new controls being added. Whenever a property or method that
- changes the look of the control is called, the bitmap representing
- the control should be updated. The Paint method should only copy
- the bitmap to the screen, and *not* recalculate or paint the control.
- To aid in double-buffering, the Control class provides the
- Control.DeviceContext and Control.ImageBuffer properties.
-
- A typical OnPaint will look like this:
-
- protected override void OnPaint (PaintEventArgs pevent) {
- pevent.Graphics.DrawImage (this.ImageBuffer,
- pevent.ClipRectangle,
- pevent.ClipRectangle,
- GraphicsUnit.Pixel);
- }
-
- The ImageBuffer bitmap is supposed to contain the representation
- of the control, often drawn when a property is set, similar to this:
-
- public Color RectColor {
- set {
- sb.Color = value;
- Redraw ();
- }
- }
-
- internal void Redraw () {
- this.DeviceContext.FillRectangle (sb, this.ClientRectangle);
- }
-
-
-6. Minimize redraws as much as possible by utilizing the clipRectangle
+5. Minimize redraws as much as possible by utilizing the clipRectangle
when possible.
-7. Setting the size of a control raises a resize event even if the
+6. Setting the size of a control raises a resize event even if the
control size is same. Be careful is setting the size and it's better
to avoid changing the control size as much as possible. Wherever
possible try scaling the control bitmap as per the size needs.
-8. Make sure to call the base class event methods when overriding them.
+7. Make sure to call the base class event methods when overriding them.
-9. Define regions in your code, as it makes it easy to browse the code
+8. Define regions in your code, as it makes it easy to browse the code
in the editors which can collapse/expand regions. Also, keep the
methods and properties sorted alphabetically.
-10. Last but not the least, please let others on the mono-winforms-list
+9. Last but not the least, please let others on the mono-winforms-list
know about your work, so that duplication can be avoided.
-11. Theme.cs provides Pen and Brush caching. This allows to share
+10. Theme.cs provides Pen and Brush caching. This allows to share
the same brushes and pens between different controls and also to avoid
to create and destroy them in every draw operation. You should not create
Brushes or Pens directly, you should ask the Resource Pool for them. For
SubType = "Code"
BuildAction = "Compile"
/>
+ <File
+ RelPath = "System.Windows.Forms\DataSourceHelper.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
<File
RelPath = "System.Windows.Forms\DateBoldEventArgs.cs"
SubType = "Code"
SubType = "Code"
BuildAction = "Compile"
/>
+ <File
+ RelPath = "System.Windows.Forms\ImageListConverter.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
<File
RelPath = "System.Windows.Forms\ImageListStreamer.cs"
SubType = "Code"
SubType = "Code"
BuildAction = "Compile"
/>
+ <File
+ RelPath = "System.Windows.Forms\MdiChildContext.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
<File
RelPath = "System.Windows.Forms\MdiClient.cs"
SubType = "Code"
SubType = "Code"
BuildAction = "Compile"
/>
+ <File
+ RelPath = "System.Windows.Forms\Win32DnD.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "System.Windows.Forms\X11Dnd.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
<File
RelPath = "System.Windows.Forms\X11Structs.cs"
SubType = "Code"
System.Windows.Forms/DataGridTextBox.cs
System.Windows.Forms/DataGridTextBoxColumn.cs
System.Windows.Forms/DataObject.cs
+System.Windows.Forms/DataSourceHelper.cs
System.Windows.Forms/DateBoldEventArgs.cs
System.Windows.Forms/DateBoldEventHandler.cs
System.Windows.Forms/DateRangeEventArgs.cs
System.Windows.Forms/IFileReaderService.cs
System.Windows.Forms/ImageIndexConverter.cs
System.Windows.Forms/ImageList.cs
+System.Windows.Forms/ImageListConverter.cs
System.Windows.Forms/ImageListStreamer.cs
System.Windows.Forms/ImeMode.cs
System.Windows.Forms/IMessageFilter.cs
System.Windows.Forms/ListViewItem.cs
System.Windows.Forms/ListViewItemConverter.cs
System.Windows.Forms/MainMenu.cs
+System.Windows.Forms/MdiChildContext.cs
System.Windows.Forms/MdiClient.cs
System.Windows.Forms/MdiLayout.cs
System.Windows.Forms/MeasureItemEventHandler.cs
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2004-2005 Novell, Inc.
//
// Authors:
// Peter Bartok pbartok@novell.com
[ComVisible(true)]
public class AccessibleObject : MarshalByRefObject, IReflect, IAccessible {
#region Private Variables
- private string name;
- private string value;
- private Control owner;
+ internal string name;
+ internal string value;
+ internal Control owner;
internal AccessibleRole role;
internal string default_action;
internal string description;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Text;
+using System.Runtime.InteropServices;
namespace System.Windows.Forms {
public abstract class ButtonBase : Control {
internal StringFormat text_format;
#endregion // Local Variables
+ #region ButtonBaseAccessibleObject sub-class
+ [ComVisible(true)]
+ public class ButtonBaseAccessibleObject : ControlAccessibleObject {
+ #region ButtonBaseAccessibleObject Local Variables
+ private Control owner;
+ #endregion // ButtonBaseAccessibleObject Local Variables
+
+ #region ButtonBaseAccessibleObject Constructors
+ public ButtonBaseAccessibleObject(Control owner) : base(owner) {
+ this.owner = owner;
+ }
+ #endregion // ButtonBaseAccessibleObject Constructors
+
+ #region ButtonBaseAccessibleObject Methods
+ public override void DoDefaultAction() {
+ ((ButtonBase)owner).PerformClick();
+ }
+ #endregion // ButtonBaseAccessibleObject Methods
+ }
+ #endregion // ButtonBaseAccessibleObject sub-class
+
#region Private Properties and Methods
internal ButtonState ButtonState {
get {
}
#endregion // Public Instance Properties
+
+ #region Internal Methods
+ private void PerformClick() {
+ OnClick(EventArgs.Empty);
+ }
+ #endregion // Internal Methods
+
#region Events
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
+2005-06-13 Jackson Harper <jackson@ximian.com>
+
+ * XplatUIX11.cs: Override SetAllowDrop on X11 so an error message
+ isn't printed when the user enables dropping. (X11 does accept
+ drops).
+
+2005-06-13 Jackson Harper <jackson@ximian.com>
+
+ * TreeView.cs: Remove some TODOS.
+
+2005-06-13 Jackson Harper <jackson@ximian.com>
+
+ * Form.cs: Hook into the mdi framework.
+ * MdiClient.cs: Use the base control collections add method so
+ parents get setup correctly. Set the default back colour and dock
+ style.
+ * MdiChildContext.cs: New class, this bad actor handles an
+ instance of an MDI window. Right now there is only basic
+ support. You can drag, close, and resize windows. Minimize and
+ Maximize are partially implemented.
+
+2005-06-13 Jackson Harper <jackson@ximian.com>
+
+ * XplatUIX11.cs: Mash numbers together properly, otherwise we get
+ freaky when both vals are negative. NOTE: There are probably other
+ places in XplatUIX11 that this needs to be done.
+
+2005-06-13 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * DataGrid.cs: implement missing methods, move KeyboardNavigation
+ * DataGridColumnStyle.cs: fixes signature
+
+2005-06-12 Jackson Harper <jackson@ximian.com>
+
+ * XplatUIX11.cs: Use sizing cursors similar to the ones on
+ windows.
+
+2005-06-11 Jackson Harper <jackson@ximian.com>
+
+ * StatusBarPanel.cs: Signature cleanups. Implement
+ BeginInit/EndInit.
+
+2005-06-10 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * DataGridTextBoxColumn.cs: Honors aligment
+ * GridColumnStylesCollection.cs: Contains is case unsensitive
+ * GridTableStylesCollection.cs: several fixes
+ * DataGridTableStyle.cs: default column creation
+ * DataGridDrawingLogic.cs: fixes
+ * CurrencyManager.cs: ListName property
+ * DataGrid.cs: multiple styles support
+ * DataGridColumnStyle.cs: fixes
+
+
+2005-06-10 Peter Bartok <pbartok@novell.com>
+
+ * Control.cs(Select): Moved SetFocus call to avoid potential
+ loops if controls change the active control when getting focus
+ * UpDownBase.cs: Fixes to allow proper keyboard focus after clicking
+ the up/down buttons
+
+2005-06-10 Matthias Felgner <matthiasf@voelcker.ocm>
+
+ * ImageListConverter.cs: Implemented
+
+2005-06-10 John BouAntoun <jba-mono@optusnet.com.au>
+
+ * MonthCalendar.cs: Wired in NumericUpDown control for year
+
+2005-06-10 John BouAntoun <jba-mono@optusnet.com.au>
+
+ * MonthCalendar.cs: Removed MonoTodo attributes on Click and
+ DoubleClick events, since they are not meant to be fired.
+
+2005-06-09 Peter Bartok <pbartok@novell.com>
+
+ * UpDownBase.cs, NumericUpDown.cs, DomainUpDown.cs: Integrated
+ Jonathan's standalone controls into MWF, implemented missing
+ events, attributes and methods; added xxxAccessible classes
+ * AccessibleObject.cs: Made fields internal so other classes
+ can change them if needed
+
+2005-06-09 Jonathan Gilbert <2a5gjx302@sneakemail.com>
+
+ * UpDownBase.cs: Complete implementation
+ * NumericUpDown.cs: Complete implementation
+ * DomainUpDown.cs: Complete implementation
+
+2005-06-09 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * DataGridTextBoxColumn.cs: drawing fixes
+ * DataGridCell.cs: fixes ToString method to match MSNet
+ * DataGridTableStyle.cs: fixes
+ * DataGridBoolColumn.cs: fixes, drawing
+ * DataGridDrawingLogic.cs: fixes, new methods
+ * DataGridTextBox.cs: Keyboard and fixes
+ * DataGrid.cs:
+ - Keyboard navigation
+ - Scrolling fixes
+ - Row selection (single, multiple, deletion, etc)
+ - Lots of fixes
+
+2005-06-07 Jackson Harper <jackson@ximian.com>
+
+ * ThemeWin32Classic.cs: Clear the background area when drawing
+ buttons.
+
+2005-06-06 Peter Bartok <pbartok@novell.com>
+
+ * ImageListStreamer.cs: Fixed signature for GetData
+ * CheckBox.cs: Fixed base class for CheckBoxAccessibleObject
+ * ComboBox.cs:
+ - Added missing ChildAccessibleObject class
+ - Added missing OnXXXFocus overrides, switched to using those
+ instead of the event handler
+ * Control.cs:
+ - Added Parent property for ControlAccessibleObject
+ - Fixed signatures
+ - Fixed attributes
+ - Added ResetBindings()
+ * ListBindingConverter.cs: Implemented some methods
+ * ButtonBase.cs: Added missing ButtonBaseAccessibleObject class
+ * ImageList.cs: Implemented basic handle scheme, removed TODOs
+ * ContainerControl.cs: Fixed signature, now subscribing to the
+ ControlRemoved event instead of overriding the handler, LAMESPEC
+ * CurrencyManager.cs: Added missing attribute
+ * MonthCalendar.cs: Added missing properties
+
+2005-06-06 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * DataGridColumnStyle.cs: fixes for DataGridColumnStyle
+
+2005-06-06 Gaurav Vaish and Ankit Jain
+
+ * DataSourceHelper.cs: Gaurav Vaish and Ankit Jain patch for databinding
+ * DataGrid.cs: Gaurav Vaish and Ankit Jain patch for databinding
+
+2005-06-06 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * Control.cs: fixes CreateParams Width / Height.
+
2005-06-05 Peter Bartok <pbartok@novell.com>
* Win32DnD.cs: Removed compilation warnings
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2004-2005 Novell, Inc.
//
// Authors:
// Dennis Hayes dennish@raytek.com
#region CheckBoxAccessibleObject Subclass
[ComVisible(true)]
- public class CheckBoxAccessibleObject : ControlAccessibleObject {
+ public class CheckBoxAccessibleObject : ButtonBaseAccessibleObject {
#region CheckBoxAccessibleObject Local Variables
private CheckBox owner;
#endregion // CheckBoxAccessibleObject Local Variables
base.OnHandleCreated (e);
}
- protected override void OnMouseUp(MouseEventArgs e) {
- base.OnMouseUp (e);
+ protected override void OnMouseUp(MouseEventArgs mevent) {
+ base.OnMouseUp (mevent);
}
protected override bool ProcessMnemonic(char charCode) {
using System.Reflection;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
+using System.Runtime.InteropServices;
namespace System.Windows.Forms
private bool process_textchanged_event;
private bool has_focus;
+ [ComVisible(true)]
+ public class ChildAccessibleObject : AccessibleObject {
+ private ComboBox owner;
+ private IntPtr handle;
+
+ public ChildAccessibleObject (ComboBox owner, IntPtr handle) {
+ this.owner = owner;
+ this.handle = handle;
+ }
+
+ public override string Name {\r
+ get {\r
+ return base.Name;\r
+ }\r
+ }\r
+
+
+ }
+
internal class ComboBoxInfo
{
internal int item_height; /* Item's height */
MouseDown += new MouseEventHandler (OnMouseDownCB);
MouseUp += new MouseEventHandler (OnMouseUpCB);
MouseMove += new MouseEventHandler (OnMouseMoveCB);
- GotFocus += new EventHandler (OnGotFocus);
- LostFocus += new EventHandler (OnLostFocus);
}
#region events
base.OnForeColorChanged (e);
}
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnGotFocus (EventArgs e) {
+ has_focus = true;
+ Invalidate ();
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void OnLostFocus (EventArgs e) {
+ has_focus = false;
+ Invalidate ();
+ }
+
protected override void OnHandleCreated (EventArgs e)
{
base.OnHandleCreated (e);
return -1;
}
- private void OnGotFocus (object sender, EventArgs e)
- {
- has_focus = true;
- Invalidate ();
- }
-
- private void OnLostFocus (object sender, EventArgs e)
- {
- has_focus = false;
- Invalidate ();
- }
-
internal virtual void OnMouseDownCB (object sender, MouseEventArgs e)
{
/* Click On button*/
active_control = null;
focused_control = null;
unvalidated_control = null;
+ ControlRemoved += new ControlEventHandler(OnControlRemoved);
}
#endregion // Public Constructors
base.Dispose(disposing);
}
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- protected override void OnControlRemoved(ControlEventArgs e) {
+ // LAMESPEC This used to be documented, but it's not in code
+ // and no longer listed in MSDN2
+ // [EditorBrowsable (EditorBrowsableState.Advanced)]
+ // protected override void OnControlRemoved(ControlEventArgs e) {
+ private void OnControlRemoved(object sender, ControlEventArgs e) {
if (e.Control == this.unvalidated_control) {
this.unvalidated_control = null;
}
this.unvalidated_control = null;
}
- base.OnControlRemoved(e);
+ // base.OnControlRemoved(e);
}
protected override void OnCreateControl() {
}
}
+ public override AccessibleObject Parent {
+ get {
+ return base.Parent;
+ }
+ }
+
+
public override AccessibleRole Role {
get {
return base.Role;
owner.ResumeLayout();
}
- public virtual bool Contains (Control value)
+ public bool Contains (Control value)
{
return list.Contains (value);
}
control.is_selected = true;
- XplatUI.SetFocus(control.window.Handle);
container = GetContainerControl();
if (container != null) {
container.ActiveControl = control;
}
+ XplatUI.SetFocus(control.window.Handle);
return true;
}
}
- [EditorBrowsable(EditorBrowsableState.Advanced)]
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [ParenthesizePropertyName(true)]
+ [RefreshProperties(RefreshProperties.All)]
public ControlBindingsCollection DataBindings {
get {
if (data_bindings == null)
}
try {
- create_params.Y = Width;
+ create_params.Width = Width;
}
catch {
- create_params.Y = this.bounds.Width;
+ create_params.Width = this.bounds.Width;
}
try {
- create_params.Y = Height;
+ create_params.Height = Height;
}
catch {
- create_params.Y = this.bounds.Height;
+ create_params.Height = this.bounds.Height;
}
background_color = Color.Empty;
}
-#if haveDataBindings
[EditorBrowsable(EditorBrowsableState.Never)]
[MonoTODO]
public void ResetBindings() {
// Do something
}
-#endif
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void ResetCursor() {
using System.ComponentModel;
namespace System.Windows.Forms {
-
+ [DefaultMember("Item")]
public class CurrencyManager : BindingManagerBase {
protected Type finalType;
OnPositionChanged (EventArgs.Empty);
}
}
+
+ internal string ListName {
+ get {
+ ITypedList typed = list as ITypedList;
+
+ if (typed == null) {
+ return finalType.Name;
+ } else {
+ return typed.GetListName (null);
+ }
+ }
+ }
public override PropertyDescriptorCollection GetItemProperties ()
{
private static readonly Color def_selection_backcolor = ThemeEngine.Current.DataGridSelectionBackColor;
private static readonly Color def_selection_forecolor = ThemeEngine.Current.DataGridSelectionForeColor;
private static readonly Color def_link_color = ThemeEngine.Current.DataGridLinkColor;
+ internal readonly int def_preferredrow_height;
private bool allow_navigation;
private bool allow_sorting;
internal bool caption_visible;
internal bool columnheaders_visible;
private object datasource;
+ private object real_datasource;
private string datamember;
private int firstvisible_column;
private bool flatmode;
internal int visiblecolumn_count;
internal int visiblerow_count;
internal int first_visiblecolumn;
- private int currentrow_index;
private GridTableStylesCollection styles_collection;
private DataGridParentRowsLabelStyle parentrowslabel_style;
internal DataGridCell current_cell;
internal int horz_pixeloffset;
internal bool is_editing; // Current cell is edit mode
internal bool is_changing; // Indicates if current cell is been changed (in edit mode)
+ private Hashtable selected_rows;
+ private bool ctrl_pressed;
+ private bool shift_pressed;
+ private bool begininit;
#endregion // Local Variables
#region Public Constructors
public DataGrid ()
{
+ grid_drawing = new DataGridDrawing (this);
allow_navigation = true;
allow_sorting = true;
+ begininit = false;
alternating_backcolor = def_alternating_backcolor;
background_color = def_background_color;
border_style = BorderStyle.Fixed3D;
caption_visible = true;
columnheaders_visible = true;
datasource = null;
+ real_datasource = null;
datamember = string.Empty;
firstvisible_column = 0;
flatmode = false;
parentrowsfore_color = def_parentrowsfore_color;
parentrows_visible = false; // should be true (temp)
preferredcolumn_width = ThemeEngine.Current.DataGridPreferredColumnWidth;
- preferredrow_height = 16;
- _readonly = false ;
+ _readonly = false;
rowheaders_visible = true;
selection_backcolor = def_selection_backcolor;
selection_forecolor = def_selection_forecolor;
visiblecolumn_count = 0;
visiblerow_count = 0;
current_cell = new DataGridCell ();
- currentrow_index = -1;
first_visiblerow = 0;
first_visiblecolumn = 0;
horz_pixeloffset = 0;
forecolor = SystemColors.WindowText;
parentrowslabel_style = DataGridParentRowsLabelStyle.Both;
backcolor = SystemColors.Window;
+ selected_rows = new Hashtable ();
+ ctrl_pressed = false;
+ shift_pressed = false;
+ preferredrow_height = def_preferredrow_height = FontHeight + 3;
default_style = new DataGridTableStyle (true);
styles_collection = new GridTableStylesCollection (this);
horiz_scrollbar = new HScrollBar ();
horiz_scrollbar.Scroll += new ScrollEventHandler (GridHScrolled);
vert_scrollbar = new VScrollBar ();
- vert_scrollbar.Scroll += new ScrollEventHandler (GridVScrolled);
- grid_drawing = new DataGridDrawing (this);
+ vert_scrollbar.Scroll += new ScrollEventHandler (GridVScrolled);
+ KeyUp += new KeyEventHandler (OnKeyUpDG);
SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
set {
if (!current_cell.Equals (value)) {
- grid_drawing.InvalidateRowHeader (current_cell.RowNumber); // old row header
+ CancelEditing ();
+ EnsureCellVisilibility (value);
current_cell = value;
- InvalidateCurrentRowHeader ();
+ OnCurrentCellChanged (EventArgs.Empty);
}
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int CurrentRowIndex {
get {
- return currentrow_index;
+ return current_cell.RowNumber;
}
set {
- if (currentrow_index != value) {
- currentrow_index = value;
- Refresh ();
+ if (current_cell.RowNumber != value) {
+ CurrentCell = new DataGridCell (value, current_cell.ColumnNumber);
}
}
}
public string DataMember {
get { return datamember; }
set {
- if (SetDataMember (value)) {
- SetNewDataSource ();
- Refresh ();
+ if (SetDataMember (value)) {
+
+ if (styles_collection.Contains (value) == true) {
+ CurrentTableStyle = styles_collection[value];
+ current_style.CreateColumnsForTable (true);
+ } else {
+ CurrentTableStyle = default_style;
+ current_style.GridColumnStyles.Clear ();
+ current_style.CreateColumnsForTable (false);
+ }
}
}
}
set {
if (SetDataSource (value)) {
- SetNewDataSource ();
- Refresh ();
+ SetNewDataSource ();
}
}
}
public object this [DataGridCell cell] {
get {
- throw new NotImplementedException ();
+ return this [cell.RowNumber, cell.ColumnNumber];
}
set {
- throw new NotImplementedException ();
+ this [cell.RowNumber, cell.ColumnNumber] = value;
}
}
public object this [int rowIndex, int columnIndex] {
get {
- throw new NotImplementedException ();
+ return CurrentTableStyle.GridColumnStyles[columnIndex].GetColumnValueAtRow (ListManager,
+ rowIndex);
}
set {
- throw new NotImplementedException ();
+ CurrentTableStyle.GridColumnStyles[columnIndex].SetColumnValueAtRow (ListManager,
+ rowIndex, value);
}
}
return null;
}
- return (CurrencyManager) BindingContext [DataSource, DataMember];
+ return (CurrencyManager) BindingContext [real_datasource, DataMember];
}
set {
}
set {
current_style = value;
+ current_style.DataGrid = this;
+ CalcAreasAndInvalidate ();
}
}
internal int RowHeight {
get {
- if (preferredrow_height > Font.Height + 3) {
+ if (preferredrow_height > Font.Height + 3 + 1 /* line */) {
return preferredrow_height;
} else {
- return Font.Height + 3;
+ return Font.Height + 3 + 1 /* line */;
}
}
}
#region Public Instance Methods
+ [MonoTODO]
public virtual bool BeginEdit (DataGridColumnStyle gridColumn, int rowNumber)
{
- throw new NotImplementedException ();
+ return false;
}
public virtual void BeginInit ()
{
-
+ begininit = true;
}
-
protected virtual void CancelEditing ()
- {
- if (is_editing == false) {
- return;
- }
-
+ {
CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber].Abort (current_cell.RowNumber);
is_editing = false;
is_changing = false;
InvalidateCurrentRowHeader ();
}
+ [MonoTODO]
public void Collapse (int row)
{
protected virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop, bool isDefault)
{
- throw new NotImplementedException ();
+ return CreateGridColumn (prop, isDefault);
}
protected override void Dispose (bool disposing)
if (is_editing == false) {
return false;
}
-
+
if (shouldAbort) {
gridColumn.Abort (rowNumber);
} else {
gridColumn.Commit (ListManager, rowNumber);
}
-
+
is_editing = false;
is_changing = false;
InvalidateCurrentRowHeader ();
public virtual void EndInit ()
{
-
+ begininit = false;
}
public void Expand (int row)
protected virtual string GetOutputTextDelimiter ()
{
- throw new NotImplementedException ();
+ return string.Empty;
}
protected virtual void GridHScrolled (object sender, ScrollEventArgs se)
return;
}
- Rectangle invalidate = new Rectangle ();
- Rectangle invalidate_column = new Rectangle ();
-
- if (se.NewValue > horz_pixeloffset) { // ScrollRight
- int pixels = se.NewValue - horz_pixeloffset;
-
- // Columns header
- invalidate_column.X = grid_drawing.ColumnsHeadersArea.X + grid_drawing.ColumnsHeadersArea.Width - pixels;
- invalidate_column.Y = grid_drawing.ColumnsHeadersArea.Y;
- invalidate_column.Width = pixels;
- invalidate_column.Height = grid_drawing.ColumnsHeadersArea.Height;
- XplatUI.ScrollWindow (Handle, grid_drawing.ColumnsHeadersArea, -pixels, 0, false);
-
- // Cells
- invalidate.X = grid_drawing.CellsArea.X + grid_drawing.CellsArea.Width - pixels;
- invalidate.Y = grid_drawing.CellsArea.Y;
- invalidate.Width = pixels;
- invalidate.Height = grid_drawing.CellsArea.Height;
- XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, -pixels, 0, false);
-
- } else {
- int pixels = horz_pixeloffset - se.NewValue;
-
- // Columns header
- invalidate_column.X = grid_drawing.ColumnsHeadersArea.X;
- invalidate_column.Y = grid_drawing.ColumnsHeadersArea.Y;
- invalidate_column.Width = pixels;
- invalidate_column.Height = grid_drawing.ColumnsHeadersArea.Height;
- XplatUI.ScrollWindow (Handle, grid_drawing.ColumnsHeadersArea, pixels, 0, false);
-
- // Cells
- invalidate.X = grid_drawing.CellsArea.X;
- invalidate.Y = grid_drawing.CellsArea.Y;
- invalidate.Width = pixels;
- invalidate.Height = grid_drawing.CellsArea.Height;
- XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, pixels, 0, false);
- }
-
- horz_pixeloffset = se.NewValue;
- grid_drawing.UpdateVisibleColumn ();
- Invalidate (invalidate_column);
- Invalidate (invalidate);
+ ScrollToColumnInPixels (se.NewValue);
}
protected virtual void GridVScrolled (object sender, ScrollEventArgs se)
- {
+ {
int old_first_visiblerow = first_visiblerow;
first_visiblerow = se.NewValue;
grid_drawing.UpdateVisibleRowCount ();
-
+
if (first_visiblerow == old_first_visiblerow) {
return;
}
-
- Rectangle invalidate = new Rectangle ();
-
- if (se.NewValue > old_first_visiblerow ) { // Scrolldown
- int scrolled_rows = se.NewValue - old_first_visiblerow;
- int pixels = scrolled_rows * RowHeight;
-
- invalidate.X = grid_drawing.CellsArea.X;
- invalidate.Y = grid_drawing.CellsArea.Y + grid_drawing.CellsArea.Height - pixels;
- invalidate.Width = grid_drawing.CellsArea.Width;
- invalidate.Height = pixels;
-
- XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, 0, -pixels, false);
-
- } else { // ScrollUp
- int scrolled_rows = old_first_visiblerow - se.NewValue;
- int pixels = scrolled_rows * RowHeight;
-
- invalidate.X = grid_drawing.CellsArea.X;
- invalidate.Y = grid_drawing.CellsArea.Y;
- invalidate.Width = grid_drawing.CellsArea.Width;
- invalidate.Height = pixels;
-
- XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, 0, pixels, false);
- }
-
- Invalidate (invalidate);
- Invalidate (grid_drawing.RowsHeadersArea);
+ ScrollToRow (old_first_visiblerow, first_visiblerow);
}
public HitTestInfo HitTest (Point position)
public bool IsSelected (int row)
{
- throw new NotImplementedException ();
+ return selected_rows[row] != null;
}
+ [MonoTODO]
public void NavigateBack ()
{
}
+ [MonoTODO]
public void NavigateTo (int rowNumber, string relationName)
{
protected override void OnKeyDown (KeyEventArgs ke)
{
base.OnKeyDown (ke);
- CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber].OnKeyDown
+
+ if (ProcessGridKey (ke) == true) {
+ ke.Handled = true;
+ }
+
+ CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber].OnKeyDown
(ke, current_cell.RowNumber, current_cell.ColumnNumber);
}
protected override void OnKeyPress (KeyPressEventArgs kpe)
- {
+ {\r
base.OnKeyPress (kpe);
}
HitTestInfo testinfo;
testinfo = grid_drawing.HitTest (e.X, e.Y);
- if (testinfo.type == HitTestType.Cell) {
-
+ switch (testinfo.type) {
+ case HitTestType.Cell:
+ {
DataGridCell new_cell = new DataGridCell (testinfo.Row, testinfo.Column);
-
+
if (new_cell.Equals (current_cell) == false) {
CancelEditing ();
CurrentCell = new_cell;
- is_editing = true;
- is_changing = false;
- CurrentTableStyle.GridColumnStyles[testinfo.Column].Edit (ListManager,
- testinfo.Row, GetCellBounds (testinfo.Row, testinfo.Column),
- _readonly, string.Empty, true);
- } else {
+ EditCell (current_cell);
+
+ } else {
CurrentTableStyle.GridColumnStyles[testinfo.Column].OnMouseDown (e, testinfo.Row, testinfo.Column);
}
+
+ break;
+ }
+ case HitTestType.RowHeader:
+ {
+ if (ctrl_pressed == false && shift_pressed == false) {
+ ResetSelection (); // Invalidates selected rows
+ }
+
+ if (shift_pressed == true) {
+ ShiftSelection (testinfo.Row);
+ } else { // ctrl_pressed or single item
+ Select (testinfo.Row);
+ }
+
+ CancelEditing ();
+ CurrentCell = new DataGridCell (testinfo.Row, current_cell.ColumnNumber);
+ OnRowHeaderClick (EventArgs.Empty);
+ break;
+ }
+ default:
+ break;
}
}
protected override void OnMouseWheel (MouseEventArgs e)
{
base.OnMouseWheel (e);
+
+ if (e.Delta > 0) {
+ if (current_cell.RowNumber > 0) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber - 1, current_cell.ColumnNumber);
+ }
+ }
+ else {
+ if (current_cell.RowNumber < RowsCount - 1) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber + 1, current_cell.ColumnNumber);
+ }
+ }
}
protected void OnNavigate (NavigateEventArgs e)
protected bool ProcessGridKey (KeyEventArgs ke)
{
- throw new NotImplementedException ();
+ if (RowsCount == 0) {
+ return false;
+ }
+
+ switch (ke.KeyCode) {
+ case Keys.ControlKey:
+ ctrl_pressed = true;
+ break;
+ case Keys.ShiftKey:
+ shift_pressed = true;
+ break;
+ case Keys.Up:
+ {
+ if (current_cell.RowNumber > 0) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber - 1, current_cell.ColumnNumber);
+ EditCell (current_cell);
+ }
+ break;
+ }
+ case Keys.Down:
+ {
+ if (current_cell.RowNumber < RowsCount - 1) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber + 1, current_cell.ColumnNumber);
+ EditCell (current_cell);
+ }
+ break;
+ }
+ case Keys.Right:
+ {
+ if (current_cell.ColumnNumber + 1 < CurrentTableStyle.GridColumnStyles.Count) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber, current_cell.ColumnNumber + 1);
+ EditCell (current_cell);
+ }
+ break;
+ }
+ case Keys.Left:
+ {
+ if (current_cell.ColumnNumber > 0) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber, current_cell.ColumnNumber - 1);
+ EditCell (current_cell);
+ }
+ break;
+ }
+ case Keys.PageUp:
+ {
+ if (current_cell.RowNumber > grid_drawing.VLargeChange) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber - grid_drawing.VLargeChange, current_cell.ColumnNumber);
+ } else {
+ CurrentCell = new DataGridCell (0, current_cell.ColumnNumber);
+ }
+
+ EditCell (current_cell);
+ break;
+ }
+ case Keys.PageDown:
+ {
+ if (current_cell.RowNumber + grid_drawing.VLargeChange < RowsCount) {
+ CurrentCell = new DataGridCell (current_cell.RowNumber + grid_drawing.VLargeChange, current_cell.ColumnNumber);
+ } else {
+ CurrentCell = new DataGridCell (RowsCount - 1, current_cell.ColumnNumber);
+ }
+
+ EditCell (current_cell);
+ break;
+ }
+ case Keys.Home:
+ {
+ CurrentCell = new DataGridCell (0, current_cell.ColumnNumber);
+ EditCell (current_cell);
+ break;
+ }
+ case Keys.End:
+ {
+ CurrentCell = new DataGridCell (RowsCount - 1, current_cell.ColumnNumber);
+ EditCell (current_cell);
+ break;
+ }
+ case Keys.Delete:
+ {
+ ICollection keys = selected_rows.Keys;
+ foreach (int row in selected_rows.Keys) {
+ ListManager.RemoveAt (row);
+ }
+ selected_rows.Clear ();
+ CalcAreasAndInvalidate ();
+ break;
+ }
+ default:
+ return false; // message not processed
+ }
+
+ return true; // message processed
}
+ // Called from DataGridTextBox
protected override bool ProcessKeyPreview (ref Message m)
{
+ Keys key = (Keys) m.WParam.ToInt32 ();
+ KeyEventArgs ke = new KeyEventArgs (key);
+ if (ProcessGridKey (ke) == true) {
+ return true;
+ }
+
return base.ProcessKeyPreview (ref m);
}
+ [MonoTODO]
protected bool ProcessTabKey (Keys keyData)
{
- throw new NotImplementedException ();
+ return false;
}
public void ResetAlternatingBackColor ()
protected void ResetSelection ()
{
+ ICollection keys = selected_rows.Keys;
+ foreach (int row in selected_rows.Keys) {
+ grid_drawing.InvalidateRow (row);
+ grid_drawing.InvalidateRowHeader (row);
+ }
+ selected_rows.Clear ();
}
public void ResetSelectionBackColor ()
public void Select (int row)
{
+ if (selected_rows[row] == null) {
+ selected_rows.Add (row, true);
+ } else {
+ selected_rows[row] = true;
+ }
+ grid_drawing.InvalidateRow (row);
}
public void SetDataBinding (object dataSource, string dataMember)
protected bool ShouldSerializePreferredRowHeight ()
{
- return (parentrowsfore_color != def_parentrowsfore_color);
+ return (preferredrow_height != def_preferredrow_height);
}
protected bool ShouldSerializeSelectionBackColor ()
public void UnSelect (int row)
{
+ selected_rows.Remove (row);
+ grid_drawing.InvalidateRow (row);
}
#endregion // Public Instance Methods
// EndEdit current editing operation
public virtual bool EndEdit (bool shouldAbort)
- {
- return EndEdit (CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber],
+ {
+ return EndEdit (CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber],
current_cell.RowNumber, shouldAbort);
}
+ private void EnsureCellVisilibility (DataGridCell cell)
+ {
+ if (current_cell.RowNumber != cell.RowNumber) {
+ grid_drawing.InvalidateRowHeader (current_cell.RowNumber);
+ grid_drawing.InvalidateRowHeader (cell.RowNumber);
+ }
+
+ if (cell.ColumnNumber < first_visiblecolumn ||
+ cell.ColumnNumber >= first_visiblecolumn + visiblecolumn_count) {
+
+ int col, pixel;
+
+ if (cell.ColumnNumber + 1 >= first_visiblecolumn + visiblecolumn_count) {
+ col = 1 + cell.ColumnNumber - visiblecolumn_count;
+ }else {
+ col = cell.RowNumber;
+ }
+
+ pixel = grid_drawing.GetColumnStartingPixel (col);
+ ScrollToColumnInPixels (pixel);
+ }
+
+ if (cell.RowNumber < first_visiblerow ||
+ cell.RowNumber + 1 >= first_visiblerow + visiblerow_count) {
+
+ if (cell.RowNumber + 1 >= first_visiblerow + visiblerow_count) {
+ int old_first_visiblerow = first_visiblerow;
+ first_visiblerow = 1 + cell.RowNumber - visiblerow_count;
+ grid_drawing.UpdateVisibleRowCount ();
+ ScrollToRow (old_first_visiblerow, first_visiblerow);
+ }else {
+ int old_first_visiblerow = first_visiblerow;
+ first_visiblerow = cell.RowNumber;
+ grid_drawing.UpdateVisibleRowCount ();
+ ScrollToRow (old_first_visiblerow, first_visiblerow);
+ }
+
+ vert_scrollbar.Value = first_visiblerow;
+ }
+ }
+
internal void InvalidateCurrentRowHeader ()
{
grid_drawing.InvalidateRowHeader (current_cell.RowNumber);
private bool SetDataMember (string member)
{
+ Console.WriteLine ("SetDataMember {0}", member);
if (member == datamember) {
return false;
}
datamember = member;
+ real_datasource = DataSourceHelper.GetResolvedDataSource (datasource, member);
return true;
}
}
datasource = source;
+ try {
+ real_datasource = DataSourceHelper.GetResolvedDataSource (datasource, DataMember);
+ }catch (Exception e) {
+ datamember = "";
+ real_datasource = source;
+ }
+
OnDataSourceChanged (EventArgs.Empty);
return true;
}
{
// Create Table Style
// Create columns Styles
- // Bind data
-
- current_style.DataGrid = this;
+ // Bind data
current_style.GridColumnStyles.Clear ();
- current_style.CreateColumnsForTable ();
- grid_drawing.CalcGridAreas ();
+ current_style.CreateColumnsForTable (false);
+ CalcAreasAndInvalidate ();
}
- private void OnTableStylesCollectionChanged (object sender, CollectionChangeEventArgs e)
+ private void OnKeyUpDG (object sender, KeyEventArgs e)
{
- Console.WriteLine ("Datagrid.TableStyles Collection Changed {0}, null {1}", e.Action,
- e.Element == null);
- /*
- TODO: What's up if there are columns in the incoming TableStyle
- */
+ switch (e.KeyCode) {
+ case Keys.ControlKey:
+ ctrl_pressed = false;
+ break;
+ case Keys.ShiftKey:
+ shift_pressed = false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void OnTableStylesCollectionChanged (object sender, CollectionChangeEventArgs e)
+ {
+ Console.WriteLine ("Datagrid.TableStyles Collection Changed {0}, null {1}, name src {2}, name table style {3}",
+ e.Action,
+ e.Element == null, ListManager.ListName, ((DataGridTableStyle)e.Element).MappingName);
+
+ int cnt = ((DataGridTableStyle) e.Element).GridColumnStyles.Count;
+
+ if (String.Compare (ListManager.ListName, ((DataGridTableStyle)e.Element).MappingName, true) == 0) {
+ CurrentTableStyle = (DataGridTableStyle)e.Element;
+ ((DataGridTableStyle) e.Element).CreateColumnsForTable (false);
+ }
- CurrentTableStyle = (DataGridTableStyle)e.Element;
- CurrentTableStyle.DataGrid = this;
+
- switch (e.Action) {
- case CollectionChangeAction.Add: {
- ((DataGridTableStyle) e.Element).CreateColumnsForTable ();
+ /*switch (e.Action) {
+ case CollectionChangeAction.Add:
break;
- }
+
case CollectionChangeAction.Remove:
break;
+
case CollectionChangeAction.Refresh:
break;
default:
break;
+ }*/
+
+ CalcAreasAndInvalidate ();
+ }
+
+ private void EditCell (DataGridCell cell)
+ {
+ ResetSelection (); // Invalidates selected rows
+ is_editing = false;
+ is_changing = false;
+ CurrentTableStyle.GridColumnStyles[cell.ColumnNumber].Edit (ListManager,
+ cell.RowNumber, GetCellBounds (cell.RowNumber, cell.ColumnNumber),
+ _readonly, string.Empty, true);
+ }
+
+ private void ShiftSelection (int index)
+ {
+ int shorter_item = -1, dist = RowsCount + 1, cur_dist;
+ ICollection keys = selected_rows.Keys;
+
+ foreach (int row in selected_rows.Keys) {
+
+ if (row > index) {
+ cur_dist = row - index;
+ }
+ else {
+ cur_dist = index - row;
+ }
+
+ if (cur_dist < dist) {
+ dist = cur_dist;
+ shorter_item = row;
+ }
}
+ if (shorter_item != -1) {
+ int start, end;
+
+ if (shorter_item > index) {
+ start = index;
+ end = shorter_item;
+ } else {
+ start = shorter_item;
+ end = index;
+ }
+
+ ResetSelection ();
+ for (int idx = start; idx <= end; idx++) {
+ Select (idx);
+ }
+ }
}
+
+ private void ScrollToColumnInPixels (int pixel)
+ {
+ Rectangle invalidate = new Rectangle ();
+ Rectangle invalidate_column = new Rectangle ();
+
+ if (pixel > horz_pixeloffset) { // ScrollRight
+ int pixels = pixel - horz_pixeloffset;
+
+ // Columns header
+ invalidate_column.X = grid_drawing.ColumnsHeadersArea.X + grid_drawing.ColumnsHeadersArea.Width - pixels;
+ invalidate_column.Y = grid_drawing.ColumnsHeadersArea.Y;
+ invalidate_column.Width = pixels;
+ invalidate_column.Height = grid_drawing.ColumnsHeadersArea.Height;
+ XplatUI.ScrollWindow (Handle, grid_drawing.ColumnsHeadersArea, -pixels, 0, false);
+
+ // Cells
+ invalidate.X = grid_drawing.CellsArea.X + grid_drawing.CellsArea.Width - pixels;
+ invalidate.Y = grid_drawing.CellsArea.Y;
+ invalidate.Width = pixels;
+ invalidate.Height = grid_drawing.CellsArea.Height;
+ XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, -pixels, 0, false);
+
+ } else {
+ int pixels = horz_pixeloffset - pixel;
+
+ // Columns header
+ invalidate_column.X = grid_drawing.ColumnsHeadersArea.X;
+ invalidate_column.Y = grid_drawing.ColumnsHeadersArea.Y;
+ invalidate_column.Width = pixels;
+ invalidate_column.Height = grid_drawing.ColumnsHeadersArea.Height;
+ XplatUI.ScrollWindow (Handle, grid_drawing.ColumnsHeadersArea, pixels, 0, false);
+
+ // Cells
+ invalidate.X = grid_drawing.CellsArea.X;
+ invalidate.Y = grid_drawing.CellsArea.Y;
+ invalidate.Width = pixels;
+ invalidate.Height = grid_drawing.CellsArea.Height;
+ XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, pixels, 0, false);
+ }
+
+ horz_pixeloffset = horiz_scrollbar.Value = pixel;
+ grid_drawing.UpdateVisibleColumn ();
+ Invalidate (invalidate_column);
+ Invalidate (invalidate);
+ }
+
+ private void ScrollToRow (int old_row, int new_row)
+ {
+ Rectangle invalidate = new Rectangle ();
+
+ if (new_row > old_row) { // Scrolldown
+ int scrolled_rows = new_row - old_row;
+ int pixels = scrolled_rows * RowHeight;
+
+ invalidate.X = grid_drawing.CellsArea.X;
+ invalidate.Y = grid_drawing.CellsArea.Y + grid_drawing.CellsArea.Height - pixels;
+ invalidate.Width = grid_drawing.CellsArea.Width;
+ invalidate.Height = pixels;
+
+ XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, 0, -pixels, false);
+
+ } else { // ScrollUp
+ int scrolled_rows = old_row - new_row;
+ int pixels = scrolled_rows * RowHeight;
+
+ invalidate.X = grid_drawing.CellsArea.X;
+ invalidate.Y = grid_drawing.CellsArea.Y;
+ invalidate.Width = grid_drawing.CellsArea.Width;
+ invalidate.Height = pixels;
+ XplatUI.ScrollWindow (Handle, grid_drawing.CellsArea, 0, pixels, false);
+ }
+
+ // Right now we use ScrollWindow Invalidate, let's leave remarked it here for X11 if need it
+ //Invalidate ();
+ Invalidate (grid_drawing.RowsHeadersArea);
+ }
+
#endregion Private Instance Methods
#region Public Instance Methods
protected internal override void Abort (int rowNum)
{
- SetState (rowNum, GetState (null, rowNum) & ~CheckState.Selected);
- Invalidate ();
+ SetState (rowNum, GetState (null, rowNum) & ~CheckState.Selected);
+ grid.Invalidate (grid.GetCurrentCellBounds ());
}
protected internal override bool Commit (CurrencyManager source, int rowNum)
{
SetColumnValueAtRow (source, rowNum, FromStateToValue (GetState (source, rowNum)));
SetState (rowNum, GetState (source, rowNum) & ~CheckState.Selected);
- Invalidate ();
+ grid.Invalidate (grid.GetCurrentCellBounds ());
return true;
}
protected internal override void Edit (CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
{
SetState (rowNum, GetState (source, rowNum) | CheckState.Selected);
- Invalidate ();
+ grid.Invalidate (grid.GetCurrentCellBounds ());
}
[MonoTODO]
protected internal override void Paint (Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
{
Size chkbox_size = GetPreferredSize (g, null);
- Rectangle rect = new Rectangle ();
- Rectangle rect_selected = bounds;
+ Rectangle rect = new Rectangle ();
ButtonState state;
chkbox_size.Width -= 2;
chkbox_size.Height -= 2;
rect.X = bounds.X + ((bounds.Width - chkbox_size.Width) / 2);
rect.Y = bounds.Y + ((bounds.Height - chkbox_size.Height) / 2);
rect.Width = chkbox_size.Width;
- rect.Height = chkbox_size.Height;
- rect_selected.Inflate (-1, -1);
-
- g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (
- ((GetState (source, rowNum) & CheckState.Selected) == CheckState.Selected) ? grid.SelectionBackColor: grid.BackColor),
- rect_selected);
+ rect.Height = chkbox_size.Height;
+
+ // If the cell is selected
+ if ((GetState (source, rowNum) & CheckState.Selected) == CheckState.Selected) {
+ backBrush = ThemeEngine.Current.ResPool.GetSolidBrush (grid.SelectionBackColor);
+ }
+
+ g.FillRectangle (backBrush, bounds);
+ g.DrawRectangle (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorButtonShadow), bounds);
switch (GetState (source, rowNum) & ~CheckState.Selected) {
case CheckState.Checked:
grid.InvalidateCurrentRowHeader ();
SetState (row, state);
grid.Invalidate (grid.GetCellBounds (row, column));
-
}
private void SetState (int row, CheckState state)
- {
- Console.WriteLine ("Set state {0}, {1}, {2}", row, state, Environment.StackTrace);
+ {
if (checkboxes_state[row] == null) {
checkboxes_state.Add (row, state);
} else {
public override string ToString ()
{
- return base.ToString () + "{RowNumber = " + row +", ColumnNumber = " + column + "}";
+ return "DataGridCell {RowNumber = " + row +", ColumnNumber = " + column + "}";
}
#endregion // Public Instance Methods
}
#region Local Variables
- private HorizontalAlignment alignment;
+ internal HorizontalAlignment alignment;
private int fontheight;
internal DataGridTableStyle table_style;
private string header_text;
private PropertyDescriptor property_descriptor;
private bool read_only;
private int width;
- protected bool is_default;
- internal protected DataGrid grid;
+ internal bool is_default;
+ internal DataGrid grid;
private DataGridColumnHeaderAccessibleObject accesible_object;
private StringFormat string_format_hdr;
#endregion // Local Variables
set {
if (value != alignment) {
alignment = value;
-
+
+ if (table_style != null && table_style.DataGrid != null) {
+ table_style.DataGrid.Invalidate ();
+ }
+
if (AlignmentChanged != null) {
AlignmentChanged (this, EventArgs.Empty);
- }
+ }
}
}
}
set {
if (value != null_text) {
null_text = value;
+
+ if (table_style != null && table_style.DataGrid != null) {
+ table_style.DataGrid.Invalidate ();
+ }
if (NullTextChanged != null) {
NullTextChanged (this, EventArgs.Empty);
{
grid = value;
- if (property_descriptor == null || value == null || value.ListManager == null) {
+ if (property_descriptor != null || value == null || value.ListManager == null) {
return;
}
PropertyDescriptorCollection propcol = value.ListManager.GetItemProperties ();
for (int i = 0; i < propcol.Count ; i++) {
- if (propcol[i].Name == header_text) {
+ if (propcol[i].Name == mapping_name) {
property_descriptor = propcol[i];
break;
}
protected virtual void SetDataGridInColumn (DataGrid value)
{
- SetDataGridInColumn (value);
+ SetDataGrid (value);
}
internal void SetDataGridInternal (DataGrid value)
virtual internal void OnMouseDown (MouseEventArgs e, int row, int column) {}
virtual internal void OnKeyDown (KeyEventArgs ke, int row, int column) {}
- protected internal void PaintHeader (Graphics g, Rectangle bounds, int colNum)
+ internal void PaintHeader (Graphics g, Rectangle bounds, int colNum)
{
// Background
g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (DataGridTableStyle.DataGrid.ParentRowsBackColor),
private Rectangle rowshdrs_area; // Used Headers rows area
private int rowshdrs_maxheight; // Total height for rows (max height)
private Rectangle cells_area;
+ private bool partial_row;
#endregion // Local Variables
client_area.Width -= BorderStyleSize * 2;
client_area.Height -= BorderStyleSize * 2;
+ //Console.WriteLine ("CalcClientArea");
+
//Console.WriteLine ("CalcClientArea ClientRectangle {0}, ClientArea {1}, BorderStyleSize {2}",
// grid.ClientRectangle, client_area, BorderStyleSize);
}
CalcColumnsHeader ();
CalcCellsArea ();
+ UpdateVisibleRowCount (); // need it to be able to calcultate the need of horz scrollbar
if (SetUpVerticalScrollBar ()) { // We need a Vertical ScrollBar
if (grid.caption_visible) {
caption_area.Width -= grid.vert_scrollbar.Width;
}
UpdateVisibleColumn ();
+ UpdateVisibleRowCount ();
//Console.WriteLine ("DataGridDrawing.CalcGridAreas cells:{0}", cells_area);
}
return;
}
- UpdateVisibleRowCount ();
-
if (grid.caption_visible) {
rowshdrs_area.Y = caption_area.Y + caption_area.Height;
} else {
public void UpdateVisibleColumn ()
{
+ if (grid.CurrentTableStyle.GridColumnStyles.Count == 0) {
+ grid.visiblecolumn_count = 0;
+ return;
+ }
+
int col;
int max_pixel = grid.horz_pixeloffset + cells_area.Width;
grid.first_visiblecolumn = FromPixelToColumn (grid.horz_pixeloffset);
col = FromPixelToColumn (max_pixel);\r
grid.visiblecolumn_count = (col - grid.first_visiblecolumn);
-
- if (grid.visiblecolumn_count > 0)
- grid.visiblecolumn_count++;
+ grid.visiblecolumn_count++;
//Console.WriteLine ("UpdateVisibleColumn col: {0}, cnt {1}",
// grid.first_visiblecolumn, grid.visiblecolumn_count);
public void UpdateVisibleRowCount ()
{
- int max_height = client_area.Height - caption_area.Height -
- parent_rows.Height - columnshdrs_area.Height;
+ int max_height = cells_area.Height;
int rows_height = (grid.RowsCount - grid.first_visiblerow) * grid.RowHeight;
int max_rows = max_height / grid.RowHeight;
-
+
+ //Console.WriteLine ("UpdateVisibleRowCount {0} {1}/{2} (row h) {3}",
+ // max_rows, max_height, grid.RowHeight, cells_area.Height);
+
if (max_rows > grid.RowsCount) {
max_rows = grid.RowsCount;
}
if (rows_height > cells_area.Height) {
- grid.visiblerow_count = max_height / grid.RowHeight;
+ grid.visiblerow_count = max_rows;
} else {
grid.visiblerow_count = grid.RowsCount;
}
if (grid.visiblerow_count + grid.first_visiblerow > grid.RowsCount)
grid.visiblerow_count = grid.RowsCount - grid.first_visiblerow;
-
+
if (grid.visiblerow_count < max_rows) {
grid.visiblerow_count = max_rows;
grid.first_visiblerow = grid.RowsCount - max_rows;
grid.Invalidate ();
}
+
+ // TODO: Partial visible rows? May be only paint them and not take then into account for any
+ // anything else
+ //grid.visiblerow_count++;
}
// From Point to Cell
if (rowshdrs_area.Contains (x, y)) {
hit.type = DataGrid.HitTestType.RowHeader;
+ int posy;
+ int rcnt = grid.FirstVisibleRow + grid.VisibleRowCount;
+ for (int r = grid.FirstVisibleRow; r < rcnt; r++) {
+ posy = cells_area.Y + ((r - grid.FirstVisibleRow) * grid.RowHeight);
+ if (y <= posy + grid.RowHeight) { // Found row
+ hit.row = r;
+ break;
+ }
+ }
return hit;
}
public void OnPaint (PaintEventArgs pe)
{
+ Console.WriteLine ("OnPaint {0}", pe.ClipRectangle);
ThemeEngine.Current.CPDrawBorderStyle (pe.Graphics, grid.ClientRectangle, grid.border_style);
if (pe.ClipRectangle.IntersectsWith (parent_rows)) {
not_usedarea.Intersect (rowshdrs_area_complete);
int rowcnt = grid.FirstVisibleRow + grid.VisibleRowCount;
+
+ if (rowcnt < grid.RowsCount) { // Paint one row more for partial rows
+ rowcnt++;
+ }
+
for (int row = grid.FirstVisibleRow; row < rowcnt; row++) {
rect_row.Width = rowshdrs_area.Width;
not_usedarea.Dispose ();
}
+ public void InvalidateRow (int row)
+ {
+ if (row < grid.FirstVisibleRow || row > grid.FirstVisibleRow + grid.VisibleRowCount) {
+ return;
+ }
+
+ Rectangle rect_row = new Rectangle ();
+
+ rect_row.X = cells_area.X;
+ rect_row.Width = cells_area.Width;
+ rect_row.Height = grid.RowHeight;
+ rect_row.Y = cells_area.Y + ((row - grid.FirstVisibleRow) * grid.RowHeight);
+ grid.Invalidate (rect_row);
+ }
+
public void InvalidateRowHeader (int row)
{
Rectangle rect_rowhdr = new Rectangle ();
not_usedarea.Intersect (cells_area);
int rowcnt = grid.FirstVisibleRow + grid.VisibleRowCount;
+
+ if (rowcnt < grid.RowsCount) { // Paint one row more for partial rows
+ rowcnt++;
+ }
+
for (int row = grid.FirstVisibleRow; row < rowcnt; row++) {
// Get cell's width for column style
rect_row.Width = cells.Width;
Rectangle rect_cell = new Rectangle ();
int cnt = grid.CurrentTableStyle.GridColumnStyles.Count;
int col_pixel;
+ Color backcolor, forecolor;
Region prev_clip = g.Clip;
Region current_clip;
Region not_usedarea = new Region (row_rect);
current_clip = new Region (row_rect);
g.Clip = current_clip;
- g.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (grid.BackgroundColor), rect_cell);
- g.DrawRectangle (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorButtonShadow), rect_cell);
+ if (grid.IsSelected (row)) {
+ backcolor = grid.SelectionBackColor;
+ forecolor = grid.SelectionForeColor;
+ } else {
+ backcolor = grid.BackgroundColor;
+ forecolor = grid.ForeColor;
+ }
not_usedarea.Exclude (rect_cell);
- grid.CurrentTableStyle.GridColumnStyles[column].Paint (g, rect_cell, grid.ListManager, row);
+
+ grid.CurrentTableStyle.GridColumnStyles[column].Paint (g, rect_cell, grid.ListManager, row,
+ ThemeEngine.Current.ResPool.GetSolidBrush (backcolor),
+ ThemeEngine.Current.ResPool.GetSolidBrush (forecolor),
+ grid.RightToLeft == RightToLeft.Yes);
g.Clip = prev_clip;
current_clip.Dispose ();
grid.horiz_scrollbar.Size = new Size (client_area.Width,
grid.horiz_scrollbar.Height);
- //grid.horiz_scrollbar.Maximum = width_all - cells_area.Width;
- //grid.horiz_scrollbar.LargeChange = cells_area.Width;
+ grid.horiz_scrollbar.Maximum = width_all - cells_area.Width;
+ grid.horiz_scrollbar.LargeChange = cells_area.Width;
grid.Controls.Add (grid.horiz_scrollbar);
grid.horiz_scrollbar.Visible = true;
return true;
client_area.Height);
grid.vert_scrollbar.Maximum = grid.RowsCount;
- grid.vert_scrollbar.LargeChange = cells_area.Height / grid.RowHeight;
+ grid.vert_scrollbar.LargeChange = VLargeChange;
grid.Controls.Add (grid.vert_scrollbar);
grid.vert_scrollbar.Visible = true;
}
}
+ public int VLargeChange {
+ get {
+ return cells_area.Height / grid.RowHeight;
+ }
+ }
+
#endregion Instance Properties
}
}
protected bool ShouldSerializePreferredRowHeight ()
{
- return (preferredrow_height != ThemeEngine.Current.DefaultFont.Height + 3);
+ return (preferredrow_height != datagrid.def_preferredrow_height);
}
protected bool ShouldSerializeSelectionBackColor ()
#region Private Instance Properties
// Create column styles for this TableStyle
- internal void CreateColumnsForTable ()
+ internal void CreateColumnsForTable (bool onlyBind)
{
CurrencyManager mgr = null;
mgr = datagrid.ListManager;
if (mgr == null) {
return;
- }
+ }
- //column_styles.Clear ();
PropertyDescriptorCollection propcol = mgr.GetItemProperties ();
for (int i = 0; i < propcol.Count; i++)
{
string s = propcol[i].Name;
DataGridColumnStyle colstyle = column_styles[propcol[i].Name];
-
+
+ // The column style is already provided by the user
if (column_styles[propcol[i].Name] != null &&
column_styles[propcol[i].Name].IsDefault == false) {
column_styles[propcol[i].Name].table_style = this;
column_styles[propcol[i].Name].SetDataGridInternal (datagrid);
continue;
- }
+ }
+
+ if (onlyBind == true) {
+ continue;
+ }
+
// TODO: What to do with relations?
if (propcol[i].ComponentType.ToString () == "System.Data.DataTablePropertyDescriptor") {
} else {
DataGridColumnStyle st = CreateGridColumn (propcol[i], true);
- st.grid = datagrid;
- //st.TableStyle = this;
+ st.grid = datagrid;
st.MappingName = propcol[i].Name;
st.HeaderText = propcol[i].Name;
st.Width = PreferredColumnWidth;
protected internal override bool ProcessKeyMessage (ref Message m)
{
- int code = m.WParam.ToInt32 ();
+ Keys key = (Keys) m.WParam.ToInt32 ();
- if (code == 13) {
+ switch (key) {
+ case Keys.Return:
grid.EndEdit (false);
return true;
- }
- if (code == 27) {
+ case Keys.Escape:
grid.EndEdit (true);
return true;
- }
+
+ case Keys.Right:
+ case Keys.Up:
+ case Keys.Down:
+ case Keys.PageUp:
+ case Keys.PageDown:
+ case Keys.Home:
+ case Keys.End:
+ grid.EndEdit (false);
+ break;
+
+ default:
+ break;
+ }
+ isedit = false;
return base.ProcessKeyMessage (ref m);
}
base.ReadOnly = value;
}
}
-
- [MonoTODO]
+
[Browsable(false)]
public virtual TextBox TextBox {
get {
protected internal override void Abort (int rowNum)
{
- EndEdit ();
+ EndEdit ();
}
protected internal override bool Commit (CurrencyManager dataSource, int rowNum)
{
SetColumnValueAtRow (dataSource, rowNum, textbox.Text);
- EndEdit ();
+ EndEdit ();
return true;
}
protected void EndEdit ()
{
ReleaseHostedControl ();
- Invalidate ();
+ grid.Invalidate (grid.GetCurrentCellBounds ());
}
protected internal override void EnterNullValue ()
} else {
string_format.FormatFlags &= ~StringFormatFlags.DirectionRightToLeft;
}
-
+
+ switch (alignment) {
+ case HorizontalAlignment.Center:
+ string_format.Alignment = StringAlignment.Center;
+ break;
+ case HorizontalAlignment.Right:
+ string_format.Alignment = StringAlignment.Far;
+ break;
+ default:
+ string_format.Alignment = StringAlignment.Near;
+ break;
+ }
+
+ g.FillRectangle (backBrush, textBounds);
+ g.DrawRectangle (ThemeEngine.Current.ResPool.GetPen (ThemeEngine.Current.ColorButtonShadow), textBounds);
+
string_format.FormatFlags |= StringFormatFlags.NoWrap;
g.DrawString (text, DataGridTableStyle.DataGrid.Font, foreBrush, textBounds, string_format);
}
--- /dev/null
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+/**
+ * Namespace: System.Web.UI.Util
+ * Class: DataSourceHelper
+ *
+ * Author: Gaurav Vaish
+ * Maintainer: gvaish@iitk.ac.in
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
+ * Status: 10%
+ *
+ * (C) Gaurav Vaish (2001)
+ */
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Windows.Forms
+{
+ internal class DataSourceHelper
+ {
+ public static IEnumerable GetResolvedDataSource(object source, string member)
+ {
+ if(source != null && source is IListSource)
+ {
+ IListSource src = (IListSource)source;
+ IList list = src.GetList();
+ if(!src.ContainsListCollection)
+ {
+ return list;
+ }
+ if(list != null && list is ITypedList)
+ {
+ ITypedList tlist = (ITypedList)list;
+ PropertyDescriptorCollection pdc = tlist.GetItemProperties(new PropertyDescriptor[0]);
+ if(pdc != null && pdc.Count > 0)
+ {
+ PropertyDescriptor pd = null;
+ if(member != null && member.Length > 0)
+ {
+ pd = pdc.Find(member, true);
+ } else
+ {
+ pd = pdc[0];
+ }
+ if(pd != null)
+ {
+ object rv = pd.GetValue(list[0]);
+ if(rv != null && rv is IEnumerable)
+ {
+ return (IEnumerable)rv;
+ }
+ }
+ throw new Exception(String.Format ("ListSource_Missing_DataMember {0}", member));
+ }
+ throw new Exception("ListSource_Without_DataMembers");
+ }
+ }
+ if(source is IEnumerable)
+ {
+ return (IEnumerable)source;
+ }
+ return null;
+ }
+ }
+}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2005 Novell, Inc.
//
// Authors:
-// Miguel de Icaza (miguel@novell.com).
+// Jonathan Gilbert <logic@deltaq.org>
//
+// Integration into MWF:
+// Peter Bartok <pbartok@novell.com>
//
+// COMPLETE
+
using System;
-using System.ComponentModel;
using System.Collections;
+using System.ComponentModel;
+using System.Drawing;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
-namespace System.Windows.Forms {
+namespace System.Windows.Forms
+{
+ [DefaultProperty("Items")]
+ [DefaultEvent("SelectedItemChanged")]
+ [MonoTODO("Figure out what to do with the DomainItemAccessibleObject and DomainUpDownAccessibleObject classes")]
+ public class DomainUpDown : UpDownBase {
+ #region Local Variables
+ private DomainUpDownItemCollection items;
+ private int selected_index = -1;
+ private bool sorted;
+ private bool wrap;
+ private int typed_to_index = -1;
+ #endregion // Local Variables
- [DefaultEvent ("SelectedItemChanged")]
- [DefaultProperty ("Items")]
- public class DomainUpDown : UpDownBase
-#if NET_2_0
- , ISupportInitialize
-#endif
- {
- public class DomainUpDownItemCollection : ArrayList {
- DomainUpDown owner;
-
- internal DomainUpDownItemCollection (DomainUpDown owner)
- {
- this.owner = owner;
+ #region DomainUpDownAccessibleObject sub-class
+ [ComVisible(true)]
+ public class DomainItemAccessibleObject : AccessibleObject {
+ #region DomainItemAccessibleObject Local Variables
+ private AccessibleObject parent;
+ #endregion // DomainItemAccessibleObject Local Variables
+
+ #region DomainItemAccessibleObject Constructors
+ public DomainItemAccessibleObject(string name, AccessibleObject parent) {
+ this.name = name;
+ this.parent = parent;
}
+ #endregion // DomainItemAccessibleObject Constructors
- public override int Add (object item)
- {
- int ret = base.Add (item);
- if (owner.sorted){
- Sort ();
+ #region DomainItemAccessibleObject Properties
+ public override string Name {
+ get {
+ return base.Name;
+ }
- // Will trigger an update.
- owner.SelectedIndex = owner.SelectedIndex;
+ set {
+ base.Name = value;
}
+ }
- return ret;
+ public override AccessibleObject Parent {
+ get {
+ return parent;
+ }
}
- public override void Insert (int index, object item)
- {
- base.Insert (index, item);
- if (owner.sorted){
- Sort ();
- owner.SelectedIndex = owner.SelectedIndex;
- } else {
- if (index == owner.SelectedIndex)
- owner.UpdateEditText ();
+ public override AccessibleRole Role {
+ get {
+ return base.Role;
}
}
- public override void Remove (object item)
- {
- base.Remove (item);
- if (Count < owner.SelectedIndex)
- owner.SelectedIndex -= 1;
- if (owner.sorted){
- Sort ();
- owner.UpdateEditText ();
+ public override AccessibleStates State {
+ get {
+ return base.State;
}
}
- public override void RemoveAt (int item)
- {
- base.RemoveAt (item);
+ public override string Value {
+ get {
+ return base.Value;
+ }
+ }
+ #endregion // DomainItemAccessibleObject Properties
+ }
+ #endregion // DomainItemAccessibleObject sub-class
+
+ #region DomainUpDownAccessibleObject sub-class
+ [ComVisible(true)]
+ public class DomainUpDownAccessibleObject : ControlAccessibleObject {
+ #region DomainUpDownAccessibleObject Local Variables
+ private Control owner;
+ #endregion // DomainUpDownAccessibleObject Local Variables
+
+ #region DomainUpDownAccessibleObject Constructors
+ public DomainUpDownAccessibleObject(Control owner) : base(owner) {
+ this.owner = owner;
+ }
+ #endregion // DomainUpDownAccessibleObject Constructors
- if (Count < owner.SelectedIndex)
- owner.SelectedIndex -= 1;
- if (owner.SelectedIndex == item)
- owner.UpdateEditText ();
- if (owner.sorted){
- Sort ();
- owner.UpdateEditText ();
+ #region DomainUpDownAccessibleObject Properties
+ public override AccessibleRole Role {
+ get {
+ return base.Role;
}
}
+ #endregion // DomainUpDownAccessibleObject Properties
+
+ #region DomainUpDownAccessibleObject Methods
+ public override AccessibleObject GetChild(int index) {
+ return base.GetChild (index);
+ }
+
+ public override int GetChildCount() {
+ return base.GetChildCount ();
+ }
+ #endregion // DomainUpDownAccessibleObject Methods
}
+ #endregion // DomainUpDownAccessibleObject sub-class
+
+ #region DomainUpDownItemCollection sub-class
+ public class DomainUpDownItemCollection : ArrayList {
+ internal ArrayList string_cache = new ArrayList();
+
+ #region Local Variables
+ #endregion // Local Variables
+
+ #region Constructors
+ internal DomainUpDownItemCollection() {}
+ #endregion // Constructors
+
+ #region Public Instance Properties
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override object this[int index] {
+ get {
+ return base[index];
+ }
+
+ set {
+ if (value == null) {
+ throw new ArgumentNullException("value", "Cannot add null values to a DomainUpDownItemCollection");
+ }
+
+ base[index] = value;
+ string_cache[index] = value.ToString();
+ OnCollectionChanged(index, 0);
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ public override int Add(object value) {
+ if (value == null)
+ throw new ArgumentNullException("value", "Cannot add null values to a DomainUpDownItemCollection");
+
+ int ret = base.Add(value);
+ string_cache.Add(value.ToString());
+ OnCollectionChanged(Count - 1, +1);
+ return ret;
+ }
+
+ public override void Insert(int index, object value) {
+ if (value == null)
+ throw new ArgumentNullException("value", "Cannot add null values to a DomainUpDownItemCollection");
- int selected_index = -1;
- bool sorted = false;
- bool wrap = false;
- DomainUpDownItemCollection items;
+ base.Insert(index, value);
+ string_cache.Insert(index, value.ToString());
+ OnCollectionChanged(index, +1);
+ }
-#if NET_2_0
-#region ISupportInitialize methods
-
- public void BeginInit ()
- {
+ public override void Remove(object obj) {
+ int index = IndexOf(obj);
+
+ if (index >= 0)
+ RemoveAt(index);
+ }
+
+ public override void RemoveAt(int index) {
+ base.RemoveAt(index);
+ string_cache.RemoveAt(index);
+ OnCollectionChanged(index, -1);
+ }
+ #endregion // Public Instance Methods
+
+ #region Internal Methods and Events
+ internal void OnCollectionChanged(int index, int size_delta) {
+ CollectionChangedEventHandler handler = CollectionChanged;
+
+ if (handler != null) {
+ handler(index, size_delta);
+ }
+ }
+
+ internal void PrivSort() {
+ PrivSort(0, Count, Comparer.Default);
+ }
+
+ internal void PrivSort(int index, int count, IComparer comparer) {
+ object[] base_items = null; // this will refer to the base ArrayList private _items member
+ object[] string_cache_items = null; // and this will refer to that of the string_cache
+
+ FieldInfo items_field = null;
+
+ try {
+ items_field = typeof(ArrayList).GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance);
+ }
+ catch {} // security exceptions, perhaps...
+
+ if (items_field != null) {
+ base_items = items_field.GetValue(this) as object[];
+ string_cache_items = items_field.GetValue(string_cache) as object[];
+ }
+
+ if ((base_items == null) || (string_cache_items == null)) {
+ // oh poop =/ guess we have to completely repopulate the string cache
+ base.Sort(index, count, comparer);
+
+ for (int i=0; i < count; i++)
+ string_cache[i + index] = base[i + index].ToString();
+ }
+ else {
+ // yay, this will be much faster than creating a whole bunch more items
+ Array.Sort(string_cache_items, base_items, index, count, comparer);
+
+ OnCollectionChanged(-1, 0);
+ }
+ }
+
+ internal void PrivSort(IComparer comparer) {
+ PrivSort(0, Count, comparer);
+ }
+
+ internal event CollectionChangedEventHandler CollectionChanged;
+ #endregion // Internal Methods and Events
}
+ #endregion // DomainUpDownItemCollection sub-class
+
+ #region Private Methods
+ // normally I'd use an EventArgs class, but I don't want to create spurious objects here
+ internal delegate void CollectionChangedEventHandler(int index, int size_delta);
+
+ internal void items_CollectionChanged(int index, int size_delta) {
+ bool new_item = false;
+
+ if ((index == selected_index) && (size_delta <= 0))
+ new_item = true;
+ else if (index <= selected_index)
+ selected_index += size_delta;
- public void EndInit ()
- {
+ if (sorted && (index >= 0)) // index < 0 means it is already sorting
+ items.PrivSort();
+
+ UpdateEditText();
+
+ if (new_item) {
+ OnSelectedItemChanged(this, EventArgs.Empty);
+ }
}
-#endregion
-#endif
-
- public event EventHandler SelectedItemChanged;
-
- public DomainUpDown () : base () {
- items = new DomainUpDownItemCollection (this);
- }
-
- public override void DownButton ()
- {
- if (wrap)
- selected_index %= items.Count;
- else if (selected_index < items.Count)
- selected_index++;
-
- UpdateEditText ();
- }
-
- public override void UpButton ()
- {
- if (wrap){
- selected_index--;
- if (selected_index == -1)
- selected_index = items.Count-1;
- } else {
- if (selected_index > -1)
- selected_index--;
- }
- UpdateEditText ();
- }
-
- public override void UpdateEditText ()
- {
- ChangingText = true;
- if (selected_index == -1)
- Text = "";
- else
- Text = items [selected_index].ToString ();
+
+ void go_to_user_input() {
UserEdit = false;
+
+ if (typed_to_index >= 0) {
+ selected_index = typed_to_index;
+ OnSelectedItemChanged(this, EventArgs.Empty);
+ }
}
- protected override void OnChanged (object source, EventArgs e)
- {
- OnSelectedItemChanged (source, e);
+ private void TextBoxLostFocus(object source, EventArgs e) {
+ Select(base.txtView.SelectionStart + base.txtView.SelectionLength, 0);
}
-
- protected void OnSelectedItemChanged (object source, EventArgs e)
- {
- if (SelectedItemChanged != null)
- SelectedItemChanged (source, e);
+
+ private void TextBoxKeyDown(object source, KeyPressEventArgs e) {
+ if (!UserEdit) {
+ base.txtView.SelectionLength = 0;
+ typed_to_index = -1;
+ }
+
+ if (base.txtView.SelectionLength == 0) {
+ base.txtView.SelectionStart = 0;
+ }
+
+ if (base.txtView.SelectionStart != 0) {
+ return;
+ }
+
+ if (e.KeyChar == '\b') { // backspace
+ if (base.txtView.SelectionLength > 0) {
+ string prefix = base.txtView.SelectedText.Substring(0, base.txtView.SelectionLength - 1);
+
+ bool found = false;
+
+ if (typed_to_index < 0) {
+ typed_to_index = 0;
+ }
+
+ if (sorted) {
+ for (int i=typed_to_index; i >= 0; i--) {
+ int difference = string.Compare(prefix, 0, items.string_cache[i].ToString(), 0, prefix.Length, true);
+
+ if (difference == 0) {
+ found = true;
+ typed_to_index = i;
+ }
+
+ if (difference > 0) { // since it is sorted, no strings after this point will match
+ break;
+ }
+ }
+ } else {
+ for (int i=0; i < items.Count; i++) {
+ if (0 == string.Compare(prefix, 0, items.string_cache[i].ToString(), 0, prefix.Length, true)) {
+ found = true;
+ typed_to_index = i;
+ break;
+ }
+ }
+ }
+
+ ChangingText = true;
+
+ if (found)
+ Text = items.string_cache[typed_to_index].ToString();
+ else
+ Text = prefix;
+
+ Select(0, prefix.Length);
+
+ UserEdit = true;
+
+ e.Handled = true;
+ }
+ }
+ else {
+ char key_char = e.KeyChar;
+
+ if (char.IsLetterOrDigit(key_char)
+ || char.IsNumber(key_char)
+ || char.IsPunctuation(key_char)
+ || char.IsSymbol(key_char)
+ || char.IsWhiteSpace(key_char)) {
+ string prefix = base.txtView.SelectedText + key_char;
+
+ bool found = false;
+
+ if (typed_to_index < 0) {
+ typed_to_index = 0;
+ }
+
+ if (sorted) {
+ for (int i=typed_to_index; i < items.Count; i++) {
+ int difference = string.Compare(prefix, 0, items.string_cache[i].ToString(), 0, prefix.Length, true);
+
+ if (difference == 0) {
+ found = true;
+ typed_to_index = i;
+ }
+
+ if (difference <= 0) { // since it is sorted, no strings after this point will match
+ break;
+ }
+ }
+ } else {
+ for (int i=0; i < items.Count; i++) {
+ if (0 == string.Compare(prefix, 0, items.string_cache[i].ToString(), 0, prefix.Length, true)) {
+ found = true;
+ typed_to_index = i;
+ break;
+ }
+ }
+ }
+
+ ChangingText = true;
+
+ if (found) {
+ Text = items.string_cache[typed_to_index].ToString();
+ } else {
+ Text = prefix;
+ }
+
+ Select(0, prefix.Length);
+
+ UserEdit = true;
+
+ e.Handled = true;
+ }
+ }
}
-
- protected override AccessibleObject CreateAccessibilityInstance ()
- {
- AccessibleObject ao;
-
- ao = base.CreateAccessibilityInstance ();
- ao.description = "DomainUpDown";
+ #endregion // Private Methods
+
+ #region Public Constructors
+ public DomainUpDown() {
+ selected_index = -1;
+ sorted = false;
+ wrap = false;
+ typed_to_index = -1;
+
+ items = new DomainUpDownItemCollection();
+ items.CollectionChanged += new CollectionChangedEventHandler(items_CollectionChanged);
- return ao;
+ this.txtView.LostFocus +=new EventHandler(TextBoxLostFocus);
+ this.txtView.KeyPress += new KeyPressEventHandler(TextBoxKeyDown);
}
+ #endregion // Public Constructors
+ #region Public Instance Properties
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ [Editor("System.Windows.Forms.Design.StringCollectionEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
[Localizable(true)]
public DomainUpDownItemCollection Items {
get {
}
}
- [DefaultValue(-1)]
[Browsable(false)]
+ [DefaultValue(-1)]
public int SelectedIndex {
get {
return selected_index;
}
-
set {
- if (value < -1 || value > items.Count)
- throw new ArgumentException (String.Format ("Boundaries are -1 to {0}", items.Count-1));
+ object before = (selected_index >= 0) ? items[selected_index] : null;
selected_index = value;
- UpdateEditText ();
+ UpdateEditText();
+
+ object after = (selected_index >= 0) ? items[selected_index] : null;
+
+ if (!ReferenceEquals(before, after)) {
+ OnSelectedItemChanged(this, EventArgs.Empty);
+ }
}
}
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public object SelectedItem {
get {
- if (selected_index == -1)
+ if (selected_index >= 0) {
+ return items[selected_index];
+ } else {
return null;
-
- return items [selected_index];
+ }
}
set {
- for (int i = 0; i < items.Count; i++)
- if (items [i] == value){
- SelectedIndex = i;
- break;
- }
+ SelectedIndex = items.IndexOf(value);
}
}
get {
return sorted;
}
-
set {
- //
- // It never returns to unsorted state
- //
-
sorted = value;
-
+
if (sorted)
- items.Sort ();
+ items.PrivSort();
}
}
- [DefaultValue (false)]
+ [DefaultValue(false)]
+ [Localizable(true)]
public bool Wrap {
get {
return wrap;
}
-
set {
wrap = value;
}
}
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ public override void DownButton() {
+ if (UserEdit)
+ go_to_user_input();
+
+ int new_index = selected_index + 1;
+
+ if (new_index >= items.Count) {
+ if (!wrap)
+ return;
+
+ new_index = 0;
+ }
+
+ SelectedIndex = new_index;
+ }
+
+ public override string ToString() {
+ return base.ToString() + ", Items.Count: " + items.Count + ", SelectedIndex: " + selected_index;
+ }
+
+ public override void UpButton() {
+ if (UserEdit)
+ go_to_user_input();
+
+ int new_index = selected_index - 1;
+
+ if (new_index < 0) {
+ if (!wrap) {
+ return;
+ }
+
+ new_index = items.Count - 1;
+ }
+
+ SelectedIndex = new_index;
+ }
+ #endregion // Public Instance Methods
+
+ #region Protected Instance Methods
+ protected override AccessibleObject CreateAccessibilityInstance() {
+ AccessibleObject acc;
+
+ acc = new AccessibleObject(this);
+ acc.role = AccessibleRole.SpinButton;
+
+ return acc;
+ }
+
+ protected override void OnChanged(object source, EventArgs e) {
+ base.OnChanged (source, e);
+ }
+
+ protected void OnSelectedItemChanged(object source, EventArgs e) {
+ EventHandler handler = SelectedItemChanged;
+
+ if (handler != null)
+ handler(source, e);
+ }
+
+ protected override void UpdateEditText() {
+ if ((selected_index >= 0) && (selected_index < items.Count)) {
+ ChangingText = true;
+ Text = items.string_cache[selected_index].ToString();
+ }
+ }
- public override string ToString ()
- {
- return String.Format ("{0} Count={1} Selected={2}", base.ToString (), items.Count, selected_index);
+ protected override void OnTextBoxKeyDown(object source, KeyEventArgs e) {
+ base.OnTextBoxKeyDown (source, e);
}
+
+ #endregion // Protected Instance Methods
+
+ #region Events
+ public event EventHandler SelectedItemChanged;
+ #endregion // Events
}
}
private Form owner;
private Form.ControlCollection owned_forms;
private MdiClient mdi_container;
+ private MdiChildContext mdi_child_context;
private Form mdi_parent;
private bool key_preview;
private MainMenu menu;
}
set {
+ SuspendLayout ();
+
+ // TopLevel = true;
+
+ if (!value.IsMdiContainer)
+ throw new ArgumentException ();
+
if (mdi_parent != null) {
- mdi_parent.Controls.Remove(this);
+ mdi_parent.MdiContainer.Controls.Remove (this);
}
mdi_parent = value;
if (mdi_parent != null) {
- mdi_parent.Controls.Add(this);
+ mdi_child_context = new MdiChildContext (this);
+ mdi_parent.MdiContainer.Controls.Add (this);
}
+
+ ResumeLayout ();
}
}
+ internal MdiClient MdiContainer {
+ get { return mdi_container; }
+ }
+
[DefaultValue(null)]
public MainMenu Menu {
get {
}
set {
+ if (!value && IsMdiContainer)
+ throw new ArgumentException ("MDI Container forms must be top level.");
SetTopLevel(value);
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected override void WndProc(ref Message m) {
+
+ if (IsMdiChild && mdi_child_context.HandleMessage (ref m)) {
+ return;
+ }
+
switch((Msg)m.Msg) {
case Msg.WM_CLOSE: {
CancelEventArgs args = new CancelEventArgs();
public bool Contains (DataGridColumnStyle column)
{
- return items.Contains (column);
+ return (FromColumnNameToIndex (column.MappingName) != -1);
}
-
public bool Contains (PropertyDescriptor propDesc)
{
public bool Contains (string name)
{
- return (this[name] != null);
+ return (FromColumnNameToIndex (name) != -1);
}
void ICollection.CopyTo (Array dest, int index)
}
#region Public Instance Properties
- public DataGridTableStyle this[string columnName] {
+ public DataGridTableStyle this[string tableName] {
get {
- int idx = FromColumnNameToIndex (columnName);
+ int idx = FromTableNameToIndex (tableName);
return idx == -1 ? null : this [idx];
}
}
#endregion Public Instance Properties
#region Public Instance Methods
- public virtual int Add (DataGridTableStyle column)
+ public virtual int Add (DataGridTableStyle table)
{
- int cnt = AddInternal (column);
- OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, column));
+ int cnt = AddInternal (table);
+ OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, table));
return cnt;
}
- public void AddRange (DataGridTableStyle[] columns)
+ public void AddRange (DataGridTableStyle[] tables)
{
- foreach (DataGridTableStyle mi in columns)
+ foreach (DataGridTableStyle mi in tables)
AddInternal (mi);
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh , null));
}
- public bool Contains (DataGridTableStyle column)
+ public bool Contains (DataGridTableStyle table)
{
- return items.Contains (column);
+ return (FromTableNameToIndex (table.MappingName) != -1);
}
public bool Contains (string name)
{
- return (this[name] != null);
+ return (FromTableNameToIndex (name) != -1);
}
void ICollection.CopyTo (Array dest, int index)
#region Private Instance Methods
- private int AddInternal (DataGridTableStyle column)
+ private int AddInternal (DataGridTableStyle table)
{
- if (FromColumnNameToIndex (column.MappingName) != -1) {
+ if (FromTableNameToIndex (table.MappingName) != -1) {
throw new ArgumentException ("The TableStyles collection already has a TableStyle with this mapping name");
}
- column.DataGrid = owner;
- int cnt = items.Add (column);
+ table.DataGrid = owner;
+ int cnt = items.Add (table);
return cnt;
}
- private int FromColumnNameToIndex (string columnName)
+ private int FromTableNameToIndex (string tableName)
{
for (int i = 0; i < items.Count; i++) {
- DataGridTableStyle column = (DataGridTableStyle) items[i];
- if (column.MappingName == columnName) {
+ DataGridTableStyle table = (DataGridTableStyle) items[i];
+
+ if (table.MappingName == null)
+ continue;
+
+ if (String.Compare (table.MappingName, tableName, true) == 0) {
return i;
}
}
// Peter Bartok pbartok@novell.com
//
+// If we ever need to support the Handle property, we should create a static ArrayList,
+// and store the ImageList object in it, and return the index as handle
+// That way, once we try to support P/Invokes, we can make the handle back to the object
+
// COMPLETE
private Color transparency_color;
private Delegate handler;
private ImageListStreamer image_stream;
+ private IntPtr handle;
#endregion // Local Variables
#region Sub-classes
transparency_color = Color.Transparent;
size = new Size(16, 16);
image_collection = new ImageCollection(this);
+ handle = IntPtr.Zero;
}
public ImageList(System.ComponentModel.IContainer container) : this ()
}
}
- [MonoTODO("Determine if we support HBITMAP handles, this would involve XplatUI")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IntPtr Handle {
get {
if (RecreateHandle!=null) RecreateHandle(this, EventArgs.Empty);
- return IntPtr.Zero;
+ handle = new IntPtr(1);
+ return handle;
}
}
- [MonoTODO("Determine if we support HBITMAP handles, this would involve XplatUI")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool HandleCreated {
get {
+ if (handle != IntPtr.Zero) {
+ return true;
+ }
return false;
}
}
--- /dev/null
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc.
+//
+// Authors:
+// Matthias Felgner matthiasf@voelcker.com
+//
+
+// COMPLETE
+
+using System.ComponentModel;
+
+
+namespace System.Windows.Forms {
+ internal class ImageListConverter : ComponentConverter {
+ #region Constructors
+ public ImageListConverter() : base(typeof(ImageList)) {
+ }
+ #endregion Constructors
+
+ #region Public Methods
+ public override bool GetPropertiesSupported(ITypeDescriptorContext context){
+ return true;
+ }
+ #endregion Public Methods
+ }
+}
}
[MonoTODO ("RLE is broken")]
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
+ public void GetObjectData (SerializationInfo info, StreamingContext context)
{
MemoryStream stream = new MemoryStream ();
BinaryWriter writer = new BinaryWriter (stream);
#endregion // Public Constructors
#region Public Instance Methods
- [MonoTODO]
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {\r
+ if (destinationType == typeof(string)) {\r
+ return true;\r
+ }\r
return base.CanConvertTo (context, destinationType);\r
}\r
return base.ConvertTo (context, culture, value, destinationType);\r
}\r
\r
- [MonoTODO]
public override object CreateInstance(ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) {\r
- return base.CreateInstance (context, propertyValues);\r
+ return new Binding((string)propertyValues["PropertyName"], (object)propertyValues["DataSource"], (string)propertyValues["DataMember"]);\r
}\r
\r
- [MonoTODO]
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context) {\r
- return base.GetCreateInstanceSupported (context);\r
+ return true;\r
}\r
#endregion // Public Instance Methods
}
--- /dev/null
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace System.Windows.Forms {
+
+ internal class MdiChildContext {
+
+ private static Color titlebar_color;
+
+ private int BorderWidth = 3;
+ private int TitleBarHeight = 25;
+ private Size MinTitleBarSize = new Size (115, 25);
+
+ private Form form;
+ private Button close_button;
+ private Button maximize_button;
+ private Button minimize_button;
+
+ // moving windows
+ private Point start;
+ private State state;
+ private FormPos sizing_edge;
+ private Rectangle virtual_position;
+ private Rectangle prev_bounds;
+ private bool maximized;
+
+
+ private enum State {
+ Idle,
+ Moving,
+ Sizing,
+ }
+
+ [Flags]
+ private enum FormPos {
+ None,
+
+ TitleBar = 1,
+
+ Top = 2,
+ Left = 4,
+ Right = 8,
+ Bottom = 16,
+
+ TopLeft = Top | Left,
+ TopRight = Top | Right,
+
+ BottomLeft = Bottom | Left,
+ BottomRight = Bottom | Right,
+
+ AnyEdge = Top | Left | Right | Bottom,
+ }
+
+ public MdiChildContext (Form form)
+ {
+ titlebar_color = Color.FromArgb (255, 0, 0, 255);
+ this.form = form;
+
+ form.Paint += new PaintEventHandler (PaintWindowDecorations);
+
+ minimize_button = new Button ();
+ minimize_button.Bounds = new Rectangle (form.Width - 62,
+ BorderWidth + 2, 18, 22);
+ minimize_button.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ minimize_button.Paint += new PaintEventHandler (PaintButtonHandler);
+ minimize_button.Click += new EventHandler (OnMinimizeHandler);
+
+ maximize_button = new Button ();
+ maximize_button.Bounds = new Rectangle (form.Width - 44,
+ BorderWidth + 2, 18, 22);
+ maximize_button.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ maximize_button.Paint += new PaintEventHandler (PaintButtonHandler);
+ maximize_button.Click += new EventHandler (OnMaximizeHandler);
+
+ close_button = new Button ();
+ close_button.Bounds = new Rectangle (form.Width - 24,
+ BorderWidth + 2, 18, 22);
+ close_button.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ close_button.Paint += new PaintEventHandler (PaintButtonHandler);
+ close_button.Click += new EventHandler (CloseButtonClicked);
+
+
+ form.Controls.Add (close_button);
+ form.Controls.Add (maximize_button);
+ form.Controls.Add (minimize_button);
+ }
+
+ public bool HandleMessage (ref Message m)
+ {
+ switch ((Msg)m.Msg) {
+ //case Msg.WM_PAINT:
+ //DrawWindowDecorations (form.CreateGraphics ());
+ //break;
+
+ case Msg.WM_LBUTTONDOWN:
+ return HandleLButtonDown (form, ref m);
+
+ case Msg.WM_MOUSEMOVE:
+ return HandleMouseMove (form, ref m);
+
+ case Msg.WM_LBUTTONUP:
+ HandleLButtonUp (ref m);
+ break;
+ }
+ return false;
+ }
+
+
+ private bool HandleLButtonDown (Form form, ref Message m)
+ {
+ form.BringToFront ();
+
+ int x = Control.LowOrder ((int) m.LParam.ToInt32 ());
+ int y = Control.HighOrder ((int) m.LParam.ToInt32 ());
+ FormPos pos = FormPosForCoords (x, y);
+
+ start = new Point (x, y);
+ virtual_position = form.Bounds;
+
+ if (pos == FormPos.TitleBar) {
+ HandleTitleBarDown (x, y);
+ return true;
+ }
+
+ SetCursorForPos (pos);
+
+ if ((pos & FormPos.AnyEdge) == 0)
+ return false;
+
+ state = State.Sizing;
+ sizing_edge = pos;
+ form.Capture = true;
+
+ return true;
+ }
+
+ private void HandleTitleBarDown (int x, int y)
+ {
+ state = State.Moving;
+ form.Capture = true;
+ }
+
+ private bool HandleMouseMove (Form form, ref Message m)
+ {
+ switch (state) {
+ case State.Moving:
+ HandleWindowMove (m);
+ return true;
+ case State.Sizing:
+ HandleSizing (m);
+ return true;
+ }
+
+ int x = Control.LowOrder ((int) m.LParam.ToInt32 ());
+ int y = Control.HighOrder ((int) m.LParam.ToInt32 ());
+ FormPos pos = FormPosForCoords (x, y);
+
+ SetCursorForPos (pos);
+
+ state = State.Idle;
+ return false;
+ }
+
+ private void SetCursorForPos (FormPos pos)
+ {
+ switch (pos) {
+ case FormPos.TopLeft:
+ case FormPos.BottomRight:
+ form.Cursor = Cursors.SizeNWSE;
+ break;
+ case FormPos.TopRight:
+ case FormPos.BottomLeft:
+ form.Cursor = Cursors.SizeNESW;
+ break;
+ case FormPos.Top:
+ case FormPos.Bottom:
+ form.Cursor = Cursors.SizeNS;
+ break;
+ case FormPos.Left:
+ case FormPos.Right:
+ form.Cursor = Cursors.SizeWE;
+ break;
+ default:
+ form.Cursor = Cursors.Default;
+ break;
+ }
+ }
+
+ private void HandleWindowMove (Message m)
+ {
+ Point move = MouseMove (m);
+
+ virtual_position.X = form.Left + move.X;
+ virtual_position.Y = form.Top + move.Y;
+ virtual_position.Width = form.Width;
+ virtual_position.Height = form.Height;
+
+ Graphics g = form.Parent.CreateGraphics ();
+ DrawVirtualPosition (g);
+ }
+
+ private void HandleSizing (Message m)
+ {
+ Point move = MouseMove (m);
+ Rectangle pos = virtual_position;
+ int mw = MinTitleBarSize.Width + (BorderWidth * 2);
+ int mh = MinTitleBarSize.Height + (BorderWidth * 2);
+
+ if ((sizing_edge & FormPos.Top) != 0) {
+ int height = form.Height - move.Y;
+ if (height <= mh) {
+ move.Y += height - mh;
+ height = mh;
+ }
+ pos.Y = form.Top + move.Y;
+ pos.Height = height;
+ } else if ((sizing_edge & FormPos.Bottom) != 0) {
+ int height = form.Height + move.Y;
+ if (height <= mh)
+ move.Y -= height - mh;
+ pos.Height = form.Height + move.Y;
+ }
+
+ if ((sizing_edge & FormPos.Left) != 0) {
+ int width = form.Width - move.X;
+ if (width <= mw) {
+ move.X += width - mw;
+ width = mw;
+ }
+ pos.X = form.Left + move.X;
+ pos.Width = width;
+ } else if ((sizing_edge & FormPos.Right) != 0) {
+ int width = form.Width + move.X;
+ if (width <= mw)
+ move.X -= width - mw;
+ pos.Width = form.Width + move.X;
+ }
+
+ UpdateVP (pos);
+ }
+
+ private void UpdateVP (Rectangle r)
+ {
+ UpdateVP (r.X, r.Y, r.Width, r.Height);
+ }
+
+ private void UpdateVP (Point loc, int w, int h)
+ {
+ UpdateVP (loc.X, loc.Y, w, h);
+ }
+
+ private void UpdateVP (int x, int y, int w, int h)
+ {
+ virtual_position.X = x;
+ virtual_position.Y = y;
+ virtual_position.Width = w;
+ virtual_position.Height = h;
+
+ Graphics g = form.Parent.CreateGraphics ();
+ DrawVirtualPosition (g);
+ }
+
+ private void HandleLButtonUp (ref Message m)
+ {
+ if (state == State.Idle)
+ return;
+
+ form.Capture = false;
+
+ // Clear the virtual position
+ Graphics g = form.Parent.CreateGraphics ();
+ g.Clear (form.Parent.BackColor);
+
+ form.Bounds = virtual_position;
+ state = State.Idle;
+ }
+
+ private void PaintWindowDecorations (object sender, PaintEventArgs pe)
+ {
+ Color color = titlebar_color;
+ if (maximized)
+ color = ThemeEngine.Current.ColorButtonFace;
+ pe.Graphics.FillRectangle (new SolidBrush (color),
+ BorderWidth, BorderWidth,
+ form.Width - BorderWidth, TitleBarHeight);
+
+ if (form.Icon != null) {
+ pe.Graphics.DrawIcon (form.Icon, BorderWidth, BorderWidth);
+ }
+
+ Pen bp = new Pen (ThemeEngine.Current.ColorButtonFace,
+ BorderWidth);
+
+ // HACK: kludge the borders around
+ Rectangle border = form.ClientRectangle;
+ border.X++;
+ border.Y++;
+ border.Width -= 4;
+ border.Height -= 4;
+ pe.Graphics.DrawRectangle (bp, border);
+
+ Border3DStyle style = Border3DStyle.Raised | Border3DStyle.Bump;
+ border = form.ClientRectangle;
+
+ if (maximized) {
+ style = Border3DStyle.SunkenInner;
+ border.Y = TitleBarHeight + BorderWidth * 2;
+ border.Height -= TitleBarHeight;
+ }
+
+ ControlPaint.DrawBorder3D (pe.Graphics, border,
+ style,
+ Border3DSide.Left | Border3DSide.Right |
+ Border3DSide.Top | Border3DSide.Bottom);
+
+ }
+
+ private void PaintButtonHandler (object sender, PaintEventArgs pe)
+ {
+ if (sender == close_button) {
+ ControlPaint.DrawCaptionButton (pe.Graphics,
+ close_button.ClientRectangle,
+ CaptionButton.Close,
+ close_button.ButtonState);
+ } else if (sender == maximize_button) {
+ ControlPaint.DrawCaptionButton (pe.Graphics,
+ maximize_button.ClientRectangle,
+ CaptionButton.Maximize,
+ maximize_button.ButtonState);
+ } else if (sender == minimize_button) {
+ ControlPaint.DrawCaptionButton (pe.Graphics,
+ minimize_button.ClientRectangle,
+ CaptionButton.Minimize,
+ minimize_button.ButtonState);
+ }
+ }
+
+ private void CloseButtonClicked (object sender, EventArgs e)
+ {
+ form.Close ();
+ // form.Close should set visibility to false somewhere
+ // in it's closing chain but currently does not.
+ form.Visible = false;
+ }
+
+ private void OnMinimizeHandler (object sender, EventArgs e)
+ {
+ form.SuspendLayout ();
+ form.Width = MinTitleBarSize.Width + (BorderWidth * 2);
+ form.Height = MinTitleBarSize.Height + (BorderWidth * 2);
+ form.ResumeLayout ();
+ }
+
+ private void OnMaximizeHandler (object sender, EventArgs e)
+ {
+ if (maximized) {
+ form.Bounds = prev_bounds;
+ maximized = false;
+ } else {
+ prev_bounds = form.Bounds;
+ form.Bounds = form.Parent.Bounds;
+ maximized = true;
+ }
+ }
+
+ private Point NewLocation (Message m)
+ {
+ int x = Control.LowOrder ((int) m.LParam.ToInt32 ());
+ int y = Control.HighOrder ((int) m.LParam.ToInt32 ());
+ int x_move = x - start.X;
+ int y_move = y - start.Y;
+
+ return new Point (form.Left + x_move, form.Top + y_move);
+ }
+
+ private Point MouseMove (Message m)
+ {
+ int x = Control.LowOrder ((int) m.LParam.ToInt32 ());
+ int y = Control.HighOrder ((int) m.LParam.ToInt32 ());
+ int x_move = x - start.X;
+ int y_move = y - start.Y;
+
+ return new Point (x_move, y_move);
+ }
+
+ // For now just use a solid pen as it is 10 billion times
+ // faster then using the hatch, and what we really need is invert
+ private void DrawVirtualPosition (Graphics graphics)
+ {
+ Pen pen = new Pen (Color.Black, 3);
+
+ graphics.Clear (form.Parent.BackColor);
+ graphics.DrawRectangle (pen, virtual_position);
+ pen.Dispose ();
+ }
+
+ private FormPos FormPosForCoords (int x, int y)
+ {
+ if (y < TitleBarHeight + BorderWidth) {
+
+ if (y > BorderWidth && x > BorderWidth &&
+ x < form.Width - BorderWidth)
+ return FormPos.TitleBar;
+
+ if (x < BorderWidth || (x < 20 && y < BorderWidth))
+ return FormPos.TopLeft;
+
+ if (x > form.Width - BorderWidth ||
+ (x > form.Width - 20 && y < BorderWidth))
+ return FormPos.TopRight;
+
+ if (y < BorderWidth)
+ return FormPos.Top;
+
+ } else if (y > form.Height - 20) {
+
+ if (x < BorderWidth ||
+ (x < 20 && y > form.Height - BorderWidth))
+ return FormPos.BottomLeft;
+
+ if (x > form.Width - BorderWidth ||
+ (x > form.Width - 20 &&
+ y > form.Height - BorderWidth))
+ return FormPos.BottomRight;
+
+ if (y > form.Height - BorderWidth)
+ return FormPos.Bottom;
+
+
+ } else if (x < BorderWidth) {
+ return FormPos.Left;
+ } else if (x > form.Width - BorderWidth) {
+ return FormPos.Right;
+ }
+
+ return FormPos.None;
+ }
+ }
+
+}
+
#region Public Classes
public new class ControlCollection : Control.ControlCollection {
MdiClient owner;
-
+
public ControlCollection(MdiClient owner) : base(owner) {
this.owner = owner;
+ controls = new ArrayList ();
}
public override void Add(Control value) {
- if ((value is Form) == false || (((Form)value).IsMdiChild)) {
+ if ((value is Form) == false || !(((Form)value).IsMdiChild)) {
throw new ArgumentException("Form must be MdiChild");
}
-
- for (int i=0; i<list.Count; i++) {
- if (list[i]==value) {
- // Do we need to do anything here?
- return;
- }
- }
- list.Add(value);
- //((Form)value).owner=(Form)owner;
+ base.Add (value);
}
public override void Remove(Control value) {
- //((Form)value).owner = null;
base.Remove (value);
}
}
#region Public Constructors
public MdiClient() {
+ BackColor = SystemColors.AppWorkspace;
+ Dock = DockStyle.Fill;
}
#endregion // Public Constructors
+ protected override Control.ControlCollection CreateControlsInstance ()
+ {
+ return new MdiClient.ControlCollection (this);
+ }
+
+ protected override void WndProc(ref Message m) {
+ /*
+ switch ((Msg) m.Msg) {
+ case Msg.WM_PAINT: {
+ Console.WriteLine ("ignoring paint");
+ return;
+ }
+ }
+ */
+ base.WndProc (ref m);
+ }
#region Public Instance Properties
[Localizable(true)]
public override System.Drawing.Image BackgroundImage {
}
#endregion // Public Instance Properties
- #region Protected Instance Properties
+#region Protected Instance Properties
protected override CreateParams CreateParams {
get {
- XplatUIWin32.CLIENTCREATESTRUCT ccs;
- CreateParams cp;
-
- cp = base.CreateParams;
-
- if (parent != null) {
- cp.X = 0;
- cp.Y = 0;
- cp.Width = parent.Width;
- cp.Height = parent.Height;
- }
-
-
- ccs = new System.Windows.Forms.XplatUIWin32.CLIENTCREATESTRUCT();
- ccs.hWindowMenu = IntPtr.Zero;
- ccs.idFirstChild = 27577;
- cp.Param = ccs;
-
- cp.ClassName = "MDICLIENT";
- cp.Style |= (int)(WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE);
- cp.ExStyle |= (int)WindowStyles.WS_EX_MDICHILD;
-
- return cp;
+ return base.CreateParams;
}
}
#endregion // Protected Instance Properties
//
// REMAINING TODO:
// - get the date_cell_size and title_size to be pixel perfect match of SWF
-// - show the year spin control
using System;
using System.Collections;
bool today_date_set;
Color trailing_fore_color;
ContextMenu menu;
+ NumericUpDown year_updown;
Timer timer;
// internal variables used
internal bool is_next_clicked;
internal bool is_shift_pressed;
internal DateTime first_select_start_date;
+ internal int last_clicked_calendar_index;
+ internal Rectangle last_clicked_calendar_rect;
private Point month_title_click_location;
// this is used to see which item was actually clicked on in the beginning
// so that we know which item to fire on timer
first_select_start_date = now;
month_title_click_location = Point.Empty;
+ // set up context menu
SetUpContextMenu ();
+ // set up the year up down control
+ year_updown = new NumericUpDown();
+ year_updown.Font = this.Font;
+ year_updown.Minimum = MinDate.Year;
+ year_updown.Maximum = MaxDate.Year;
+ year_updown.ReadOnly = true;
+ year_updown.Visible = false;
+ this.Controls.Add(year_updown);
+
// event handlers
// LostFocus += new EventHandler (LostFocusHandler);
timer.Tick += new EventHandler (TimerHandler);
KeyDown += new KeyEventHandler (KeyDownHandler);
MouseUp += new MouseEventHandler (MouseUpHandler);
KeyUp += new KeyEventHandler (KeyUpHandler);
- // this replaces paint so call the control version
+ year_updown.ValueChanged += new EventHandler(UpDownYearChangedHandler);
+
+ // this replaces paint so call the control version
((Control)this).Paint += new PaintEventHandler (PaintHandler);
}
}
}
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override Image BackgroundImage {
+ get {
+ return base.BackgroundImage;
+ }
+ set {
+ base.BackgroundImage = value;
+ }
+ }
+
+
// the back color for the main part of the calendar
public Color BackColor {
set {
}
}
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImeMode ImeMode {
+ get {
+ return ime_mode;
+ }
+
+ set {
+ if (ime_mode != value) {
+ ime_mode = value;
+
+ if (ImeModeChanged != null) {
+ ImeModeChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+ }
+
// the maximum date allowed to be selected on this month calendar
public DateTime MaxDate {
set {
}
}
+ [Bindable(false)]
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string Text {
+ get {
+ return base.Text;
+ }
+ set {
+ base.Text = value;
+ }
+ }
+
// the back color for the title of the calendar and the
// forecolor for the day of the week text
public Color TitleBackColor {
// returns a HitTestInfo for MonthCalendar element's under the specified point
public HitTestInfo HitTest (Point point) {
- // before doing all the hard work, see if the today's date wasn't clicked
- Rectangle today_rect = new Rectangle (
- ClientRectangle.X,
- ClientRectangle.Bottom - date_cell_size.Height,
- 7 * date_cell_size.Width,
- date_cell_size.Height);
- if (today_rect.Contains (point) && this.ShowToday) {
- return new HitTestInfo(HitArea.TodayLink, point, DateTime.Now);
- }
-
- Size month_size = SingleMonthSize;
- // define calendar rect's that this thing can land in
- Rectangle[] calendars = new Rectangle [CalendarDimensions.Width * CalendarDimensions.Height];
- for (int i=0; i < CalendarDimensions.Width * CalendarDimensions.Height; i ++) {
- if (i == 0) {
- calendars[i] = new Rectangle (
- new Point (ClientRectangle.X + 1, ClientRectangle.Y + 1),
- month_size);
- } else {
- // calendar on the next row
- if (i % CalendarDimensions.Width == 0) {
- calendars[i] = new Rectangle (
- new Point (calendars[i-CalendarDimensions.Width].X, calendars[i-CalendarDimensions.Width].Bottom + calendar_spacing.Height),
- month_size);
- } else {
- // calendar on the next column
- calendars[i] = new Rectangle (
- new Point (calendars[i-1].Right + calendar_spacing.Width, calendars[i-1].Y),
- month_size);
- }
- }
- }
-
- // through each trying to find a match
- for (int i = 0; i < calendars.Length ; i++) {
- if (calendars[i].Contains (point)) {
- // check the title section
- Rectangle title_rect = new Rectangle (
- calendars[i].Location,
- title_size);
- if (title_rect.Contains (point) ) {
- // make sure it's not a previous button
- if (i == 0) {
- Rectangle button_rect = new Rectangle(
- new Point (calendars[i].X + button_x_offset, (title_size.Height - button_size.Height)/2),
- button_size);
- if (button_rect.Contains (point)) \r
- {
- return new HitTestInfo(HitArea.PrevMonthButton, point, DateTime.Now);
- }
- }
- // make sure it's not the next button
- if (i % CalendarDimensions.Height == 0 && i % CalendarDimensions.Width == calendar_dimensions.Width - 1) {
- Rectangle button_rect = new Rectangle(
- new Point (calendars[i].Right - button_x_offset - button_size.Width, (title_size.Height - button_size.Height)/2),
- button_size);
- if (button_rect.Contains (point)) \r
- {
- return new HitTestInfo(HitArea.NextMonthButton, point, DateTime.Now);
- }
- }
-
- // make sure it's not the month or the year of the calendar
- if (GetMonthNameRectangle (title_rect, i).Contains (point)) {
- return new HitTestInfo(HitArea.TitleMonth, point, DateTime.Now);
- }
- if (GetYearNameRectangle (title_rect, i).Contains (point)) {
- return new HitTestInfo(HitArea.TitleYear, point, DateTime.Now);
- }
-
- // return the hit test in the title background
- return new HitTestInfo(HitArea.TitleBackground, point, DateTime.Now);
- }
-
- Point date_grid_location = new Point (calendars[i].X, title_rect.Bottom);
-
- // see if it's in the Week numbers
- if (ShowWeekNumbers) {
- Rectangle weeks_rect = new Rectangle (
- date_grid_location,
- new Size (date_cell_size.Width,Math.Max (calendars[i].Height - title_rect.Height, 0)));
- if (weeks_rect.Contains (point)) {
- return new HitTestInfo(HitArea.WeekNumbers, point, DateTime.Now);
- }
-
- // move the location of the grid over
- date_grid_location.X += date_cell_size.Width;
- }
-
- // see if it's in the week names
- Rectangle day_rect = new Rectangle (
- date_grid_location,
- new Size (Math.Max (calendars[i].Right - date_grid_location.X, 0), date_cell_size.Height));
- if (day_rect.Contains (point)) {
- return new HitTestInfo(HitArea.DayOfWeek, point, DateTime.Now);
- }
-
- // finally see if it was a date that was clicked
- Rectangle date_grid = new Rectangle (
- new Point (day_rect.X, day_rect.Bottom),
- new Size (day_rect.Width, Math.Max(calendars[i].Bottom - day_rect.Bottom, 0)));
- if (date_grid.Contains (point)) {
- // okay so it's inside the grid, get the offset
- Point offset = new Point (point.X - date_grid.X, point.Y - date_grid.Y);
- int row = offset.Y / date_cell_size.Height;
- int col = offset.X / date_cell_size.Width;
- // establish our first day of the month
- DateTime calendar_month = this.CurrentMonth.AddMonths(i);
- DateTime first_day = GetFirstDateInMonthGrid (calendar_month);
- DateTime time = first_day.AddDays ((row * 7) + col);
- // establish which date was clicked
- if (time.Year != calendar_month.Year || time.Month != calendar_month.Month) {
- if (time < calendar_month && i == 0) {
- return new HitTestInfo(HitArea.PrevMonthDate, point, time);
- } else if (time > calendar_month && i == CalendarDimensions.Width*CalendarDimensions.Height - 1) {
- return new HitTestInfo(HitArea.NextMonthDate, point, time);
- }
- return new HitTestInfo(HitArea.Nowhere, point, time);
- }
- return new HitTestInfo(HitArea.Date, point, time);
- }
- }
- }
-
- return new HitTestInfo ();
+ return HitTest (point, out last_clicked_calendar_index, out last_clicked_calendar_rect);
}
// clears all the annually bolded dates
// fired when the user explicitely clicks on date to select it
public event DateRangeEventHandler DateSelected;
- [MonoTODO("Fire BackgroundImageChanged event")]
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public event EventHandler BackgroundImageChanged;
- [MonoTODO("Fire Click event")]
+ // this event is overridden to supress it from being fired
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public event EventHandler Click;
- [MonoTODO("Fire DoubleClick event")]
+ // this event is overridden to supress it from being fired
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public event EventHandler DoubleClick;
- [MonoTODO("Fire ImeModeChanged event")]
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public event EventHandler ImeModeChanged;
[EditorBrowsable (EditorBrowsableState.Never)]
public new event PaintEventHandler Paint;
- [MonoTODO("Fire TextChanged event")]
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public event EventHandler TextChanged;
#endregion // internal properties
#region internal/private methods
+ internal HitTestInfo HitTest (
+ Point point,
+ out int calendar_index,
+ out Rectangle calendar_rect) {
+ // start by initialising the ref parameters
+ calendar_index = -1;
+ calendar_rect = Rectangle.Empty;
+
+ // before doing all the hard work, see if the today's date wasn't clicked
+ Rectangle today_rect = new Rectangle (
+ ClientRectangle.X,
+ ClientRectangle.Bottom - date_cell_size.Height,
+ 7 * date_cell_size.Width,
+ date_cell_size.Height);
+ if (today_rect.Contains (point) && this.ShowToday) {
+ return new HitTestInfo(HitArea.TodayLink, point, DateTime.Now);
+ }
+
+ Size month_size = SingleMonthSize;
+ // define calendar rect's that this thing can land in
+ Rectangle[] calendars = new Rectangle [CalendarDimensions.Width * CalendarDimensions.Height];
+ for (int i=0; i < CalendarDimensions.Width * CalendarDimensions.Height; i ++) {
+ if (i == 0) {
+ calendars[i] = new Rectangle (
+ new Point (ClientRectangle.X + 1, ClientRectangle.Y + 1),
+ month_size);
+ } else {
+ // calendar on the next row
+ if (i % CalendarDimensions.Width == 0) {
+ calendars[i] = new Rectangle (
+ new Point (calendars[i-CalendarDimensions.Width].X, calendars[i-CalendarDimensions.Width].Bottom + calendar_spacing.Height),
+ month_size);
+ } else {
+ // calendar on the next column
+ calendars[i] = new Rectangle (
+ new Point (calendars[i-1].Right + calendar_spacing.Width, calendars[i-1].Y),
+ month_size);
+ }
+ }
+ }
+
+ // through each trying to find a match
+ for (int i = 0; i < calendars.Length ; i++) {
+ if (calendars[i].Contains (point)) {
+ // check the title section
+ Rectangle title_rect = new Rectangle (
+ calendars[i].Location,
+ title_size);
+ if (title_rect.Contains (point) ) {
+ // make sure it's not a previous button
+ if (i == 0) {
+ Rectangle button_rect = new Rectangle(
+ new Point (calendars[i].X + button_x_offset, (title_size.Height - button_size.Height)/2),
+ button_size);
+ if (button_rect.Contains (point)) {
+ return new HitTestInfo(HitArea.PrevMonthButton, point, DateTime.Now);
+ }
+ }
+ // make sure it's not the next button
+ if (i % CalendarDimensions.Height == 0 && i % CalendarDimensions.Width == calendar_dimensions.Width - 1) {
+ Rectangle button_rect = new Rectangle(
+ new Point (calendars[i].Right - button_x_offset - button_size.Width, (title_size.Height - button_size.Height)/2),
+ button_size);
+ if (button_rect.Contains (point)) {
+ return new HitTestInfo(HitArea.NextMonthButton, point, DateTime.Now);
+ }
+ }
+
+ // indicate which calendar and month it was
+ calendar_index = i;
+ calendar_rect = calendars[i];
+
+ // make sure it's not the month or the year of the calendar
+ if (GetMonthNameRectangle (title_rect, i).Contains (point)) {
+ return new HitTestInfo(HitArea.TitleMonth, point, DateTime.Now);
+ }
+ if (GetYearNameRectangle (title_rect, i).Contains (point)) {
+ return new HitTestInfo(HitArea.TitleYear, point, DateTime.Now);
+ }
+
+ // return the hit test in the title background
+ return new HitTestInfo(HitArea.TitleBackground, point, DateTime.Now);
+ }
+
+ Point date_grid_location = new Point (calendars[i].X, title_rect.Bottom);
+
+ // see if it's in the Week numbers
+ if (ShowWeekNumbers) {
+ Rectangle weeks_rect = new Rectangle (
+ date_grid_location,
+ new Size (date_cell_size.Width,Math.Max (calendars[i].Height - title_rect.Height, 0)));
+ if (weeks_rect.Contains (point)) {
+ return new HitTestInfo(HitArea.WeekNumbers, point, DateTime.Now);
+ }
+
+ // move the location of the grid over
+ date_grid_location.X += date_cell_size.Width;
+ }
+
+ // see if it's in the week names
+ Rectangle day_rect = new Rectangle (
+ date_grid_location,
+ new Size (Math.Max (calendars[i].Right - date_grid_location.X, 0), date_cell_size.Height));
+ if (day_rect.Contains (point)) {
+ return new HitTestInfo(HitArea.DayOfWeek, point, DateTime.Now);
+ }
+
+ // finally see if it was a date that was clicked
+ Rectangle date_grid = new Rectangle (
+ new Point (day_rect.X, day_rect.Bottom),
+ new Size (day_rect.Width, Math.Max(calendars[i].Bottom - day_rect.Bottom, 0)));
+ if (date_grid.Contains (point)) {
+ // okay so it's inside the grid, get the offset
+ Point offset = new Point (point.X - date_grid.X, point.Y - date_grid.Y);
+ int row = offset.Y / date_cell_size.Height;
+ int col = offset.X / date_cell_size.Width;
+ // establish our first day of the month
+ DateTime calendar_month = this.CurrentMonth.AddMonths(i);
+ DateTime first_day = GetFirstDateInMonthGrid (calendar_month);
+ DateTime time = first_day.AddDays ((row * 7) + col);
+ // establish which date was clicked
+ if (time.Year != calendar_month.Year || time.Month != calendar_month.Month) {
+ if (time < calendar_month && i == 0) {
+ return new HitTestInfo(HitArea.PrevMonthDate, point, time);
+ } else if (time > calendar_month && i == CalendarDimensions.Width*CalendarDimensions.Height - 1) {
+ return new HitTestInfo(HitArea.NextMonthDate, point, time);
+ }
+ return new HitTestInfo(HitArea.Nowhere, point, time);
+ }
+ return new HitTestInfo(HitArea.Date, point, time);
+ }
+ }
+ }
+
+ return new HitTestInfo ();
+ }
// returns the date of the first cell of the specified month grid
internal DateTime GetFirstDateInMonthGrid (DateTime month) {
}
// returns the date of the last cell of the specified month grid
- internal DateTime GetLastDateInMonthGrid (DateTime month) \r
+ internal DateTime GetLastDateInMonthGrid (DateTime month)
{
DateTime start = GetFirstDateInMonthGrid(month);
return start.AddDays ((7 * 6)-1);
}
}
+ // initialises text value and show's year up down in correct position
+ private void PrepareYearUpDown (Point p) {
+ Rectangle old_location = year_updown.Bounds;
+
+ // set position
+ Rectangle title_rect = new Rectangle(
+ last_clicked_calendar_rect.Location,
+ title_size);
+
+ year_updown.Bounds = GetYearNameRectangle(
+ title_rect,
+ last_clicked_calendar_index);
+ year_updown.Top -= 4;
+ year_updown.Width += (int) (this.Font.Size * 4);
+ // set year - only do this if this isn't being called because of a year up down click
+ if(year_updown.Bounds != old_location) {
+ year_updown.Value = current_month.AddMonths(last_clicked_calendar_index).Year;
+ }
+
+ if(!year_updown.Visible) {
+ year_updown.Visible = true;
+ }
+ }
+
// returns the first date of the month
private DateTime GetFirstDateInMonth (DateTime date) {
return new DateTime (date.Year, date.Month, 1);
}
// set one item clicked and all others off
- private void SetItemClick(HitTestInfo hti) \r
+ private void SetItemClick(HitTestInfo hti)
{
switch(hti.HitArea) {
case HitArea.NextMonthButton:
}
}
+ // called when the year is changed
+ private void UpDownYearChangedHandler (object sender, EventArgs e) {
+ int initial_year_value = this.CurrentMonth.AddMonths(last_clicked_calendar_index).Year;
+ int diff = (int) year_updown.Value - initial_year_value;
+ this.CurrentMonth = this.CurrentMonth.AddYears(diff);
+ }
+
// called when context menu is clicked
private void MenuItemClickHandler (object sender, EventArgs e) {
MenuItem item = sender as MenuItem;
return;
}
}
-
+
//establish where was hit
HitTestInfo hti = this.HitTest(point);
- switch (hti.HitArea) {\r
+ // hide the year numeric up down if it was clicked
+ if (year_updown != null && year_updown.Visible && hti.HitArea != HitArea.TitleYear)
+ {
+ year_updown.Visible = false;
+ }
+ switch (hti.HitArea) {
case HitArea.PrevMonthButton:
case HitArea.NextMonthButton:
DoButtonMouseDown (hti);
menu.Show (this, hti.Point);
break;
case HitArea.TitleYear:
- //TODO: show the year spin control
- System.Console.WriteLine ("//TODO: show the year spin control");
+ // place the numeric up down
+ PrepareYearUpDown(hti.Point);
break;
case HitArea.TodayLink:
this.SetSelectionRange (DateTime.Now.Date, DateTime.Now.Date);
// raised by any key down events
private void KeyDownHandler (object sender, KeyEventArgs e) {
- if (!is_shift_pressed && e.Shift) {
- first_select_start_date = SelectionStart;
- is_shift_pressed = e.Shift;
- }
- switch (e.KeyCode) {
- case Keys.Home:
- // set the date to the start of the month
- if (is_shift_pressed) {
- DateTime date = GetFirstDateInMonth (first_select_start_date);
- if (date < first_select_start_date.AddDays ((MaxSelectionCount-1)*-1)) {
- date = first_select_start_date.AddDays ((MaxSelectionCount-1)*-1);
+ // send keys to the year_updown control, let it handle it
+ if(year_updown.Visible) {
+ switch (e.KeyCode) {
+ case Keys.Enter:
+ year_updown.Visible = false;
+ break;
+ case Keys.Up:
+ year_updown.Value = year_updown.Value + 1;
+ break;
+ case Keys.Down:
+ year_updown.Value = year_updown.Value - 1;
+ break;
+ }
+ } else {
+ if (!is_shift_pressed && e.Shift) {
+ first_select_start_date = SelectionStart;
+ is_shift_pressed = e.Shift;
+ }
+ switch (e.KeyCode) {
+ case Keys.Home:
+ // set the date to the start of the month
+ if (is_shift_pressed) {
+ DateTime date = GetFirstDateInMonth (first_select_start_date);
+ if (date < first_select_start_date.AddDays ((MaxSelectionCount-1)*-1)) {
+ date = first_select_start_date.AddDays ((MaxSelectionCount-1)*-1);
+ }
+ this.SetSelectionRange (date, first_select_start_date);
+ } else {
+ DateTime date = GetFirstDateInMonth (this.SelectionStart);
+ this.SetSelectionRange (date, date);
}
- this.SetSelectionRange (date, first_select_start_date);
- } else {
- DateTime date = GetFirstDateInMonth (this.SelectionStart);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.End:
- // set the date to the last of the month
- if (is_shift_pressed) {
- DateTime date = GetLastDateInMonth (first_select_start_date);
- if (date > first_select_start_date.AddDays (MaxSelectionCount-1)) {
- date = first_select_start_date.AddDays (MaxSelectionCount-1);
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.End:
+ // set the date to the last of the month
+ if (is_shift_pressed) {
+ DateTime date = GetLastDateInMonth (first_select_start_date);
+ if (date > first_select_start_date.AddDays (MaxSelectionCount-1)) {
+ date = first_select_start_date.AddDays (MaxSelectionCount-1);
+ }
+ this.SetSelectionRange (date, first_select_start_date);
+ } else {
+ DateTime date = GetLastDateInMonth (this.SelectionStart);
+ this.SetSelectionRange (date, date);
}
- this.SetSelectionRange (date, first_select_start_date);
- } else {
- DateTime date = GetLastDateInMonth (this.SelectionStart);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.PageUp:
- // set the date to the last of the month
- if (is_shift_pressed) {
- this.AddTimeToSelection (-1, false);
- } else {
- DateTime date = this.SelectionStart.AddMonths (-1);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.PageDown:
- // set the date to the last of the month
- if (is_shift_pressed) {
- this.AddTimeToSelection (1, false);
- } else {
- DateTime date = this.SelectionStart.AddMonths (1);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.Up:
- // set the back 1 week
- if (is_shift_pressed) {
- this.AddTimeToSelection (-7, true);
- } else {
- DateTime date = this.SelectionStart.AddDays (-7);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.Down:
- // set the date forward 1 week
- if (is_shift_pressed) {
- this.AddTimeToSelection (7, true);
- } else {
- DateTime date = this.SelectionStart.AddDays (7);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.Left:
- // move one left
- if (is_shift_pressed) {
- this.AddTimeToSelection (-1, true);
- } else {
- DateTime date = this.SelectionStart.AddDays (-1);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- case Keys.Right:
- // move one left
- if (is_shift_pressed) {
- this.AddTimeToSelection (1, true);
- } else {
- DateTime date = this.SelectionStart.AddDays (1);
- this.SetSelectionRange (date, date);
- }
- this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
- break;
- default:
- break;
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.PageUp:
+ // set the date to the last of the month
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (-1, false);
+ } else {
+ DateTime date = this.SelectionStart.AddMonths (-1);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.PageDown:
+ // set the date to the last of the month
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (1, false);
+ } else {
+ DateTime date = this.SelectionStart.AddMonths (1);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.Up:
+ // set the back 1 week
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (-7, true);
+ } else {
+ DateTime date = this.SelectionStart.AddDays (-7);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.Down:
+ // set the date forward 1 week
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (7, true);
+ } else {
+ DateTime date = this.SelectionStart.AddDays (7);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.Left:
+ // move one left
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (-1, true);
+ } else {
+ DateTime date = this.SelectionStart.AddDays (-1);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ case Keys.Right:
+ // move one left
+ if (is_shift_pressed) {
+ this.AddTimeToSelection (1, true);
+ } else {
+ DateTime date = this.SelectionStart.AddDays (1);
+ this.SetSelectionRange (date, date);
+ }
+ this.OnDateSelected (new DateRangeEventArgs (SelectionStart, SelectionEnd));
+ break;
+ default:
+ break;
+ }
+ e.Handled = true;
}
- e.Handled = true;
}
// to check if the mouse has come up on this control
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004, 2005 Novell, Inc.
+// Copyright (c) 2005 Novell, Inc.
//
// Authors:
-// Miguel de Icaza (miguel@novell.com).
-// Gonzalo Paniagua Javier (gonzalo@novell.com)
+// Jonathan Gilbert <logic@deltaq.org>
//
+// Integration into MWF:
+// Peter Bartok <pbartok@novell.com>
//
+// COMPLETE
+
using System;
+using System.Collections;
using System.ComponentModel;
-using System.Globalization;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
namespace System.Windows.Forms {
- [DefaultEvent ("ValueChanged")]
- [DefaultProperty ("Value")]
+ [DefaultEvent("ValueChanged")]
+ [DefaultProperty("Value")]
public class NumericUpDown : UpDownBase, ISupportInitialize {
- Decimal updown_value;
- Decimal min = 0m;
- Decimal max = 100m;
- Decimal increment = 1m;
- string format;
- bool thousand;
- bool on_init;
- int decimal_places;
- bool hexadecimal;
-
- public NumericUpDown ()
- {
- UpdateFormat ();
- UpdateEditText ();
- }
-
- #region Events
- public new event EventHandler TextChanged;
- public event EventHandler ValueChanged;
- #endregion Events
-
-#region ISupportInitialize methods
-
- //
- // These are used for batch updates of properties:
- // checking of values should be disabled during this
- // time, assuming that the caller will set us up
- // correctly.
- //
- // See: http://www.vkarlsen.no/articles/02_isupportinitialize/ISupportInitialize.pdf
- // for the strategy.
- //
- public void BeginInit ()
- {
- on_init = true;
+ #region Local Variables
+ private int suppress_validation;
+ private int decimal_places;
+ private bool hexadecimal;
+ private decimal increment;
+ private decimal maximum;
+ private decimal minimum;
+ private bool thousands_separator;
+ private decimal value;
+ #endregion // Local Variables
+
+ #region Public Constructors
+ public NumericUpDown() {
+ suppress_validation = 0;
+ decimal_places = 0;
+ hexadecimal = false;
+ increment = 1M;
+ maximum = 100.0M;
+ minimum = 0.0M;
+ thousands_separator = false;
}
+ #endregion // Public Constructors
- public void EndInit ()
- {
- on_init = false;
- if (updown_value < min)
- updown_value = min;
- if (updown_value > max)
- updown_value = max;
-
- UpdateEditText ();
- }
-#endregion
+ #region Private Methods
+ void wide_number_multiply_by_10(int[] number) {
+ long carry = 0;
- public override void DownButton ()
- {
- if (UserEdit)
- ParseEditText ();
+ for (int i=0; i < number.Length; i++) {
+ long multiplication = unchecked(carry + 10 * (long)(uint)number[i]);
+
+ carry = multiplication >> 32;
- if (updown_value-increment >= min){
- Value -= increment;
- UpdateEditText ();
+ number[i] = unchecked((int)multiplication);
}
}
- public override void UpButton ()
- {
- if (UserEdit)
- ParseEditText ();
+ void wide_number_multiply_by_16(int[] number) {
+ int carry = 0;
+
+ for (int i=0; i < number.Length; i++) {
+ int multiplication = unchecked(carry | (number[i] << 4));
- if (updown_value + increment <= max){
- Value += increment;
- UpdateEditText ();
+ carry = (number[i] >> 28) & 0x0F;
+
+ number[i] = multiplication;
}
}
- void UpdateFormat ()
- {
- if (hexadecimal)
- format = "X";
- else if (thousand)
- format = "N" + decimal_places.ToString ();
- else
- format = "F" + decimal_places.ToString ();
- }
+ void wide_number_divide_by_16(int[] number) {
+ int carry = 0;
- public override void UpdateEditText ()
- {
- if (on_init)
- return;
+ for (int i=number.Length - 1; i >= 0; i--) {
+ int division = unchecked(carry | ((number[i] >> 4) & 0x0FFFFFFF));
- if (UserEdit)
- ParseEditText ();
-
- ChangingText = true;
- if (hexadecimal) { // gotta convert to something, decimal throws with "X"
- long val = (long) updown_value;
- Text = val.ToString (format);
- } else {
- Text = updown_value.ToString (format);
+ carry = (number[i] << 28);
+
+ number[i] = division;
}
}
- public void ParseEditText ()
- {
- decimal res;
- try {
- if (hexadecimal) {
- res = Int64.Parse (Text, NumberStyles.HexNumber);
- } else {
- res = decimal.Parse (Text);
+ bool wide_number_less_than(int[] left, int[] right) {
+ unchecked {
+ for (int i=left.Length - 1; i >= 0; i--) {
+ uint leftvalue = (uint)left[i];
+ uint rightvalue = (uint)right[i];
+
+ if (leftvalue > rightvalue)
+ return false;
+ if (leftvalue < rightvalue)
+ return true;
}
- } catch {
- res = updown_value;
}
-
- if (res < min)
- res = min;
- else if (res > max)
- res = max;
- Value = res;
- UserEdit = false;
+ // equal
+ return false;
}
- protected override void ValidateEditText ()
- {
- ParseEditText ();
- UpdateEditText ();
- }
+ void wide_number_subtract(int[] subtrahend, int[] minuend) {
+ long carry = 0;
+
+ unchecked {
+ for (int i=0; i < subtrahend.Length; i++) {
+ long subtrahendvalue = (uint)subtrahend[i];
+ long minuendvalue = (uint)minuend[i];
+
+ long result = subtrahendvalue - minuendvalue + carry;
+
+ if (result < 0) {
+ carry = -1;
+ result -= int.MinValue;
+ result -= int.MinValue;
+ }
+ else
+ carry = 0;
-
- protected override AccessibleObject CreateAccessibilityInstance ()
- {
- //TODO
- return base.CreateAccessibilityInstance ();
+ subtrahend[i] = unchecked((int)result);
+ }
+ }
}
+ #endregion // Private Methods
- [Bindable(true)]
- public decimal Value {
+ #region Public Instance Properties
+ [DefaultValue(0)]
+ public int DecimalPlaces {
get {
- return updown_value;
+ return decimal_places;
}
set {
- if (updown_value == value) {
- return;
+ decimal_places = value;
+ if (!UserEdit) {
+ UpdateEditText();
}
-
- if (on_init){
- updown_value = value;
- return;
+ }
+ }
+
+ [DefaultValue(false)]
+ public bool Hexadecimal {
+ get {
+ return hexadecimal;
+ }
+
+ set {
+ hexadecimal = value;
+ if (!UserEdit) {
+ UpdateEditText();
}
-
- if (value < min || value > max)
- throw new ArgumentOutOfRangeException (
- String.Format ("Value {0} not within boundaries [{1}, {2}]", value, min, max));
-
- updown_value = value;
- OnValueChanged (EventArgs.Empty);
- UpdateEditText ();
}
}
}
set {
+ if (value < 0) {
+ throw new ArgumentOutOfRangeException("value", value, "NumericUpDown increment cannot be negative");
+ }
+
increment = value;
}
}
-
+
[RefreshProperties(RefreshProperties.All)]
public decimal Maximum {
get {
- return max;
+ return maximum;
}
set {
- max = value;
- if (value > max)
- value = max;
- if (min > max)
- min = max;
- UpdateEditText ();
+ maximum = value;
+
+ if (minimum > maximum)
+ minimum = maximum;
+
+ if (value > maximum)
+ value = maximum;
}
}
[RefreshProperties(RefreshProperties.All)]
public decimal Minimum {
get {
- return min;
+ return minimum;
}
set {
- min = value;
- if (value < min)
- value = min;
- if (min > max)
- max = min;
- UpdateEditText ();
+ minimum = value;
+
+ if (maximum < minimum)
+ maximum = minimum;
+
+ if (value < minimum)
+ value = minimum;
}
}
[Bindable(false)]
+ [Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
- [Browsable (false)]
public override string Text {
get {
- return base.Text;
+ return base.txtView.Text;
}
set {
- base.Text = value;
+ base.txtView.Text = value;
}
}
- [DefaultValue (false)]
- [Localizable (true)]
+ [DefaultValue(false)]
+ [Localizable(true)]
public bool ThousandsSeparator {
get {
- return thousand;
+ return thousands_separator;
}
set {
- if (value == thousand)
- return;
+ thousands_separator = value;
- thousand = value;
- UpdateFormat ();
- UpdateEditText ();
+ if (!UserEdit) {
+ UpdateEditText();
+ }
}
}
- [DefaultValue (0)]
- public int DecimalPlaces {
+ [Bindable(true)]
+ public decimal Value {
get {
- return decimal_places;
+ return value;
}
set {
- if (value == decimal_places)
- return;
+ if (suppress_validation <= 0) {
+ if ((value < minimum) || (value > maximum)) {
+ throw new ArgumentException("NumericUpDown.Value must be within the specified Minimum and Maximum values", "value");
+ }
+ }
- decimal_places = value;
- UpdateFormat ();
- UpdateEditText ();
+ this.value = value;
+ OnValueChanged(EventArgs.Empty);
+ UpdateEditText();
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ public void BeginInit() {
+ suppress_validation++;
+ }
+
+ public override void DownButton() {
+ if (UserEdit) {
+ ParseEditText();
}
+
+ Value = Math.Max(minimum, unchecked(value - increment));
}
- [DefaultValue (false)]
- public bool Hexadecimal {
- get { return hexadecimal; }
- set {
- if (value == hexadecimal)
- return;
+ public void EndInit() {
+ suppress_validation--;
+ }
- hexadecimal = value;
- UpdateFormat ();
- UpdateEditText ();
+ public override string ToString() {
+ return string.Format("{0}: value {1} in range [{2}, {3}]", base.ToString(), value, minimum, maximum);
+ }
+
+ public override void UpButton() {
+ if (UserEdit)
+ ParseEditText();
+
+ Value = Math.Min(maximum, unchecked(value + increment));
+ }
+ #endregion // Public Instance Methods
+
+ #region Protected Instance Methods
+ protected override AccessibleObject CreateAccessibilityInstance() {
+ AccessibleObject acc;
+
+ acc = new AccessibleObject(this);
+ acc.role = AccessibleRole.SpinButton;
+
+ return acc;
+ }
+
+ protected override void OnTextBoxKeyPress(object source, KeyPressEventArgs e) {
+ if ((ModifierKeys & ~Keys.Shift) != Keys.None) {
+ return;
}
+
+ string acceptable = hexadecimal ? "\b-.,0123456789ABCDEF" : "\b-.,0123456789";
+
+ if (acceptable.IndexOf(e.KeyChar) < 0) {
+ // prevent the key from reaching the text box
+ e.Handled = true;
+ }
+
+ base.OnTextBoxKeyPress(source, e);
}
-
-#region Overrides for Control hooks
- static bool CompareCharToString (char c, string str)
- {
- if (str.Length == 1)
- return (c == str [0]);
-
- return (new string (c, 1) == str);
+
+ protected virtual void OnValueChanged(EventArgs e) {
+ if (ValueChanged != null) {
+ ValueChanged(this, e);
+ }
}
- protected override void OnTextBoxKeyPress (object source, KeyPressEventArgs e)
- {
- base.OnTextBoxKeyPress (source, e);
-
- bool handled = true;
- char key = e.KeyChar;
- bool is_digit = Char.IsDigit (key);
- if (is_digit || hexadecimal) {
- handled = !(is_digit || (key >= 'a' && key <= 'f') || (key >= 'A' && key <= 'F'));
- } else {
- NumberFormatInfo ninfo = CultureInfo.CurrentCulture.NumberFormat;
- if (CompareCharToString (key, ninfo.NegativeSign)) {
- handled = false;
- } else if (CompareCharToString (key, ninfo.NumberDecimalSeparator)) {
- handled = false;
- } else if (CompareCharToString (key, ninfo.NumberGroupSeparator)) {
- handled = false;
+ protected void ParseEditText() {
+ UserEdit = false;
+
+ try {
+ string user_edit_text = Text.Replace(",", "").Trim();
+
+ if (!hexadecimal) {
+ value = decimal.Parse(user_edit_text);
+ } else {
+ value = 0M;
+
+ for (int i=0; i < user_edit_text.Length; i++) {
+ int hex_digit = Convert.ToInt32(user_edit_text.Substring(i, 1), 16);
+
+ value = unchecked(value * 16M + (decimal)hex_digit);
+ }
+ }
+
+ if (value < minimum) {
+ value = minimum;
}
- }
- e.Handled = handled;
+ if (value > maximum) {
+ value = maximum;
+ }
+
+ OnValueChanged(EventArgs.Empty);
+ }
+ catch {}
}
-#endregion
- protected virtual void OnValueChanged (EventArgs e)
- {
- if (ValueChanged != null)
- ValueChanged (this, e);
+
+ protected override void UpdateEditText() {
+ if (suppress_validation > 0)
+ return;
+
+ if (UserEdit)
+ ParseEditText(); // validate user input
+
+ if (!hexadecimal) {
+ // "N" and "F" differ only in that "N" includes commas
+ // every 3 digits to the left of the decimal and "F"
+ // does not.
+
+ string format_string;
+
+ if (thousands_separator) {
+ format_string = "N";
+ } else {
+ format_string = "F";
+ }
+
+ format_string += decimal_places;
+
+ ChangingText = true;
+ Text = value.ToString(format_string);
+ }
+ else {
+ // Decimal.ToString doesn't know the "X" formatter, and
+ // converting it to an int is narrowing, so do it
+ // manually...
+
+ int[] bits = decimal.GetBits(value);
+
+ bool negative = (bits[3] < 0);
+
+ int scale = (bits[3] >> 16) & 0x1F;
+
+ bits[3] = 0;
+
+ int[] radix = new int[4];
+
+ radix[0] = 1;
+
+ for (int i=0; i < scale; i++)
+ wide_number_multiply_by_10(radix);
+
+ int num_chars = 0;
+
+ while (!wide_number_less_than(bits, radix)) {
+ num_chars++;
+ wide_number_multiply_by_16(radix);
+ }
+
+ if (num_chars == 0) {
+ ChangingText = true;
+ Text = "0";
+ return;
+ }
+
+ StringBuilder chars = new StringBuilder();
+
+ if (negative)
+ chars.Append('-');
+
+ for (int i=0; i < num_chars; i++) {
+ int digit = 0;
+
+ wide_number_divide_by_16(radix);
+
+ while (!wide_number_less_than(bits, radix)) { // greater than or equals
+ digit++;
+ wide_number_subtract(bits, radix);
+ }
+
+ if (digit < 10) {
+ chars.Append((char)('0' + digit));
+ } else {
+ chars.Append((char)('A' + digit - 10));
+ }
+ }
+
+ ChangingText = true;
+ Text = chars.ToString();
+ }
}
- public override string ToString ()
- {
- return String.Format ("{0} Min={0} Max={1}", base.ToString (), min, max);
+ protected override void ValidateEditText() {
+ ParseEditText();
+ UpdateEditText();
}
+ #endregion // Protected Instance Methods
+
+ #region Events
+ public event EventHandler ValueChanged;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler TextChanged;
+ #endregion // Events
}
}
#region Local Variables
private StatusBar parent;
+ private bool initializing;
private string text = String.Empty;
private string tool_tip_text = String.Empty;
private StatusBarPanelBorderStyle border_style = StatusBarPanelBorderStyle.Sunken;
private StatusBarPanelStyle style;
private int width = 100;
+ private int twidth = -1;
private int min_width = 10;
#endregion // Local Variables
set {
if (value < 0)
throw new ArgumentException ("value");
- width = value;
+
+ if (initializing)
+ twidth = value;
+ else
+ width = value;
}
}
return "StatusBarPanel: {" + Text +"}";
}
- [MonoTODO]
protected override void Dispose (bool disposing)
{
}
- [MonoTODO]
- public virtual void BeginInit()
+ public virtual void BeginInit ()
{
+ initializing = true;
}
- [MonoTODO]
- public virtual void EndInit()
+ public virtual void EndInit ()
{
+ if (!initializing || twidth == -1)
+ return;
+
+ width = twidth;
+ twidth = -1;
+ initializing = false;
}
}
}
// hatchBrush.Dispose();
// }
+ // Clear the background
+ graphics.FillRectangle (SystemBrushes.Control, rectangle);
+
if ((State & DrawFrameControlStates.Pushed)!=0 || (State & DrawFrameControlStates.Checked)!=0) {
graphics.DrawRectangle (ResPool.GetPen (ControlPaint.Dark (ColorButtonFace)), trace_rectangle);
} else if ((State & DrawFrameControlStates.Flat)!=0) {
throw new ArgumentException ("'" + value + "' is not a valid value for 'value'. " +
"'value' must be greater than or equal to 0.");
}
+ if (image_index == value)
+ return;
image_index = value;
+ Refresh ();
}
}
- [MonoTODO ("Anything special need to be done here?")]
[DefaultValue(null)]
public ImageList ImageList {
get { return image_list; }
- set { image_list = value; }
+ set {
+ image_list = value;
+ Refresh ();
+ }
}
[Localizable(true)]
#endregion // Public Instance Properties
#region Protected Instance Properties
- [MonoTODO ("Anything extra needed here?")]
protected override CreateParams CreateParams {
get {
CreateParams cp = base.CreateParams;
base.Dispose (disposing);
}
- [MonoTODO ("What does the state effect?")]
protected OwnerDrawPropertyBag GetItemRenderStyles (TreeNode node, int state) {
return node.prop_bag;
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2005 Novell, Inc.
//
// Authors:
-// Miguel de Icaza (miguel@novell.com).
+// Jonathan Gilbert <logic@deltaq.org>
//
+// Integration into MWF:
+// Peter Bartok <pbartok@novell.com>
//
-/*
-TODO:
+// COMPLETE
- - Actually paint the border, could not get it to work.
-
- - Implement ContextMenu property.
-
- - Force the size of the entry: it can not be resized vertically
- ever, the size is set by the size of the font
-
- - Add defaults with [DefautValue ]
-
- - Audit every place where ChangingText is used, whose meaning is
- `Me, the library is changing the text'. Kind of hack to deal with
- loops on events.
-
- - Hook up the keyboard events.
-
-*/
using System;
-using System.Drawing;
+using System.Collections;
using System.ComponentModel;
+using System.Drawing;
using System.Runtime.InteropServices;
+using System.Windows.Forms;
+
+namespace System.Windows.Forms
+{
+ [Designer("System.Windows.Forms.Design.UpDownBaseDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
+ public abstract class UpDownBase : System.Windows.Forms.ContainerControl {
+ #region UpDownSpinner Sub-class
+ internal sealed class UpDownSpinner : Control {
+ #region Local Variables
+ private const int InitialRepeatDelay = 50;
+ private UpDownBase owner;
+ private Timer tmrRepeat;
+ private Rectangle top_button_rect;
+ private Rectangle bottom_button_rect;
+ private int mouse_pressed;
+ private int mouse_x;
+ private int mouse_y;
+ private int repeat_delay;
+ private int repeat_counter;
+ #endregion // Local Variables
+
+ #region Constructors
+ public UpDownSpinner(UpDownBase owner) {
+ this.owner = owner;
+
+ mouse_pressed = 0;
+
+ this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+ this.SetStyle(ControlStyles.DoubleBuffer, true);
+ this.SetStyle(ControlStyles.Opaque, true);
+ this.SetStyle(ControlStyles.ResizeRedraw, true);
+ this.SetStyle(ControlStyles.UserPaint, true);
+ this.GotFocus += new EventHandler(UpDownSpinner_GotFocus);
+
+ tmrRepeat = new Timer();
+
+ tmrRepeat.Enabled = false;
+ tmrRepeat.Interval = 10;
+ tmrRepeat.Tick += new EventHandler(tmrRepeat_Tick);
+
+ compute_rects();
+ }
+ #endregion // Constructors
+
+ #region Private & Internal Methods
+ private void compute_rects() {
+ int top_button_height;
+ int bottom_button_height;
+
+ top_button_height = ClientSize.Height / 2;
+ bottom_button_height = ClientSize.Height - top_button_height;
+
+ top_button_rect = new Rectangle(0, 0, ClientSize.Width, top_button_height);
+ bottom_button_rect = new Rectangle(0, top_button_height, ClientSize.Width, bottom_button_height);
+ }
+
+ private void redraw(Graphics graphics) {
+ ButtonState top_button_state;
+ ButtonState bottom_button_state;
+
+ top_button_state = bottom_button_state = ButtonState.Normal;
+
+ if (mouse_pressed != 0) {
+ if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y)) {
+ top_button_state = ButtonState.Pushed;
+ }
-namespace System.Windows.Forms {
- public abstract class UpDownBase : ContainerControl {
-
- internal class Spinner : Control, IDisposable {
- UpDownBase updownbase;
- Rectangle up, down, pressed;
- Timer timer;
- bool up_pressed, down_pressed;
- bool captured, mouse_in;
-
- //
- // Interval values
- //
- const int StartInterval = 1000;
- const int RepeatInterval = 400;
- const int ChangeInterval = 75;
- const int MinimumInterval = 100;
-
- internal Spinner (UpDownBase updownbase)
- {
- this.updownbase = updownbase;
- }
-
- protected override void OnPaint (PaintEventArgs pe)
- {
- if (pe.ClipRectangle.Contains (up))
- DrawUp (pe.Graphics);
- if (pe.ClipRectangle.Contains (down))
- DrawDown (pe.Graphics);
+ if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y)) {
+ bottom_button_state = ButtonState.Pushed;
+ }
+ }
- base.OnPaint (pe);
+ ControlPaint.DrawScrollButton(graphics, top_button_rect, ScrollButton.Up, top_button_state);
+ ControlPaint.DrawScrollButton(graphics, bottom_button_rect, ScrollButton.Down, bottom_button_state);
}
- protected override void OnLayout (LayoutEventArgs args)
- {
- base.OnLayout (args);
- Rectangle bounds = Bounds;
+ private void tmrRepeat_Tick(object sender, EventArgs e) {
+ if (repeat_delay > 1) {
+ repeat_counter++;
- up = new Rectangle (0, 0, bounds.Width, bounds.Height/2);
- down = new Rectangle (0, bounds.Height/2, bounds.Width, bounds.Height/2);
- }
+ if (repeat_counter < repeat_delay) {
+ return;
+ }
- protected override void OnMouseDown (MouseEventArgs args)
- {
- base.OnMouseDown (args);
+ repeat_counter = 0;
+ repeat_delay = (repeat_delay * 3 / 4);
+ }
- if (args.Button != MouseButtons.Left)
- return;
+ if (mouse_pressed == 0) {
+ tmrRepeat.Enabled = false;
+ }
- if (up.Contains (args.X, args.Y)){
- up_pressed = true;
- pressed = up;
- } else if (down.Contains (args.X, args.Y)){
- down_pressed = true;
- pressed = down;
- } else
- return;
+ if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y)) {
+ owner.UpButton();
+ }
- Click ();
- Invalidate (pressed);
- Capture = true;
- InitTimer ();
-
- mouse_in = down_pressed | up_pressed;
- }
-
- protected override void OnMouseUp (MouseEventArgs args)
- {
- base.OnMouseUp (args);
-
- if (Capture){
- if (up_pressed){
- up_pressed = false;
- Invalidate (up);
- }
- if (down_pressed){
- down_pressed = false;
- Invalidate (down);
- }
+ if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y)) {
+ owner.DownButton();
}
- Capture = false;
- timer.Enabled = false;
- }
-
- //
- // Sets up the auto-repeat timer, we give a one second
- // delay, and then we use the keyboard settings for auto-repeat.
- //
- void InitTimer ()
- {
- if (timer != null){
- timer.Interval = StartInterval;
- timer.Enabled = true;
+ }
+
+ private void UpDownSpinner_GotFocus(object sender, EventArgs e) {
+ this.Select(owner.txtView);
+ }
+ #endregion // Private & Internal Methods
+
+ #region Protected Instance Methods
+ protected override void OnMouseDown(MouseEventArgs e) {
+ if (e.Button != MouseButtons.Left) {
return;
}
-
- timer = new Timer ();
- int kd = SystemInformation.KeyboardDelay;
- kd = kd < 0 ? 0 : (kd > 4 ? 4 : kd);
- timer.Interval = StartInterval;
- timer.Tick += new EventHandler (ClockTick);
- timer.Enabled = true;
- }
-
- void ClockTick (object o, EventArgs a)
- {
- if (timer == null)
- throw new Exception ("The timer that owns this callback is null!");
-
- int interval = timer.Interval;
-
- if (interval == StartInterval)
- interval = RepeatInterval;
- else
- interval -= ChangeInterval;
-
- if (interval < MinimumInterval)
- interval = MinimumInterval;
- timer.Interval = interval;
-
- Click ();
- }
-
- void Click ()
- {
- if (up_pressed){
- updownbase.UpButton ();
- up_pressed = false;
+
+ if (top_button_rect.Contains(e.X, e.Y)) {
+ mouse_pressed = 1;
+ owner.UpButton();
+ } else if (bottom_button_rect.Contains(e.X, e.Y)) {
+ mouse_pressed = 2;
+ owner.DownButton();
}
- if (down_pressed) {
- updownbase.DownButton ();
- down_pressed = false;
+
+ mouse_x = e.X;
+ mouse_y = e.Y;
+ Capture = true;
+
+ tmrRepeat.Enabled = true;
+ repeat_counter = 0;
+ repeat_delay = InitialRepeatDelay;
+
+ using (Graphics g = CreateGraphics()) {
+ redraw(g);
}
}
- protected override void OnMouseMove (MouseEventArgs args)
- {
- base.OnMouseMove (args);
- if (Capture){
- bool old = mouse_in;
-
- if (pressed.Contains (args.X, args.Y)){
- if (timer == null)
- InitTimer ();
- mouse_in = true;
- } else {
- if (timer != null){
- timer.Enabled = false;
- timer.Dispose ();
- timer = null;
- }
- mouse_in = false;
+ protected override void OnMouseMove(MouseEventArgs e) {
+ ButtonState before, after;
+
+ before = ButtonState.Normal;
+ if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y))
+ before = ButtonState.Pushed;
+ if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y))
+ before = ButtonState.Pushed;
+
+ mouse_x = e.X;
+ mouse_y = e.Y;
+
+ after = ButtonState.Normal;
+ if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y))
+ after = ButtonState.Pushed;
+ if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y))
+ after = ButtonState.Pushed;
+
+ if (before != after) {
+ if (after == ButtonState.Pushed) {
+ tmrRepeat.Enabled = true;
+ repeat_counter = 0;
+ repeat_delay = InitialRepeatDelay;
+
+ // fire off one right now too for good luck
+ if (mouse_pressed == 1)
+ owner.UpButton();
+ if (mouse_pressed == 2)
+ owner.DownButton();
}
- if (mouse_in ^ old){
- if (mouse_in)
- Click ();
- Invalidate (pressed);
+ else
+ tmrRepeat.Enabled = false;
+
+ using (Graphics g = CreateGraphics()) {
+ redraw(g);
}
}
}
-
- void DrawUp (Graphics dc)
- {
- ButtonState bs;
- bs = mouse_in && up_pressed ? ButtonState.Pushed : ButtonState.Normal;
- ThemeEngine.Current.CPDrawScrollButton (dc, up, ScrollButton.Up, bs);
- }
-
- void DrawDown (Graphics dc)
- {
- ButtonState bs;
+ protected override void OnMouseUp(MouseEventArgs e) {
+ mouse_pressed = 0;
+ Capture = false;
- bs = mouse_in && down_pressed ? ButtonState.Pushed : ButtonState.Normal;
- ThemeEngine.Current.CPDrawScrollButton (dc, down, ScrollButton.Down, bs);
+ using (Graphics g = CreateGraphics()) {
+ redraw(g);
+ }
}
- void IDisposable.Dispose ()
- {
- if (timer != null){
- timer.Stop ();
- timer.Dispose ();
- }
- timer = null;
- base.Dispose ();
- }
- }
-
- BorderStyle border_style = BorderStyle.Fixed3D;
- TextBox entry;
- Spinner spinner;
- int border;
- int scrollbar_button_size = ThemeEngine.Current.ScrollBarButtonSize;
- LeftRightAlignment updown_align = LeftRightAlignment.Right;
- bool changing_text = false;
- bool user_edit = false;
- bool intercept = true;
-
- public UpDownBase () : base ()
- {
- SuspendLayout ();
-
- entry = new TextBox ();
- entry.Font = Font;
- entry.LostFocus += new EventHandler (EntryOnLostFocus);
- entry.TextChanged += new EventHandler (OnTextBoxTextChanged);
- entry.KeyDown += new KeyEventHandler (OnTextBoxKeyDown);
- entry.KeyPress += new KeyPressEventHandler (OnTextBoxKeyPress);
- entry.LostFocus += new EventHandler (OnTextBoxLostFocus);
- entry.Resize += new EventHandler (OnTextBoxResize);
- SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
-
- entry.ReadOnly = false;
- Controls.Add (entry);
+ protected override void OnMouseWheel(MouseEventArgs e) {
+ if (e.Delta > 0)
+ owner.UpButton();
+ else if (e.Delta < 0)
+ owner.DownButton();
+ }
- spinner = new Spinner (this);
- Controls.Add (spinner);
+ protected override void OnPaint(PaintEventArgs e) {
+ redraw(e.Graphics);
+ }
- ComputeSizeAndLocation ();
- ResumeLayout ();
+ protected override void OnResize(EventArgs e) {
+ base.OnResize(e);
+ compute_rects();
+ }
+ #endregion // Protected Instance Methods
}
+ #endregion // UpDownSpinner Sub-class
- void EntryOnLostFocus (object sender, EventArgs e)
- {
- OnLostFocus (e);
- }
+ #region Local Variables
+ internal TextBox txtView;
+ private UpDownSpinner spnSpinner;
+ private BorderStyle border_style;
+ private bool _InterceptArrowKeys = true;
+ private LeftRightAlignment _UpDownAlign;
+ private bool changing_text;
+ private bool user_edit;
+ #endregion // Local Variables
- void ComputeSizeAndLocation ()
- {
- if (BorderStyle == BorderStyle.Fixed3D)
- border = 2;
- else if (BorderStyle == BorderStyle.FixedSingle)
- border = 1;
- else
- border = 0;
-
- Size = (entry.Size + spinner.Size + new Size (border, border));
-
- entry.Location = new Point (border, border);
- }
-
+ #region Public Constructors
+ public UpDownBase() {
+ _UpDownAlign = LeftRightAlignment.Right;
+ border_style = BorderStyle.Fixed3D;
-#region UpDownBase overwritten methods
-
- protected override void OnMouseWheel (MouseEventArgs args)
- {
- base.OnMouseWheel (args);
+ spnSpinner = new UpDownSpinner(this);
- if (args.Delta > 0)
- UpButton ();
- else if (args.Delta < 0)
- DownButton ();
- }
+ txtView = new TextBox();
+ txtView.ModifiedChanged += new EventHandler(OnChanged);
+ txtView.AcceptsReturn = true;
+ txtView.AutoSize = false;
+ txtView.BorderStyle = BorderStyle.None;
+ txtView.Location = new System.Drawing.Point(17, 17);
+ txtView.TabIndex = 0;
- protected virtual void OnChanged (object source, EventArgs e)
- {
-
- }
+ Controls.Add(txtView);
+ Controls.Add(spnSpinner);
- protected override void OnFontChanged (EventArgs e)
- {
- base.OnFontChanged (e);
+ this.ActiveControl = txtView;
- entry.Font = Font;
Height = PreferredHeight;
- }
+ base.BackColor = txtView.BackColor;
- protected override void OnHandleCreated (EventArgs e)
- {
- base.OnHandleCreated (e);
- }
-
- protected override void OnLayout (LayoutEventArgs args)
- {
- base.OnLayout (args);
+ txtView.MouseWheel += new MouseEventHandler(txtView_MouseWheel);
- Rectangle bounds = Bounds;
- int entry_width = bounds.Right - scrollbar_button_size - 1;
+ txtView.KeyDown += new KeyEventHandler(OnTextBoxKeyDown);
+ txtView.KeyPress += new KeyPressEventHandler(OnTextBoxKeyPress);
+ txtView.LostFocus += new EventHandler(OnTextBoxLostFocus);
+ txtView.Resize += new EventHandler(OnTextBoxResize);
+ txtView.TextChanged += new EventHandler(OnTextBoxTextChanged);
- entry.SetBounds (bounds.X, bounds.Y, entry_width, bounds.Height);
- spinner.SetBounds (entry_width + 1, bounds.Y, scrollbar_button_size, bounds.Height);
- }
+ txtView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ this.Paint +=new PaintEventHandler(UpDownBase_Paint);
-#if NET_2_0
-#if false
- protected override void OnPaint (PaintEventArgs pe)
- {
- if (pe.ClipRectangle.Contains (up))
- DrawUp (pe.Graphics);
- if (pe.ClipRectangle.Contains (down))
- DrawDown (pe.Graphics);
+ SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+ SetStyle(ControlStyles.DoubleBuffer, true);
+ SetStyle(ControlStyles.Opaque, true);
+ SetStyle(ControlStyles.ResizeRedraw, true);
+ SetStyle(ControlStyles.UserPaint, true);
- base.OnPaint (pe);
+ UpdateEditText();
}
+ #endregion
- protected override void SetVisibleCore (bool state)
- {
- base.SetVisibleCore (state);
- }
-#endif
-#endif
+ #region Private Methods
+ void reseat_controls() {
+ int border = 0;
- [EditorBrowsable(EditorBrowsableState.Advanced)]
- protected override void WndProc (ref Message m)
- {
- base.WndProc (ref m);
- }
+ switch (border_style) {
+ case BorderStyle.FixedSingle: border = 1; break;
+ case BorderStyle.Fixed3D: border = 2; break;
+ }
- protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
- {
- //
- // Force the size to be our height.
- //
- base.SetBoundsCore (x, y, width, PreferredHeight, specified);
- }
-
- protected override void Dispose (bool disposing)
- {
- if (spinner != null){
- if (disposing){
- spinner.Dispose ();
- entry.Dispose ();
- }
+ int text_displacement = 0;
+
+ int spinner_width = 16;
+ //int spinner_width = ClientSize.Height - 2 * border;
+
+ if (_UpDownAlign == LeftRightAlignment.Left) {
+ spnSpinner.Bounds = new Rectangle(border, border, spinner_width, ClientSize.Height - 2 * border);
+ text_displacement = spnSpinner.Width;
+
+ spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
+ } else {
+ spnSpinner.Bounds = new Rectangle(ClientSize.Width - spinner_width - border, border, spinner_width, ClientSize.Height - 2 * border);
+
+ spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
}
- spinner = null;
- entry = null;
- base.Dispose (true);
- }
-
-#endregion
-
-#region UpDownBase virtual methods
- //
- // These are hooked up to the various events from the Entry line that
- // we do not have yet, and implement the keyboard behavior (use a different
- // widget to test)
- //
- protected virtual void OnTextBoxKeyDown (object source, KeyEventArgs e)
- {
- OnKeyDown(e);
- }
-
- protected virtual void OnTextBoxKeyPress (object source, KeyPressEventArgs e)
- {
- OnKeyPress (e);
+
+ txtView.Bounds = new Rectangle(text_displacement + border, border, ClientSize.Width - spinner_width - 2 * border, Height - 2 * border);
}
- protected virtual void OnTextBoxLostFocus (object source, EventArgs e)
- {
- OnLostFocus (e);
+ private void txtView_MouseWheel(object sender, MouseEventArgs e) {
+ if (e.Delta > 0) {
+ UpButton();
+ } else if (e.Delta < 0) {
+ DownButton();
+ }
}
- protected virtual void OnTextBoxResize (object source, EventArgs e)
- {
- OnResize (e);
- }
- protected virtual void OnTextBoxTextChanged (object source, EventArgs e)
- {
- if (changing_text)
- return;
+ private void UpDownBase_Paint(object sender, PaintEventArgs e) {
+ int border = 0;
- ChangingText = false;
- UserEdit = true;
- OnTextChanged (e);
- OnChanged (source, EventArgs.Empty);
- }
+ switch (border_style) {
+ case BorderStyle.FixedSingle: {
+ ControlPaint.DrawBorder(e.Graphics, ClientRectangle, Color.Black, ButtonBorderStyle.Solid);
+ border = 1;
+ break;
+ }
+
+ case BorderStyle.Fixed3D: {
+ ControlPaint.DrawBorder3D(e.Graphics,
+ ClientRectangle, Border3DStyle.Sunken, Border3DSide.All);
+ border = 2;
+ break;
+ }
+ }
+
+ Rectangle rect = ClientRectangle;
-#endregion
+ rect.Inflate(-border, -border);
-#region UpDownBase Properties
+ using (SolidBrush background = new SolidBrush(BackColor)) {
+ e.Graphics.FillRectangle(background, rect);
+ }
+ }
+ #endregion // Private Methods
- /* FIXME: Do not know what Autoscroll should do */
+ #region Public Instance Properties
+ [Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
- [Browsable(false)]
- public virtual bool AutoScroll {
+ public override bool AutoScroll {
get {
return base.AutoScroll;
}
}
}
- /* FIXME: Do not know what AutoscrollMargin does */
+ [Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
- [Browsable(false)]
- public new Size AutoScrollMargin {
+ public Size AutoScrollMargin {
get {
return base.AutoScrollMargin;
}
}
}
- /* FIXME: Do not know what AutoscrollMinSize does */
+ [Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
- [Browsable(false)]
- public new Size AutoScrollMinSize {
+ public Size AutoScrollMinSize {
get {
return base.AutoScrollMinSize;
}
}
set {
- entry.BackColor = value;
+ base.BackColor = value;
+ txtView.BackColor = value;
}
}
+ [Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
- [Browsable(false)]
public override Image BackgroundImage {
get {
- return entry.BackgroundImage;
+ return base.BackgroundImage;
}
-
set {
- entry.BackgroundImage = value;
+ base.BackgroundImage = value;
+ txtView.BackgroundImage = value;
}
}
+
[DefaultValue(BorderStyle.Fixed3D)]
[DispId(-504)]
public BorderStyle BorderStyle {
}
set {
+ switch (border_style) {
+ case BorderStyle.None:
+ case BorderStyle.FixedSingle:
+ case BorderStyle.Fixed3D:
+ // acceptable types
+ break;
+
+ default:
+ throw new InvalidEnumArgumentException("value", (int)value, typeof(BorderStyle));
+ }
+
border_style = value;
- SuspendLayout ();
- ComputeSizeAndLocation ();
- ResumeLayout ();
+ reseat_controls();
+
+ Invalidate();
}
}
- //
- // Used internally to flag when the derivative classes are changing
- // the Text property as opposed to the user
- //
- protected bool ChangingText {
+ public override ContextMenu ContextMenu {
get {
- return changing_text;
+ return base.ContextMenu;
}
-
set {
- changing_text = value;
+ base.ContextMenu = value;
+ txtView.ContextMenu = value;
+ spnSpinner.ContextMenu = value;
}
}
- // TODO: What should this do?
- public override ContextMenu ContextMenu {
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DockPaddingEdges DockPadding {
get {
- return null;
- }
-
- set {
- /* */
+ return base.DockPadding;
}
}
- protected override CreateParams CreateParams {
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public override bool Focused {
get {
- return base.CreateParams;
+ return txtView.Focused;
}
}
-
- protected override Size DefaultSize {
- get { return new Size (120, PreferredHeight);}
- }
-
- public new DockPaddingEdges DockPadding {
- get { return base.DockPadding; }
- }
- protected bool UserEdit {
+ public override Color ForeColor {
get {
- return user_edit;
+ return base.ForeColor;
}
-
set {
- user_edit = value;
+ base.ForeColor = value;
+ txtView.ForeColor = value;
}
}
- public override string Text {
+ [DefaultValue(true)]
+ public bool InterceptArrowKeys {
get {
- if (entry == null)
- return String.Empty;
-
- return entry.Text;
+ return _InterceptArrowKeys;
}
-
set {
- //
- // The documentation is conflicts with itself, we can
- // not call UpdateEditText, as this will call Text to
- // set the value.
- //
- entry.Text = value;
-
- if (UserEdit)
- ValidateEditText ();
-
- if (ChangingText)
- ChangingText = false;
- }
- }
-
- public LeftRightAlignment UpDownAlign
- {
+ _InterceptArrowKeys = value;
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public int PreferredHeight {
get {
- return updown_align;
+ // For some reason, the TextBox's PreferredHeight does not
+ // change when the Font property is assigned. Without a
+ // border, it will always be Font.Height anyway.
+ //int text_box_preferred_height = (txtView != null) ? txtView.PreferredHeight : Font.Height;
+ int text_box_preferred_height = Font.Height;
+
+ switch (border_style) {
+ case BorderStyle.FixedSingle:
+ case BorderStyle.Fixed3D:
+ text_box_preferred_height += 3; // magic number? :-)
+
+ return text_box_preferred_height + 4;
+
+ case BorderStyle.None:
+ default:
+ return text_box_preferred_height;
+ }
}
-
- set {
- updown_align = value;
- }
- }
+ }
[DefaultValue(false)]
public bool ReadOnly {
get {
- return entry.ReadOnly;
+ return txtView.ReadOnly;
}
-
set {
- entry.ReadOnly = value;
+ txtView.ReadOnly = value;
}
}
- public override bool Focused {
+ [Localizable(true)]
+ public override string Text {
get {
- return entry.Focused;
+ return txtView.Text;
+ }
+ set {
+ bool suppress_validation = changing_text;
+
+ txtView.Text = value;
+
+ if (!suppress_validation)
+ ValidateEditText();
}
}
- public override Color ForeColor {
+ [DefaultValue(HorizontalAlignment.Left)]
+ [Localizable(true)]
+ public HorizontalAlignment TextAlign {
get {
- return base.ForeColor;
+ return txtView.TextAlign;
+ }
+ set{
+ txtView.TextAlign = value;
}
+ }
+ [DefaultValue(LeftRightAlignment.Right)]
+ [Localizable(true)]
+ public LeftRightAlignment UpDownAlign {
+ get {
+ return _UpDownAlign;
+ }
set {
- base.ForeColor = value;
- entry.ForeColor = value;
+ _UpDownAlign = value;
+
+ reseat_controls();
}
-
}
+ #endregion // Public Instance Properties
- public bool InterceptArrowKeys {
+ #region Protected Instance Properties
+ protected bool ChangingText {
get {
- return intercept;
+ return changing_text;
}
-
set {
- intercept = value;
+ changing_text = value;
}
}
-
- public int PreferredHeight {
+
+ protected override CreateParams CreateParams {
get {
- if (entry == null)
- return Height + 3;
-
- return entry.Height + 3;
+ return base.CreateParams;
}
- }
-
- public HorizontalAlignment TextAlign {
+ }
+
+ protected override Size DefaultSize {
get {
- return entry.TextAlign;
+ return new Size(120, this.PreferredHeight);
+ }
+ }
+
+ protected bool UserEdit {
+ get {
+ return user_edit;
}
-
set {
- if (value == entry.TextAlign)
- return;
-
- if (value != HorizontalAlignment.Right && value != HorizontalAlignment.Left
- && value != HorizontalAlignment.Center) {
- throw new InvalidEnumArgumentException ("The value assigned is not one of the HorizontalAlignment values.");
-
- }
-
- entry.TextAlign = value;
+ user_edit = value;
}
}
-#endregion
-
-#region UpDownBase standard methods
- public void Select (int start, int length)
- {
- entry.Select (start, length);
- }
+ #endregion // Protected Instance Properties
- protected virtual void ValidateEditText ()
- {
- //
+ #region Public Instance Methods
+ public abstract void DownButton();
+ public void Select(int start, int length) {
+ txtView.Select(start, length);
}
-#endregion
-#region Events
- //
- // All these events are just a proxy to the base class,
- // we must overwrite them for API compatibility
- //
-
- public new event EventHandler MouseEnter {
- add {
- base.MouseEnter += value;
- }
+ public abstract void UpButton();
+ #endregion // Public Instance Methods
- remove {
- base.MouseEnter -= value;
+ #region Protected Instance Methods
+ protected override void Dispose(bool disposing) {
+ if (disposing) {
+ txtView.Dispose();
+ txtView = null;
+
+ spnSpinner.Dispose();
+ spnSpinner = null;
}
+ base.Dispose (disposing);
}
- public new event EventHandler MouseHover {
- add {
- base.MouseHover += value;
- }
+ [MonoTODO]
+ protected virtual void OnChanged(object source, EventArgs e) {
+ // FIXME
+ }
+
+ protected override void OnFontChanged(EventArgs e) {
+ txtView.Font = this.Font;
+ Height = PreferredHeight;
+ }
+
+ protected override void OnHandleCreated(EventArgs e) {
+ base.OnHandleCreated (e);
+ }
+
+ protected override void OnLayout(LayoutEventArgs e) {
+ base.OnLayout(e);
+ }
+
+ protected override void OnMouseWheel(MouseEventArgs e) {
+ // prevent this event from firing twice for the same mouse action!
+ if (GetChildAtPoint(new Point(e.X, e.Y)) == null)
+ txtView_MouseWheel(null, e);
+ }
- remove {
- base.MouseHover -= value;
+ protected virtual void OnTextBoxKeyDown(object source, KeyEventArgs e) {
+ if (_InterceptArrowKeys) {
+ if ((e.KeyCode == Keys.Up) || (e.KeyCode == Keys.Down)) {
+ e.Handled = true;
+
+ if (e.KeyCode == Keys.Up)
+ UpButton();
+ if (e.KeyCode == Keys.Down)
+ DownButton();
+ }
}
+
+ OnKeyDown(e);
}
- public new event EventHandler MouseLeave {
- add {
- base.MouseLeave += value;
+ protected virtual void OnTextBoxKeyPress(object source, KeyPressEventArgs e) {
+ if (e.KeyChar == '\r') {
+ e.Handled = true;
+ ValidateEditText();
}
+ OnKeyPress(e);
+ }
- remove {
- base.MouseLeave -= value;
+ protected virtual void OnTextBoxLostFocus(object source, EventArgs e) {
+ if (user_edit) {
+ ValidateEditText();
}
}
- public new event EventHandler BackgroundImageChanged {
- add {
- base.BackgroundImageChanged += value;
+ protected virtual void OnTextBoxResize(object source, EventArgs e) {
+ // compute the new height, taking the border into account
+ Height = PreferredHeight;
+
+ // let anchoring reposition the controls
+ }
+
+ protected virtual void OnTextBoxTextChanged(object source, EventArgs e) {
+ if (changing_text) {
+ ChangingText = false;
+ } else {
+ UserEdit = true;
}
- remove {
- base.BackgroundImageChanged -= value;
+ OnTextChanged(e);
+ }
+
+ protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) {
+ base.SetBoundsCore(x, y, width, height, specified);
+
+ if ((specified & BoundsSpecified.Size) != BoundsSpecified.None) {
+ reseat_controls();
}
}
-#endregion
-
-#region Abstract methods
- public abstract void DownButton ();
- public abstract void UpButton ();
- public abstract void UpdateEditText ();
-#endregion
+
+ protected abstract void UpdateEditText();
+
+ protected virtual void ValidateEditText() {
+ // to be overridden by subclassers
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ protected override void WndProc(ref Message m) {
+ base.WndProc (ref m);
+ }
+ #endregion // Protected Instance Methods
+
+ #region Events
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler BackgroundImageChanged;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler MouseEnter;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler MouseHover;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event EventHandler MouseLeave;
+
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new event MouseEventHandler MouseMove;
+ #endregion // Events
}
}
}
case StdCursor.SizeNESW: {
- shape = CursorFontShape.XC_sizing;
+ shape = CursorFontShape.XC_top_right_corner;
break;
}
case StdCursor.SizeNS: {
- shape = CursorFontShape.XC_fleur;
+ shape = CursorFontShape.XC_sb_v_double_arrow;
break;
}
case StdCursor.SizeNWSE: {
- shape = CursorFontShape.XC_bottom_right_corner;
+ shape = CursorFontShape.XC_top_left_corner;
break;
}
case StdCursor.SizeWE: {
- shape = CursorFontShape.XC_fleur;
+ shape = CursorFontShape.XC_sb_h_double_arrow;
break;
}
msg.message = Msg.WM_MOUSEMOVE;
msg.wParam = GetMousewParam(0);
- msg.lParam = (IntPtr) (xevent.MotionEvent.y << 16 | xevent.MotionEvent.x);
+ msg.lParam = (IntPtr) (xevent.MotionEvent.y << 16 | xevent.MotionEvent.x & 0xFFFF);
HoverState.X = MousePosition.X = xevent.MotionEvent.x;
HoverState.Y = MousePosition.Y = xevent.MotionEvent.y;
break;
} else {
msg.message = Msg.WM_NCHITTEST;
- msg.lParam = (IntPtr) (xevent.MotionEvent.y << 16 | xevent.MotionEvent.x);
+ msg.lParam = (IntPtr) (xevent.MotionEvent.y << 16 | xevent.MotionEvent.x & 0xFFFF);
MousePosition.X = xevent.MotionEvent.x;
MousePosition.Y = xevent.MotionEvent.y;
WakeupMain ();
}
+ internal override void SetAllowDrop (IntPtr handle, bool value)
+ {
+ // We allow drop on all windows
+ }
+
internal override void SetBorderStyle(IntPtr handle, BorderStyle border_style) {
Hwnd hwnd;
System.Windows.Forms/LabelPropertyTest.cs
System.Windows.Forms/ControlTest.cs
System.Windows.Forms/ControlEventTest.cs
+System.Windows.Forms/TextBoxTest.cs
+System.Windows.Forms/ButtonTest.cs
--- /dev/null
+//\r
+// Copyright (c) 2005 Novell, Inc.\r
+//\r
+// Authors:\r
+// Ritvik Mayank (mritvik@novell.com)\r
+//\r
+\r
+using System;\r
+using System.Windows.Forms;\r
+using System.Drawing;\r
+using NUnit.Framework;\r
+\r
+[TestFixture]\r
+public class ButtonTest\r
+{\r
+ [Test]\r
+ public void FlatStyleTest()\r
+ {\r
+ Button B1 = new Button();\r
+ Assert.AreEqual(FlatStyle.Standard, B1.FlatStyle, "#1");\r
+ }\r
+\r
+ [Test]\r
+ public void ImageTest()\r
+ {\r
+ Button B1 = new Button();\r
+ B1.Visible = true;\r
+ B1.Image = Image.FromFile("M.gif");\r
+ Assert.AreEqual(ContentAlignment.MiddleCenter, B1.ImageAlign, "#2");\r
+ }\r
+\r
+ [Test]\r
+ public void ImageListTest()\r
+ {\r
+ Button B1 = new Button();\r
+ B1.Image = Image.FromFile("M.gif");\r
+ Assert.AreEqual(null, B1.ImageList, "#3a");\r
+ ImageList ImageList1 = new ImageList();\r
+ ImageList1.Images.Add(Image.FromFile("M.gif"));\r
+ B1.ImageList = ImageList1;\r
+ Assert.AreEqual(-1, B1.ImageIndex, "#3b");\r
+ B1.ImageIndex = 0;\r
+ Assert.AreEqual(1, B1.ImageList.Images.Count, "#3c");\r
+ Assert.AreEqual(16, B1.ImageList.ImageSize.Height, "#3d");\r
+ Assert.AreEqual(16, B1.ImageList.ImageSize.Width, "#3e");\r
+ }\r
+ \r
+ [Test]\r
+ public void IMeModeTest()\r
+ {\r
+ Button B1 = new Button();\r
+ Assert.AreEqual(ImeMode.Disable, B1.ImeMode, "#4");\r
+ }\r
+\r
+ [Test]\r
+ public void TextAlignTest()\r
+ {\r
+ Button B1 = new Button();\r
+ Assert.AreEqual(ContentAlignment.MiddleCenter, B1.TextAlign, "#5");\r
+ }\r
+\r
+ [Test]\r
+ public void DialogResultTest()\r
+ {\r
+ Form f = new Form();\r
+ Button B1 = new Button();\r
+ B1.Text = "DialogResult";\r
+ B1.DialogResult = DialogResult.No;\r
+ B1.TextAlign = ContentAlignment.BottomRight;\r
+ B1.Visible = true;\r
+ f.Controls.Add(B1);\r
+ Assert.AreEqual(DialogResult.No, B1.DialogResult, "#6");\r
+ }\r
+\r
+ [Test]\r
+ public void PerformClickTest()\r
+ {\r
+ Form f = new Form();\r
+ Button B1 = new Button();\r
+ B1.Text = "DialogResult";\r
+ B1.Visible = true;\r
+ f.Controls.Add(B1);\r
+ B1.PerformClick();\r
+ Assert.AreEqual(DialogResult.None, B1.DialogResult, "#7");\r
+ }\r
+ \r
+ [Test]\r
+ public void NotifyDefaultTest()\r
+ {\r
+ Button B1 = new Button();\r
+ Assert.AreEqual("System.Windows.Forms.Button, Text: ", B1.ToString(), "#8");\r
+ }\r
+\r
+ [Test]\r
+ public void ToStringTest()\r
+ {\r
+ Button B1 = new Button();\r
+ Assert.AreEqual("System.Windows.Forms.Button, Text: " , B1.ToString(), "#9");\r
+ }\r
+}\r
+2005-06-13 Ritvik Mayank <mritvik@novell.com>
+
+ * TextBoxTest.cs : Test Cases for TextBox
+ * BUttonTest.cs : Test Cases for Buttons
+
2005-05-11 Ritvik Mayank <mritvik@novell.com>
* ControlEventTest.cs : Test Cases for Events
--- /dev/null
+//
+// Copyright (c) 2005 Novell, Inc.
+//
+// Authors:
+// Ritvik Mayank (mritvik@novell.com)
+//
+
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Reflection;
+using NUnit.Framework;
+
+[TestFixture]
+public class TextBoxBaseTest
+{
+ [Test]
+ public void TextBoxBasePropertyTest()
+ {
+ TextBox tb = new TextBox();
+ Assert.AreEqual(false, tb.AcceptsTab, "#1a");
+ tb.Multiline = true;
+ tb.AcceptsTab = true;
+ SendKeys.SendWait("^%");
+ Assert.AreEqual(true, tb.AcceptsTab, "#1b");
+ Assert.AreEqual(true, tb.AutoSize, "#2");
+ Assert.AreEqual("Window", tb.BackColor.Name, "#3a");
+ tb.BackColor = Color.White;
+ Assert.AreEqual("White", tb.BackColor.Name, "#3b");
+ Assert.AreEqual(null, tb.BackgroundImage, "#4a");
+ string gif = "M.gif";
+ tb.BackgroundImage = Image.FromFile(gif);
+ //Assert.AreEqual(Image.FromFile(gif, true), tb.BackgroundImage, "#4b");
+ Assert.AreEqual(BorderStyle.Fixed3D, tb.BorderStyle, "#5");
+ Assert.AreEqual(false, tb.CanUndo, "#6a");
+ tb.Paste();
+ Assert.AreEqual(true, tb.CanUndo, "#6b");
+ tb.ClearUndo();
+ Assert.AreEqual(false, tb.CanUndo, "#6c");
+ Assert.AreEqual("WindowText", tb.ForeColor.Name, "#7");
+ Assert.AreEqual(true, tb.HideSelection, "#8");
+ Assert.AreEqual(1, tb.Lines.Length, "#9");
+ Assert.AreEqual(32767, tb.MaxLength, "#10");
+ Assert.AreEqual(true, tb.Modified, "#11");
+ Assert.AreEqual(true, tb.Multiline, "#12a");
+ tb.WordWrap = false;
+ Assert.AreEqual(true, tb.Multiline, "#12b");
+ tb.AcceptsReturn = true;
+ Assert.AreEqual(true, tb.Multiline, "#12c");
+ Assert.AreEqual(20, tb.PreferredHeight, "#13");
+ Assert.AreEqual(false, tb.ReadOnly, "#14");
+ Assert.AreEqual("", tb.SelectedText, "#15");
+ tb.Text = "sample TextBox";
+ Assert.AreEqual(0, tb.SelectionLength, "#16b");
+ Assert.AreEqual(0, tb.SelectionStart, "#17");
+ tb.WordWrap = false;
+ tb.AcceptsReturn = true;
+ Assert.AreEqual("sample TextBox", tb.Text, "#18");
+ Assert.AreEqual(14, tb.TextLength, "#19");
+ Assert.AreEqual(false, tb.WordWrap, "#20");
+ }
+
+ [Test]
+ public void TextBoxPropertyTest()
+ {
+ TextBox tb = new TextBox();
+ Assert.AreEqual(false, tb.AcceptsReturn, "#21");
+ Assert.AreEqual(CharacterCasing.Normal, tb.CharacterCasing, "#22");
+ //Assert.AreEqual("", tb.PasswordChar.ToString(), "#23");
+ Assert.AreEqual(ScrollBars.None, tb.ScrollBars, "#24");
+ Assert.AreEqual(0, tb.SelectionLength, "#25");
+ Assert.AreEqual(HorizontalAlignment.Left , tb.TextAlign, "#26");
+ }
+
+ [Test]
+ public void AppendTextTest()
+ {
+ Form f = new Form();
+ f.Visible = true;
+ TextBox tb1 = new TextBox();
+ tb1.Visible = true;
+ tb1.Text = "TextBox1";
+ TextBox tb2 = new TextBox();
+ tb2.Visible = true;
+ f.Controls.Add(tb1);
+ f.Controls.Add(tb2);
+ tb2.AppendText(tb1.Text);
+ Assert.AreEqual("TextBox1", tb2.Text, "#27");
+ }
+
+ [Test]
+ public void ClearTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "TextBox1";
+ Assert.AreEqual("TextBox1", tb1.Text, "#28a" );
+ tb1.Clear ();
+ Assert.AreEqual("", tb1.Text, "#28b");
+ }
+
+ [Test]
+ public void ClearUndoTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "TextBox1";
+ tb1.SelectionLength = 4;
+ tb1.Copy();
+ Assert.AreEqual("Text", tb1.SelectedText, "#29a");
+ tb1.Paste();
+ Assert.AreEqual(true, tb1.CanUndo, "#29b");
+ tb1.ClearUndo();
+ Assert.AreEqual(false, tb1.CanUndo, "#29c");
+ }
+
+ [Test]
+ public void CopyTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "ABCDE";
+ tb1.SelectionLength = 4;
+ tb1.Copy();
+ Assert.AreEqual("ABCD", tb1.SelectedText, "#30");
+ }
+
+ [Test]
+ public void CutTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "ABCDE";
+ tb1.SelectionLength = 4;
+ tb1.Cut();
+ Assert.AreEqual("E", tb1.Text, "#31");
+ }
+
+ [Test]
+ public void PasteTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "ABCDE";
+ tb1.SelectionLength = 4;
+ tb1.SelectionStart = tb1.SelectionStart + tb1.SelectionLength;
+ tb1.Paste();
+ Assert.AreEqual("ABCDABCD", tb1.Text, "#32");
+ }
+
+ [Test]
+ public void SelectTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "This is a sample test.";
+ tb1.Select(0, 4);
+ Assert.AreEqual("This", tb1.SelectedText, "#33");
+ }
+
+ [Test]
+ public void SelectAllTest()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "This is a sample test.";
+ tb1.SelectAll();
+ Assert.AreEqual("This is a sample test.", tb1.SelectedText, "#34");
+ }
+
+ [Test]
+ public void ToStringTest()
+ {
+ TextBox tb1 = new TextBox();
+ Assert.AreEqual("System.Windows.Forms.TextBox, Text: ", tb1.ToString(), "#35");
+ }
+
+ [Test]
+ public void UndoTest1()
+ {
+ TextBox tb1 = new TextBox();
+ tb1.Text = "ABCDE";
+ tb1.SelectionLength = 4;
+ tb1.Copy();
+ tb1.SelectionStart = tb1.SelectionStart + tb1.SelectionLength;
+ tb1.Paste();
+ tb1.Undo();
+ Assert.AreEqual("ABCDE", tb1.Text, "#36");
+ }
+
+}
+2005-06-10 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * LateBinding.cs: Added field right_hand_side. Initial
+ implementation of Call. Added build_args method. Initial
+ implementation of GetNonMissingValue.
+ * Convert.cs (ToObject): Add return values for TypeCode.String,
+ TypeCode.Boolean, and TypeCode.Object.
+ * RegExpPrototype.cs (toString): Implemented.
+ * RegExpObject.cs: Implemented.
+ * RegExpConstructor.cs: Implement Construct, CreateInstance, and Invoke.
+
+2005-06-06 Cesar Lopez Nataren <cnataren@novell.com>
+
+ * expression.cs (emit_access): We can now access the properties
+ from the Global RegExp object, they were not being accesible
+ because they are properties not fields.
+
2005-05-31 Cesar Lopez Nataren <cnataren@novell.com>
* SemanticAnalizer.cs: Add the global, non-constructable RegExp
public static object ToObject (object value, VsaEngine engine)
- {
+ {
+ IConvertible ic = value as IConvertible;
+ TypeCode tc = Convert.GetTypeCode (value, ic);
+
+ switch (tc) {
+ case TypeCode.String:
+ return new StringObject (ic.ToString (null));
+ case TypeCode.Object:
+ return value;
+ default:
+ Console.WriteLine ("\nToObject: value.GetType = {0}", value.GetType ());
+ break;
+ }
throw new NotImplementedException ();
}
case TypeCode.DBNull:
return "null";
+ case TypeCode.Boolean:
+ bool r = (bool) value;
+ if (r)
+ return "true";
+ else
+ return "false";
+
case TypeCode.String:
case TypeCode.Double:
return ic.ToString (null);
using System.Reflection;
using System.Diagnostics;
using Microsoft.JScript.Vsa;
+using System.Collections;
namespace Microsoft.JScript {
public object obj;
private static BindingFlags bind_flags = BindingFlags.Public;
-
+ private string right_hand_side;
+
public LateBinding (string name)
{
- throw new NotImplementedException ();
+ this.right_hand_side = name;
}
public object Call (object [] arguments, bool construct, bool brackets,
VsaEngine engine)
{
+ if (construct) {
+ if (brackets) {
+ } else {
+ }
+ } else {
+ if (brackets) {
+ } else {
+ Type type = null;
+
+ if (obj is JSObject)
+ type = SemanticAnalyser.map_to_prototype ((JSObject) obj);
+
+ MethodInfo method = type.GetMethod (right_hand_side, BindingFlags.Public | BindingFlags.Static);
+ object [] args = build_args (arguments, engine);
+ return method.Invoke (type, args);
+ }
+ }
throw new NotImplementedException ();
}
+ private object [] build_args (object [] arguments, VsaEngine engine)
+ {
+ ArrayList args = new ArrayList ();
+ if (obj != null)
+ args.Add (obj);
+ if (engine != null)
+ args.Add (engine);
+ foreach (object o in arguments)
+ args.Add (o);
+ return args.ToArray ();
+ }
+
[DebuggerStepThroughAttribute]
[DebuggerHiddenAttribute]
public static object CallValue (object thisObj, object val, object [] arguments,
[DebuggerHiddenAttribute]
public object GetNonMissingValue ()
{
+ Type type = obj.GetType ();
+ MemberInfo [] members = type.GetMember (right_hand_side);
+ if (members.Length > 0) {
+ MemberInfo member = members [0];
+ MemberTypes member_type = member.MemberType;
+
+ switch (member_type) {
+ case MemberTypes.Property:
+ MethodInfo method = ((PropertyInfo) member).GetGetMethod ();
+ return method.Invoke (obj, new object [] {});
+ }
+ }
throw new NotImplementedException ();
}
// Author: Cesar Octavio Lopez Nataren
//
// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+// (C) Copyright 2005, Novell Inc (http://novell.com)
//
//
public Object Construct (string pattern, bool ignoreCase, bool global, bool multiLine)
{
- throw new NotImplementedException ();
+ RegExpObject re = new RegExpObject (pattern, ignoreCase, global, multiLine);
+ return re;
}
- [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]
- public new RegExpObject CreateInstance(params Object[] args)
+ //
+ // Invoked when we do: new RegExp (...)
+ //
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
+ public new RegExpObject CreateInstance (params object [] args)
{
- throw new NotImplementedException ();
+ return Invoke (args);
}
- [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]
- public RegExpObject Invoke(params Object[] args)
+ //
+ // Invoked when we do: x = RegExp (...)
+ //
+ [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
+ public RegExpObject Invoke (params object [] args)
{
+ if (args != null) {
+ int length = args.Length;
+ if (length > 0) {
+ object o = args [0];
+ if (o is RegExpObject)
+ return (RegExpObject) o;
+
+ string flags = "";
+ if (length > 1)
+ flags += Convert.ToString (args [1]);
+ return new RegExpObject (Convert.ToString (args [0]),
+ flags.IndexOfAny (new char [] {'i'}) > -1,
+ flags.IndexOfAny (new char [] {'g'}) > -1,
+ flags.IndexOfAny (new char [] {'m'}) > -1);
+ }
+ }
throw new NotImplementedException ();
}
// Author: Cesar Octavio Lopez Nataren
//
// (C) 2003, Cesar Octavio Lopez Nataren, <cesar@ciencias.unam.mx>
+// (C) Copyright 2005, Novell Inc (http://novell.com)
//
//
//
using System;
+using System.Text;
namespace Microsoft.JScript {
public class RegExpObject : JSObject {
+ private string _source;
+ private bool _ignoreCase;
+ private bool _global;
+ private bool _multiline;
+
public override string ToString ()
{
- throw new NotImplementedException ();
+ StringBuilder str = new StringBuilder ();
+ str.Append ("/");
+ str.Append (_source);
+ str.Append ("/");
+
+ if (_ignoreCase)
+ str.Append ("i");
+ if(_global)
+ str.Append ("g");
+ if (_multiline)
+ str.Append ("m");
+
+ return str.ToString ();
}
public string source {
- get { throw new NotImplementedException (); }
+ get { return _source; }
}
public bool ignoreCase {
- get { throw new NotImplementedException (); }
+ get { return _ignoreCase; }
}
public bool global {
- get { throw new NotImplementedException (); }
+ get { return _global; }
}
public bool multiline {
- get { throw new NotImplementedException (); }
+ get { return _multiline; }
}
public Object lastIndex {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
+
+ internal RegExpObject (string pattern, bool ignoreCase, bool global, bool multiLine)
+ {
+ _source = pattern;
+ _ignoreCase = ignoreCase;
+ _global = global;
+ _multiline = multiLine;
+ }
}
}
// Cesar Lopez Nataren (cesar@ciencias.unam.mx)
//
// (C) 2003, Cesar Lopez Nataren
+// (C) Copyright 2005, Novell Inc (http://novell.com)
//
//
[JSFunctionAttribute (JSFunctionAttributeEnum.HasThisObject, JSBuiltin.RegExp_toString)]
public static string toString (object thisObj)
{
- throw new NotImplementedException ();
+ SemanticAnalyser.assert_type (thisObj, typeof (RegExpObject));
+ RegExpObject re = (RegExpObject) thisObj;
+ return re.ToString ();
}
}
}
+++ /dev/null
-//
-// driver.cs: Guides the compilation process through the different phases.
-//
-// Author:
-// Cesar Lopez Nataren (cesar@ciencias.unam.mx)
-//
-// (C) 2003, Cesar Lopez Nataren
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Microsoft.JScript {
-
- public class Driver {
-
- public static void Main (string [] args) {
-
- if (args.Length < 1) {
- Console.WriteLine ("Usage: [mono] mjs.exe filename.js");
- Environment.Exit (0);
- }
-
- string filename = args [0];
- Context ctx = new Context (filename);
- JSParser parser = new JSParser (ctx);
- ScriptBlock prog_tree = parser.Parse ();
- SemanticAnalyser.Run (prog_tree);
- CodeGenerator.Run (args [0], prog_tree);
- Console.WriteLine ("Compilation succeeded.");
- }
- }
-}
ig.Emit (OpCodes.Ldc_R8, (double) value);
break;
case MemberTypes.Property:
- default:
+ PropertyInfo property = (PropertyInfo) minfo;
+ Type decl_type = property.DeclaringType;
+ Type t = null;
+
+ if (decl_type == typeof (RegExpConstructor)) {
+ t = typeof (GlobalObject);
+ }
+ ig.Emit (OpCodes.Call, t.GetProperty (FieldName (decl_type)).GetGetMethod ());
+ CodeGenerator.load_engine (InFunction, ig);
+ ig.Emit (OpCodes.Call, typeof (Convert).GetMethod ("ToObject2"));
+ ig.Emit (OpCodes.Castclass, decl_type);
+
+ ig.Emit (OpCodes.Call, decl_type.GetProperty (property.Name).GetGetMethod ());
+ break;
+ default:
throw new NotImplementedException ();
}
emit_box (ig, minfo);
- }
+ }
void emit_box (ILGenerator ig, MemberInfo info)
{
ig.Emit (OpCodes.Box, type);
}
+ private string FieldName (Type type)
+ {
+ if (type == typeof (RegExpConstructor))
+ return "RegExp";
+ throw new NotImplementedException ();
+ }
+
void emit_late_binding (EmitContext ec)
{
LocalBuilder local_lb = init_late_binding (ec);
contains_method = SemanticAnalyser.object_contains (
SemanticAnalyser.map_to_ctr (obj_name), prop_name);
if (!contains_method)
- throw new Exception ("error: JS0438: Object doesn't support this property or method");
+ throw new Exception ("error: JS0438: Object " + obj_name + " doesn't support this property or method:" + prop_name);
return true;
}
[assembly: SatelliteContractVersion("7.0.3300.0")]
#endif
-[assembly: AssemblyTitle("Microsoft.VisualBasic.dll")]
-[assembly: AssemblyDescription("Microsoft.VisualBasic.dll")]
+[assembly: AssemblyTitle("Microsoft Visual Basic .NET Runtime")]
+[assembly: AssemblyDescription("Microsoft Visual Basic .NET Runtime")]
[assembly: AssemblyCompany("MONO development team")]
[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
+2005-06-06 Rafael Teixeira (rafaelteixeirabr@hotmail.com)
+ * Adjusted AssemblyTitle and AssemblyDescription attributes according
+ to warning on class status page
+
2003-11-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* AssemblyInfo.cs: Added
* ChangeLog: Added
- * Locale.cs: Added
\ No newline at end of file
+ * Locale.cs: Added
+2005-06-06 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * VBBinder.cs : Made it internal as it isn't public in 1.1 API
+ * DoubleType.cs: corrected, TryParse is now internal
+ * ObjectType.cs: corrected, CTypeHelper(string, Type) overload is now internal
+ * Utils.cs: corrected, SetTime and SetDate are now internal
+
2005-05-25 Satya Sudha K <ksathyasudha@novell.com>
* ObjectType.cs : Some fixes to Narrowing conversions
return Parse(Value, null);
}
- public static bool TryParse(string Value, out double result) {
+
+ internal static bool TryParse(string Value, out double result) {
return Double.TryParse(Value, NumberStyles.Any, null, out result);
}
}
//checked + string
- public static object CTypeHelper(object obj, Type toType) {
+ internal static object CTypeHelper(object obj, Type toType) {
if (obj == null)
return null;
return Convert.ToString(Val, 8);
}
- public static void SetTime(DateTime dtTime) {
+ internal static void SetTime(DateTime dtTime) {
throw new NotImplementedException("Method SetTime in VisualBasic.CompilerServices.Utils is not supported");
}
- public static void SetDate(DateTime vDate) {
+ internal static void SetDate(DateTime vDate) {
throw new NotImplementedException("Method SetDate in VisualBasic.CompilerServices.Utils is not supported");
}
namespace Microsoft.VisualBasic.CompilerServices
{
[StandardModule, EditorBrowsableAttribute(EditorBrowsableState.Never)]
- public class VBBinder : Binder
+ internal class VBBinder : Binder
{
public VBBinder() : base()
{
+2005-06-10 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Collection.cs : csc build fix.
+
+2005-06-06:2 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * FileSystem.cs: Killed unneeded overload FileGet(in, ref Object, ...)
+
+2005-06-06 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * Collection.cs (Item [indexer]): Correcting API according to
+ FX1.1 class status page
+ * FileSystem.cs: Killed unneeded overload of Dir method
+ All FileGet overloads grouped together in the source file
+ * VariantType.cs: Killed extraneous enum value
+ * Information.cs: Corrected, was using the VariantType extraneous value
+
2005-05-25 Ben Maurer <bmaurer@ximian.com>
* Conversion.cs (Val): Do a correct impl of Val (char). Fixes bug
get {return m_HashIndexers.Count;}
}
- [ReadOnly(true)]
+ // [ReadOnly(true)] class status page says it shouldn't be here
[System.Runtime.CompilerServices.IndexerName("Item")]
public System.Object this [System.Int32 Index] {
get {
throw new IndexOutOfRangeException();
}
}
- set {throw new NotImplementedException();}
+#if NET_2_0
+ }
+
+ System.Object IList.this[System.Int32 Index] {
+#endif
+ set {
+ throw new NotImplementedException();
+ }
}
[System.Runtime.CompilerServices.IndexerName("Item")]
vbFile.put(value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref bool value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
-
- {
- checkRecordNumber(recordNumber,false);
- VBFile vbFile = getVBFile(fileNumber);
- vbFile.get(out value,recordNumber);
- }
-
private static void checkRecordNumber(long recordNumber,bool throwArgExc)
{
if ((recordNumber < 1) && (recordNumber != -1))
}
public static void FileGet(
- int fileNumber,
- ref byte value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ int fileNumber,
+ ref byte value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
}
public static void FileGet(
- int fileNumber,
- ref short value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ int fileNumber,
+ ref bool value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
}
public static void FileGet(
- int fileNumber,
- ref char value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ int fileNumber,
+ ref short value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+
+ {
+ checkRecordNumber(recordNumber,false);
+ VBFile vbFile = getVBFile(fileNumber);
+ vbFile.get(out value,recordNumber);
+ }
+
+ public static void FileGet(
+ int fileNumber,
+ ref char value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
}
- public static void FileGet(int fileNumber,
- ref int value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref int value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
VBFile vbFile = getVBFile(fileNumber);
vbFile.get(out value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref long value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref long value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
VBFile vbFile = getVBFile(fileNumber);
vbFile.get(out value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref float value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref float value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
VBFile vbFile = getVBFile(fileNumber);
vbFile.get(out value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref double value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref double value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
vbFile.get(out value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref Decimal value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref Decimal value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,false);
vbFile.get(out value,recordNumber);
}
- public static void FileGet(int fileNumber,
- ref string value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
- [Optional, __DefaultArgumentValue(false)] bool bIgnored)
+ public static void FileGet(
+ int fileNumber,
+ ref string value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
+ [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength)
{
checkRecordNumber(recordNumber,true);
VBFile vbFile = getVBFile(fileNumber);
- vbFile.get(ref value,recordNumber,bIgnored);
+ vbFile.get(ref value,recordNumber,stringIsFixedLength);
}
- public static void FileGet(int fileNumber,
- ref Object value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ public static void FileGet(
+ int fileNumber,
+ ref DateTime value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+
{
- checkRecordNumber(recordNumber,false);
+ checkRecordNumber(recordNumber,true);
VBFile vbFile = getVBFile(fileNumber);
- vbFile.get(ref value,recordNumber);
+ vbFile.get(out value,recordNumber);
+ }
+
+ [MonoTODO]
+ public static void FileGet(
+ int fileNumber,
+ ref ValueType value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
+ {
+ throw new NotImplementedException();
+ }
+
+ public static void FileGet(
+ int fileNumber,
+ ref Array value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
+ [Optional, __DefaultArgumentValue(false)] bool arrayIsDynamic,
+ [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength)
+ {
+ checkRecordNumber(recordNumber,true);
+ VBFile vbFile = getVBFile(fileNumber);
+ vbFile.get(ref value,recordNumber,arrayIsDynamic,stringIsFixedLength);
}
public static long Seek(int fileNumber)
}
- public static /*synchronized*/ String Dir(String pathName)
- {
- return Dir(pathName, 0);
- }
-
public static /*synchronized*/ String Dir(String pathName,
[Optional, __DefaultArgumentValue((int)0)]
FileAttribute fileAttribute)
return Directory.GetCurrentDirectory();
}
- public static void FileGetObject(int fileNumber,
- ref object value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
-
-
+ [MonoTODO("How to deal with Array types?")]
+ public static void FileGetObject(
+ int fileNumber,
+ ref object value,
+ [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
{
checkRecordNumber(recordNumber,true);
VBFile vbFile = getVBFile(fileNumber);
throw new NotSupportedException();
}
- public static void FileGet(int fileNumber,
- ref DateTime value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
-
- {
- checkRecordNumber(recordNumber,true);
- VBFile vbFile = getVBFile(fileNumber);
- vbFile.get(out value,recordNumber);
- }
-
- [MonoTODO]
- public static void FileGet(int fileNumber,
- ref ValueType value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
- {
- throw new NotImplementedException();
- }
-
- public static void FileGet(int fileNumber,
- ref Array value,
- [Optional, __DefaultArgumentValue((long)-1)] long recordNumber,
- [Optional, __DefaultArgumentValue(false)] bool arrayIsDynamic,
- [Optional, __DefaultArgumentValue(false)] bool stringIsFixedLength)
-
-
- {
- checkRecordNumber(recordNumber,true);
- VBFile vbFile = getVBFile(fileNumber);
- vbFile.get(ref value,recordNumber,arrayIsDynamic,stringIsFixedLength);
- }
-
public static void FilePutObject(int fileNumber,
Object value,
[Optional, __DefaultArgumentValue((long)-1)] long recordNumber)
if(varType.IsArray) {
Type type = varType.GetElementType();
- if(type.IsArray)
- return VariantType.ObjectArray;
+ if (type.IsArray)
+ return VariantType.Array | VariantType.Object;
int elemVal = (int) Information.varType(type);
return (VariantType)((int)VariantType.Array | elemVal);
Char = 18,\r
Long = 20,\r
UserDefinedType = 36,\r
- Array = 8192,\r
- ObjectArray = 8201\r
+ Array = 8192 /*,\r
+ ObjectArray = 8201 - No documentation neither class status page says it is needed */\r
};\r
}\r
+++ /dev/null
-2003-01-16 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.Db2Client/DB2ClientConnection.cs: added parsing and setting
- of connection string values. Prior to this change, the server, username, and
- authentication were hard-coded.
-
- * Mono.Data.Db2Client/DB2ClientUtils.cs: prevent warning about
- unreachable code
-
- * Test/TestDB2Conn/TestDB2Conn.cs: modify test to accept
- database, username, and password from command line. Also, test
- a CREATE TABLE statement with ExecuteNonQuery()
-
-2003-01-16 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.Db2Client.build: added file for Windows build
-
-2003-01-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * makefile.gnu: added --unsafe command line option, needed for unsafe
- code. The IBM DB2 provider now compiles on Mono.
-
- * list: added missing file.
-
-2003-01-15 Rodrigo Moya <rodrigo@ximian.com>
-
- Added IBM DB2 provider from cleared <cleared@rogers.com>.
+++ /dev/null
-This module has been deprecated in favor of IBM.Data.DB2
+++ /dev/null
-thisdir = class/Mono.Data.DB2Client
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Data.DB2Client.dll
-LIB_MCS_FLAGS = /unsafe /r:$(corlib) /r:System.dll \
- /r:System.Xml.dll /r:System.Data.dll
-NO_TEST = yes
-
-EXTRA_DISTFILES = \
- Test/TestDB2Conn/App.ico \
- Test/TestDB2Conn/AssemblyInfo.cs \
- Test/TestDB2Conn/ChangeLog \
- Test/TestDB2Conn/TestDB2Conn.cs
-
-include ../../build/library.make
-
+++ /dev/null
-Mono.Data.Db2Client/AssemblyInfo.cs
-Mono.Data.Db2Client/DB2ClientCommand.cs
-Mono.Data.Db2Client/DB2ClientConnection.cs
-Mono.Data.Db2Client/DB2ClientConstants.cs
-Mono.Data.Db2Client/DB2ClientDataReader.cs
-Mono.Data.Db2Client/DB2ClientException.cs
-Mono.Data.Db2Client/DB2ClientPrototypes.cs
-Mono.Data.Db2Client/DB2ClientTransaction.cs
-Mono.Data.Db2Client/DB2ClientUtils.cs
-Mono.Data.Db2Client/DB2ClientParameter.cs
-Mono.Data.Db2Client/DB2ClientParameterCollection.cs
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-//\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-//\r
-[assembly: AssemblyTitle("")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("")]\r
-[assembly: AssemblyCopyright("")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")] \r
-\r
-//\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-// Major Version\r
-// Minor Version \r
-// Build Number\r
-// Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-\r
-[assembly: AssemblyVersion("1.0.*")]\r
-\r
-//\r
-// In order to sign your assembly you must specify a key to use. Refer to the \r
-// Microsoft .NET Framework documentation for more information on assembly signing.\r
-//\r
-// Use the attributes below to control which key is used for signing. \r
-//\r
-// Notes: \r
-// (*) If no key is specified, the assembly is not signed.\r
-// (*) KeyName refers to a key that has been installed in the Crypto Service\r
-// Provider (CSP) on your machine. KeyFile refers to a file which contains\r
-// a key.\r
-// (*) If the KeyFile and the KeyName values are both specified, the \r
-// following processing occurs:\r
-// (1) If the KeyName can be found in the CSP, that key is used.\r
-// (2) If the KeyName does not exist and the KeyFile does exist, the key \r
-// in the KeyFile is installed into the CSP and used.\r
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.\r
-// When specifying the KeyFile, the location of the KeyFile should be\r
-// relative to the project output directory which is\r
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is\r
-// located in the project directory, you would specify the AssemblyKeyFile \r
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]\r
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework\r
-// documentation for more information on this.\r
-//\r
-[assembly: AssemblyDelaySign(false)]\r
-[assembly: AssemblyKeyFile("")]\r
-[assembly: AssemblyKeyName("")]\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-using System.Runtime.InteropServices;\r
-\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Summary description for DB2ClientCommand.\r
- /// </summary>\r
- public class DB2ClientCommand : IDbCommand\r
- {\r
- #region Private data members\r
- private string commandText;\r
- private DB2ClientConnection db2Conn;\r
- private DB2ClientTransaction db2Trans;\r
- private int commandTimeout;\r
- private bool prepared = false;\r
- private IntPtr hwndStmt; //Our statement handle\r
- private DB2ClientParameterCollection parameters = new DB2ClientParameterCollection();\r
-\r
- #endregion\r
-\r
- #region Constructors\r
- /// <summary>\r
- /// Default constructor. Since I'm using CLI functions to do this stuff, we're stuck\r
- /// until we get the database environment handle.\r
- /// </summary>\r
- public DB2ClientCommand()\r
- {\r
- hwndStmt = IntPtr.Zero;\r
- }\r
- public DB2ClientCommand(string commandStr)\r
- {\r
- commandText = commandStr;\r
- hwndStmt = IntPtr.Zero;\r
- }\r
- public DB2ClientCommand(string commandStr, DB2ClientConnection con)\r
- {\r
- commandText = commandStr;\r
- db2Conn = con;\r
- AllocateStatement("Constructor 3");\r
- }\r
- public DB2ClientCommand (string commandStr, DB2ClientConnection con, DB2ClientTransaction trans)\r
- {\r
- commandText = commandStr;\r
- db2Conn = con;\r
- db2Trans = trans;\r
- AllocateStatement("Constructor 4");\r
- }\r
- ///DB2 Specific constructors\r
- ///\r
- public DB2ClientCommand (IntPtr hwndSt)\r
- {\r
- hwndStmt = hwndSt;\r
- }\r
- public void Dispose()\r
- {\r
- }\r
- #endregion\r
- #region SelfDescribe property\r
- ///\r
- /// Property dictates whether or not any paramter markers will get their describe info\r
- /// from the database, or if the user will supply the information\r
- /// \r
- bool selfDescribe = false;\r
- public bool SelfDescribe\r
- {\r
- get \r
- {\r
- return selfDescribe;\r
- }\r
- set \r
- {\r
- selfDescribe = value;\r
- }\r
- }\r
- #endregion\r
- #region CommandText property\r
- ///\r
- ///The query; If it gets set, reset the prepared property\r
- ///\r
- public string CommandText\r
- {\r
- get\r
- {\r
- return commandText;\r
- }\r
- set\r
- {\r
- prepared = false;\r
- commandText = value;\r
- }\r
- }\r
- #endregion\r
- #region CommandTimeout property\r
- ///\r
- /// The Timeout property states how long we wait for results to return\r
- /// \r
- public int CommandTimeout\r
- {\r
- get\r
- {\r
- return commandTimeout;\r
- }\r
- set \r
- {\r
- commandTimeout = value;\r
- }\r
- }\r
- #endregion\r
- #region CommandType property\r
- ///\r
- /// I believe this one is left as text all of the time for DB2, but I have to check that...\r
- /// \r
- public CommandType CommandType\r
- {\r
- get\r
- {\r
- return CommandType.Text;\r
- }\r
- set\r
- {\r
- ///Do nothing\r
- }\r
- }\r
- #endregion\r
- #region Connection property\r
- ///\r
- /// The connection we'll be executing on.\r
- /// \r
- public IDbConnection Connection\r
- {\r
- get\r
- {\r
- return db2Conn;\r
- }\r
- set\r
- {\r
- db2Conn = (DB2ClientConnection)value;\r
- }\r
- }\r
- #endregion\r
- #region Parameters property\r
- ///\r
- /// Parameter list, Not yet implemented\r
- /// \r
- public DB2ClientParameterCollection Parameters\r
- {\r
- get\r
- {\r
- return parameters;\r
- }\r
- }\r
- IDataParameterCollection IDbCommand.Parameters\r
- {\r
- get\r
- {\r
- return parameters;\r
- }\r
- }\r
- #endregion\r
-\r
- #region Transaction property\r
- ///\r
- /// The transaction this command is associated with\r
- /// \r
- public IDbTransaction Transaction\r
- {\r
- get\r
- {\r
- return db2Trans;\r
- }\r
- set\r
- {\r
- db2Trans = (DB2ClientTransaction)value;\r
- }\r
- }\r
- #endregion\r
- #region UpdatedRowSource property\r
- ///\r
- /// Need to see how this works with DB2...\r
- /// \r
- public UpdateRowSource UpdatedRowSource\r
- {\r
- get\r
- {\r
- throw new DB2ClientException ("TBD");\r
- }\r
- set\r
- {\r
- throw new DB2ClientException ("TBD");\r
- }\r
- }\r
- #endregion\r
- #region Statement Handle\r
- ///\r
- /// returns the DB2Client statement handle\r
- /// \r
- public IntPtr statementHandle\r
- {\r
- get\r
- {\r
- return hwndStmt;\r
- }\r
- }\r
- #endregion\r
- #region AllocateStatement function\r
- ///\r
- /// Allocate a statement handle, internal. Pass in the name of the caller for exception info.\r
- /// I think I'll make the handle a property and add a constructor with the handle argument so that \r
- /// statements can be executed on the same handle if need be, though you could accomplish the same by \r
- /// just keeping the command object open. \r
- /// \r
- internal void AllocateStatement(string location)\r
- {\r
- short sqlRet;\r
- sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_STMT, db2Conn.DBHandle, ref hwndStmt);\r
- if (sqlRet == DB2ClientConstants.SQL_ERROR)\r
- throw new DB2ClientException(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, location +": Unable to allocate statement handle.");\r
- }\r
- #endregion\r
- #region Cancel\r
- /// <summary>\r
- /// Attempt to cancel an executing command\r
- /// </summary>\r
- public void Cancel()\r
- {\r
- DB2ClientPrototypes.SQLCancel(hwndStmt);\r
- }\r
- #endregion\r
- #region CreateParameter\r
- ///\r
- ///Returns a parameter\r
- ///\r
- public IDbDataParameter CreateParameter()\r
- {\r
- throw new DB2ClientException("TBD");\r
- }\r
- #endregion\r
- #region ExecuteNonQuery\r
- ///\r
- /// ExecuteNonQuery Executes an SQL statement without returning a DataSet\r
- /// \r
- public int ExecuteNonQuery()\r
- {\r
- short sqlRet;\r
- if (prepared)\r
- sqlRet = DB2ClientPrototypes.SQLExecute(hwndStmt);\r
- else\r
- sqlRet = DB2ClientPrototypes.SQLExecDirect(hwndStmt, commandText, commandText.Length);\r
- \r
- int numRows = 0;\r
- sqlRet = DB2ClientPrototypes.SQLRowCount(hwndStmt, ref numRows); //How many rows affected. numRows will be -1 if we aren't dealing with an Insert, Delete or Update, or if the statement did not execute successfully\r
- ///At this point, I think we need to save any results, but not return them\r
- ///For now, we will go execute and return the number of rows affected\r
- return numRows;\r
- }\r
- #endregion\r
- #region ExecuteReader calls\r
- ///\r
- ///ExecuteReader\r
- ///\r
- public IDataReader ExecuteReader()\r
- {\r
- DB2ClientDataReader reader;\r
-\r
- if (!prepared) \r
- {\r
- ExecuteNonQuery();\r
- reader = new DB2ClientDataReader(db2Conn, this);\r
- }\r
- else\r
- reader = new DB2ClientDataReader(db2Conn, this, true);\r
-\r
- return reader;\r
-\r
- }\r
- public IDataReader ExecuteReader(CommandBehavior behavior)\r
- {\r
- throw new DB2ClientException("TBD");\r
- }\r
- #endregion\r
- #region ExecuteScalar\r
- ///\r
- /// ExecuteScalar\r
- /// \r
- public object ExecuteScalar()\r
- {\r
- throw new DB2ClientException("TBD");\r
- }\r
- #endregion\r
-\r
- #region Prepare ()\r
- ///\r
- /// Prepare a statement against the database\r
- /// \r
- public void Prepare ()\r
- {\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- short sqlRet = 0;\r
-\r
- IntPtr numParams = IntPtr.Zero;\r
- sqlRet = DB2ClientPrototypes.SQLPrepare(hwndStmt, commandText, commandText.Length);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "SQLPrepare error.");\r
- short i=1;\r
- foreach ( DB2ClientParameter param in parameters) \r
- {\r
- if (selfDescribe) \r
- {\r
- sqlRet = param.Describe(this.hwndStmt, i);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");\r
- }\r
- sqlRet = param.Bind(this.hwndStmt, i);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "Error binding parameter in DB2ClientCommand: ");\r
- i++;\r
- }\r
- prepared=true;\r
- }\r
- #endregion\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// \r
- /// Authors:\r
- /// Christopher Bockner\r
- /// \r
- /// Copyright 2003 By Christopher Bockner\r
- /// \r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Data;\r
-using System.Runtime.InteropServices;\r
-using System.Text;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary> /// This class is IDbConnection compliant. Refer to MSDN documentation for reference.\r
- /// </summary>\r
- /// \r
- \r
- public class DB2ClientConnection : IDbConnection\r
- {\r
- private string connectionString = null;\r
- private StringBuilder outConnectStr;\r
- private string dbName = null;\r
- private int connectionTimeout;\r
-\r
- private IntPtr dbHandle = IntPtr.Zero;\r
- private bool disposed = false;\r
- public DB2ClientConnection()\r
- {\r
- //\r
- // TODO: Add constructor logic here\r
- //\r
- }\r
- public DB2ClientConnection(string conString)\r
- {\r
- SetConnectionString(conString);\r
- }\r
- #region ConnectionString property\r
- /// \r
- ///Accessor for the connectionString property\r
- public string ConnectionString \r
- {\r
- get\r
- {\r
- return connectionString;\r
- }\r
- set\r
- {\r
- SetConnectionString(value);\r
- }\r
- }\r
- #endregion\r
- #region ConnectionTimeout property\r
- public int ConnectionTimeout\r
- {\r
- get\r
- {\r
- return connectionTimeout;\r
- }\r
- set\r
- {\r
- connectionTimeout = value;\r
- }\r
- }\r
- #endregion\r
- #region Database property\r
- public string Database\r
- {\r
- get\r
- {\r
- return dbName;\r
- }\r
- set\r
- {\r
- dbName = value;\r
- }\r
- }\r
- #endregion\r
- #region State property\r
- /// <summary>\r
- /// The Connection State property, open or closed. \r
- /// NOTE: IBM's docs on SqlFreeHandle do not state what is done when a handle is freed\r
- /// i.e. if the handle is set to SQL_NULL_HANDLE.\r
- /// </summary>\r
-\r
- unsafe public ConnectionState State\r
- {\r
- get\r
- { \r
- if ((long)dbHandle.ToPointer() == DB2ClientConstants.SQL_NULL_HANDLE)\r
- return ConnectionState.Closed;\r
- else\r
- return ConnectionState.Open;\r
- }\r
- }\r
- #endregion\r
- #region DBHandle\r
- ///\r
- /// Handle Returns an IntPtr of the dbm handle\r
- /// \r
- public IntPtr DBHandle\r
- {\r
- get\r
- {\r
- return dbHandle;\r
- }\r
- }\r
- #endregion\r
-\r
- #region BeginTransaction Method\r
- /// <summary>\r
- /// Opens a transaction against the database at the default isolation level, which will be \r
- /// that which the packages were bound at, unless overriden in the connection string, and if nothing was specified at that point\r
- /// then I believe the default level is Cursor Stability (don't quote me on that, I haven't\r
- /// found the appropriate reference yet), ODBC equivalent is SQL_TXN_READ_COMMITTED\r
- /// </summary>\r
- /// <returns></returns>\r
- public IDbTransaction BeginTransaction()\r
- {\r
- return null;\r
- }\r
- #endregion\r
- #region BeginTransaction (IsolationLevel) Method\r
- /// <summary>\r
- /// BeginTransaction again overloadded to let us set the transaction level for the statement\r
- /// </summary>\r
- /// <param name="isolationL"></param>\r
- /// <returns></returns>\r
- public IDbTransaction BeginTransaction(IsolationLevel isolationL)\r
- {\r
- return null;\r
- }\r
- #endregion\r
- #region ChangeDatabase\r
- unsafe public void ChangeDatabase(string newDBName)\r
- {\r
- }\r
- #endregion\r
- #region Close\r
- ///Close, per MSDN documentation\r
- ///\r
- unsafe public void Close()\r
- {\r
- short sqlRet = 0;\r
-// DB2ClientUtils util = new DB2ClientUtils();\r
-\r
- sqlRet = DB2ClientPrototypes.SQLDisconnect(dbHandle);\r
-// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, dbHandle, "Error in Connection->Close: ");\r
- dbHandle = new IntPtr(DB2ClientConstants.SQL_NULL_HANDLE);\r
- }\r
- #endregion\r
- #region CreateCommand\r
- /// <summary>\r
- /// CreateCommand per MSDN\r
- /// </summary>\r
- /// <returns></returns>\r
- public IDbCommand CreateCommand()\r
- {\r
- CheckState();\r
- return new DB2ClientCommand();\r
- }\r
- #endregion\r
- #region Open\r
- /// <summary>\r
- /// Open, per MSDN\r
- /// </summary>\r
- unsafe public void Open()\r
- {\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- outConnectStr = new StringBuilder(60); //Set some initial size, we know we're gettig a chunk of data back\r
- IntPtr penvHandle=IntPtr.Zero;\r
- IntPtr numOutCharsReturned = IntPtr.Zero;\r
- short sqlRet=0;\r
-\r
- try\r
- {\r
- sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_ENV, IntPtr.Zero, ref penvHandle);\r
- util.DB2CheckReturn(sqlRet, 0, IntPtr.Zero, "Unable to allocate Environment handle in DB2ClientConnection.");\r
-\r
- sqlRet = DB2ClientPrototypes.SQLAllocHandle(DB2ClientConstants.SQL_HANDLE_DBC, penvHandle, ref dbHandle);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_ENV, penvHandle, "Unable to allocate database handle in DB2ClientConnection.");\r
-\r
- sqlRet = DB2ClientPrototypes.SQLDriverConnect(dbHandle, 0, connectionString,\r
- connectionString.Length, outConnectStr, 100, numOutCharsReturned, \r
- DB2ClientConstants.SQL_DRIVER_COMPLETE);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_ENV, penvHandle, "Unable to connect to the database.");\r
-\r
- }\r
- catch (DB2ClientException DB2E)\r
- {\r
- Console.WriteLine(DB2E.Message);\r
- Dispose();\r
- throw DB2E;\r
- }\r
- }\r
- #endregion\r
- #region Dispose\r
- /// <summary>\r
- /// Dispose\r
- /// </summary>\r
- unsafe public void Dispose()\r
- {\r
- if(!disposed) \r
- {\r
- this.Close();\r
- disposed = true;\r
- } else \r
- return;\r
- }\r
-\r
- #endregion\r
-\r
- private void CheckState()\r
- {\r
- if (ConnectionState.Closed == State)\r
- throw new DB2ClientException ("Connection is currently closed.");\r
- }\r
-\r
- void SetConnectionString (string connectionString)
- {
- this.connectionString = connectionString;
- }\r
- }\r
-}\r
-\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Summary description for DB2Constants.\r
- /// </summary>\r
- public class DB2ClientConstants\r
- {\r
- public DB2ClientConstants()\r
- {\r
- //\r
- // TODO: Add constructor logic here\r
- //\r
-\r
- }\r
- public const short SQL_HANDLE_ENV = 1;\r
- public const short SQL_HANDLE_DBC = 2;\r
- public const short SQL_HANDLE_STMT = 3;\r
- public const short SQL_HANDLE_DESC = 4;\r
-\r
- /* RETCODE values */\r
- public const long SQL_SUCCESS = 0;\r
- public const long SQL_SUCCESS_WITH_INFO = 1;\r
- public const long SQL_NEED_DATA = 99;\r
- public const long SQL_NO_DATA = 100;\r
- public const long SQL_STILL_EXECUTING = 2;\r
- public const long SQL_ERROR = -1;\r
- public const long SQL_INVALID_HANDLE = -2;\r
- public const int SQL_NTS = -3;\r
- public const long SQL_NULL_HANDLE = 0L;\r
- public const short SQL_COMMIT = 0;\r
- public const short SQL_ROLLBACK = 1;\r
- public const short SQL_NO_DATA_FOUND = 100;\r
-\r
- /* Isolation levels */\r
- public const long SQL_TXN_READ_UNCOMMITTED = 0x00000001L;\r
- public const long SQL_TXN_READ_COMMITTED = 0x00000002L;\r
- public const long SQL_TXN_REPEATABLE_READ = 0x00000004L;\r
- public const long SQL_TXN_SERIALIZABLE_READ = 0x00000008L;\r
- public const long SQL_TXN_NOCOMMIT = 0x00000020L;\r
-\r
- /* Connect options */\r
- public const long SQL_TXN_ISOLATION = 108;\r
- public const long SQL_AUTOCOMMIT = 102;\r
-\r
- public const long SQL_AUTOCOMMIT_OFF = 0L;\r
- public const long SQL_AUTOCOMMIT_ON = 1L;\r
-\r
- /* Data Types */\r
- public const int SQL_UNKNOWN_TYPE = 0;\r
- public const int SQL_CHAR = 1;\r
- public const int SQL_NUMERIC = 2;\r
- public const int SQL_DECIMAL = 3;\r
- public const int SQL_INTEGER = 4;\r
- public const int SQL_SMALLINT = 5;\r
- public const int SQL_FLOAT = 6;\r
- public const int SQL_REAL = 7;\r
- public const int SQL_DOUBLE = 8;\r
- public const int SQL_DATETIME = 9;\r
- public const int SQL_VARCHAR = 12;\r
- public const int SQL_WCHAR = (-8);\r
- public const int SQL_WVARCHAR = (-9);\r
- public const int SQL_WLONGVARCHAR = (-10);\r
- public const int SQL_TYPE_DATE = 91;\r
- public const int SQL_TYPE_TIME = 92;\r
- public const int SQL_TYPE_TIMESTAMP = 93;\r
-\r
- public const int SQL_C_CHAR = SQL_CHAR;\r
- public const int SQL_C_DEFAULT = 99;\r
-\r
- public const int SQL_BLOB_LOCATOR = 31;\r
- public const int SQL_CLOB_LOCATOR = 41;\r
- public const int SQL_DBCLOB_LOCATOR = -351;\r
-\r
- public const int SQL_C_BLOB_LOCATOR = SQL_BLOB_LOCATOR;\r
- public const int SQL_C_CLOB_LOCATOR = SQL_CLOB_LOCATOR;\r
- public const int SQL_C_DBCLOB_LOCATOR = SQL_DBCLOB_LOCATOR;\r
-\r
- public const int SQL_USER_DEFINED_TYPE = (-450);\r
-\r
- /* SQLDriverConnect Options */\r
- public const int SQL_DRIVER_NOPROMPT = 0;\r
- public const int SQL_DRIVER_COMPLETE = 1;\r
- public const int SQL_DRIVER_PROMPT = 2;\r
- public const int SQL_DRIVER_COMPLETE_REQUIRED = 3;\r
-\r
- /* Null settings */\r
- public const int SQL_NO_NULLS = 0;\r
- public const int SQL_NULLABLE = 1;\r
- public const int SQL_NULLABLE_UNKNOWN = 2;\r
-\r
- /* Defines for SQLBindParameter and SQLProcedureColumns */\r
- public const int SQL_PARAM_TYPE_UNKNOWN = 0;\r
- public const int SQL_PARAM_INPUT = 1;\r
- public const int SQL_PARAM_INPUT_OUTPUT = 2;\r
- public const int SQL_RESULT_COL = 3;\r
- public const int SQL_PARAM_OUTPUT = 4;\r
- public const int SQL_RETURN_VALUE = 5;\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-using System.Runtime.InteropServices;\r
-using System.Globalization;\r
-using System.Text;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Summary description for DB2ClientDataReader.\r
- /// DB2ClientDataReader. \r
- /// </summary>\r
- public class DB2ClientDataReader : IDataReader\r
- {\r
- internal DataTable rs; //Our result set is a datatable\r
- internal DB2ClientConnection db2Conn; //The connection we're working with\r
- internal IntPtr hwndStmt; //The statement handle returning the results\r
- private int row=-1; //Row pointer\r
- private int numCols=0;\r
- \r
- #region Constructors and destructors\r
- /// <summary>\r
- /// \r
- /// </summary>\r
- /// <param name="con"></Connection object to DB2>\r
- /// <param name="com"></Command object>\r
- internal DB2ClientDataReader(DB2ClientConnection con, DB2ClientCommand com)\r
- {\r
- db2Conn = con;\r
- hwndStmt = com.statementHandle; //We have access to the results through the statement handle\r
-\r
- short sqlRet;\r
-\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- rs = new DataTable();\r
- \r
- sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");\r
-\r
- byte[][] dbVals = new byte[(int)numCols][];\r
- IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];\r
-\r
- PrepareResults(dbVals, sqlLen_or_IndPtr);\r
- FetchResults(dbVals, sqlLen_or_IndPtr, rs);\r
- isClosed = false;\r
- }\r
- /// <summary>\r
- /// Constructor for use with prepared statements\r
- /// </summary>\r
- /// \r
- internal DB2ClientDataReader(DB2ClientConnection con, DB2ClientCommand com, bool prepared)\r
- {\r
- db2Conn = con;\r
- hwndStmt = com.statementHandle; //We have access to the results through the statement handle\r
-\r
- short sqlRet;\r
-\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- rs = new DataTable();\r
- \r
- sqlRet = DB2ClientPrototypes.SQLNumResultCols(hwndStmt, ref numCols);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols");\r
-\r
- byte[][] dbVals = new byte[(int)numCols][];\r
- IntPtr[] sqlLen_or_IndPtr = new IntPtr[numCols];\r
-\r
-\r
- PrepareResults(dbVals, sqlLen_or_IndPtr);\r
- FetchResults(dbVals, sqlLen_or_IndPtr, rs);\r
- isClosed = false;\r
- }\r
-\r
- public void Dispose()\r
- {\r
- Close();\r
- }\r
- #endregion\r
- #region Properties\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
- return depth;\r
- }\r
- }\r
- #endregion\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
- #region RecordsAffected property\r
- ///\r
- /// Number of records affected by this operation. Will be zero until we close the \r
- /// reader\r
- /// \r
- private int recordsAffected = 0;\r
- public int RecordsAffected\r
- {\r
- get\r
- {\r
- return recordsAffected;\r
- }\r
- }\r
- #endregion\r
- #endregion\r
- #region Methods\r
- #region Close method\r
- ///\r
- ///\r
- public void Close()\r
- {\r
- if (rs != null) \r
- {\r
- recordsAffected = rs.Rows.Count;\r
- rs.Dispose();\r
- rs = null;\r
- isClosed=true;\r
- }\r
- }\r
- #endregion\r
- #region GetSchemaTable \r
- ///\r
- /// We'll return an empty table for now...ughh this one will be tedious to write\r
- /// \r
- public DataTable GetSchemaTable()\r
- {\r
- throw new DB2ClientException ("TBD");\r
- }\r
- #endregion\r
- #region NextResult \r
- ///\r
- /// Ummm is this related to SQLBulkOperations stuff..?\r
- /// \r
- public bool NextResult()\r
- {\r
- throw new DB2ClientException("To be done");\r
-\r
- //Deferring the meat of this until the batch stuff is implemented\r
- }\r
- #endregion\r
- #region Read\r
- ///\r
- /// Apparently, this function does nothing other than tell you if you can move to the \r
- /// next row in the resultset. I have to move the fetching stuff elswhere...\r
- /// \r
- public bool Read()\r
- {\r
- if (isClosed) return false;\r
- row++;\r
- //do something with the fetched data now...\r
- if(row < rs.Rows.Count)\r
- return true;\r
- else\r
- return false;\r
- \r
- }\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
- private void PrepareResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr)\r
- {\r
- short sqlRet;\r
- StringBuilder colName = new StringBuilder(18);\r
- short colNameMaxLength=18;\r
- IntPtr colNameLength=IntPtr.Zero;\r
- IntPtr sqlDataType=IntPtr.Zero;\r
- IntPtr colSize=IntPtr.Zero;\r
- IntPtr scale=IntPtr.Zero;\r
- IntPtr nullable=IntPtr.Zero;\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- for (ushort i=1; i<=numCols; i++) \r
- {\r
- sqlRet = DB2ClientPrototypes.SQLDescribeCol(hwndStmt, i, colName, colNameMaxLength, colNameLength, ref sqlDataType, ref colSize, ref scale, ref nullable);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLDescribeCol");\r
- ///At this point I have the data type information as well, but for now I will insert the data as\r
- ///Ansi strings and see how it goes. Maybe we can speed things up later...\r
- ///\r
- rs.Columns.Add(colName.ToString());\r
-\r
- sqlLen_or_IndPtr[i-1] = new IntPtr();\r
- dbVals[i-1] = new byte[(int)colSize];\r
-\r
-\r
- try \r
- {\r
- switch ((int)sqlDataType) \r
- {\r
- case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes\r
- case DB2ClientConstants.SQL_TYPE_DATE:\r
- case DB2ClientConstants.SQL_TYPE_TIME:\r
- case DB2ClientConstants.SQL_TYPE_TIMESTAMP:\r
- case DB2ClientConstants.SQL_VARCHAR:\r
- sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, DB2ClientConstants.SQL_C_CHAR, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);\r
- break;\r
- default:\r
- sqlRet = DB2ClientPrototypes.SQLBindCol(hwndStmt, i, (short)sqlDataType, dbVals[i-1],(short)colSize+1, (int)sqlLen_or_IndPtr[i-1]);\r
- break;\r
- }\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLBindCol");\r
- }\r
- catch(DB2ClientException e) \r
- {\r
- System.Console.Write(e.Message);\r
- }\r
- }\r
- isClosed = false;\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="rs"></param>\r
- private void FetchResults(byte[][] dbVals, IntPtr[] sqlLen_or_IndPtr, DataTable rs) \r
- {\r
- short sqlRet = 0;\r
- DB2ClientUtils util = new DB2ClientUtils();\r
-\r
- sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 1");\r
-\r
- while(sqlRet != DB2ClientConstants.SQL_NO_DATA_FOUND)\r
- {\r
- DataRow newRow = rs.NewRow();\r
- for (short y=1;y<=numCols;y++) \r
- newRow[y-1] = System.Text.Encoding.Default.GetString(dbVals[y-1]);\r
-\r
- rs.Rows.Add(newRow);\r
- sqlRet = DB2ClientPrototypes.SQLFetch(hwndStmt);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLFetch 2");\r
- } \r
- }\r
- #endregion\r
-\r
- #region IDataRecord Interface\r
- ///Code for the IDataRecord interface\r
- ///\r
- #region FieldCount\r
- ///\r
- ///\r
- private int fieldCount = -1;\r
- public int FieldCount\r
- {\r
- get\r
- {\r
- if (IsClosed)\r
- fieldCount = 0;\r
- else\r
- fieldCount = rs.Columns.Count;\r
- return fieldCount;\r
- }\r
- }\r
- #endregion\r
- #region Item accessors\r
- public object this[string name]\r
- {\r
- get\r
- {\r
- return rs.Rows[row][name];\r
- }\r
- }\r
- public object this[int col]\r
- {\r
- get\r
- {\r
- return rs.Rows[row][col];\r
- }\r
- }\r
- #endregion\r
- #region GetBoolean method\r
- ///\r
- ///Use the Convert class for all of these returns\r
- ///\r
- public bool GetBoolean(int col)\r
- {\r
- return Convert.ToBoolean(this[col]);\r
- }\r
- #endregion\r
- #region GetByte\r
- ///\r
- ///GetByte\r
- ///\r
- public byte GetByte(int col)\r
- {\r
- return Convert.ToByte(this[col]);\r
- }\r
- #endregion\r
- #region GetBytes\r
- ///\r
- /// GetBytes, return a stream of bytes\r
- ///\r
- public long GetBytes(int col, long fieldOffset, byte[] buffer, int bufferOffset, int length)\r
- {\r
- //Hmm... How shall we deal with this one? \r
- return 0;\r
- }\r
- #endregion\r
- #region GetChar\r
- ///\r
- ///GetChar, return column as a char\r
- ///\r
- public char GetChar(int col)\r
- {\r
- return Convert.ToChar(this[col]);\r
- }\r
- #endregion\r
- #region GetChars\r
- ///\r
- ///GetChars, returns char array\r
- ///\r
- public long GetChars(int col, long fieldOffset, char[] buffer, int bufferOffset, int length)\r
- {\r
- //Again, not sure how I'll deal with this just yet\r
- return 0;\r
- }\r
- #endregion\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 DB2ClientException("Not yet supported.");\r
- }\r
- #endregion\r
- #region GetDataTypeName\r
- ///\r
- ///GetDataTypeName return the type of data\r
- ///\r
- public string GetDataTypeName(int col)\r
- {\r
- //I could check the meta data as a starting point for this one, but until I implement \r
- //returning the result sets, I'm not exactly sure what info I'll have, so this function\r
- //waits until then...\r
- throw new DB2ClientException("Not yet implemented");\r
- }\r
- #endregion\r
- #region GetDateTime\r
- ///\r
- /// GetDateTime method\r
- /// \r
- public string NewGetDateTime(int col)\r
- {\r
- return Convert.ToString(this[col]);\r
- }\r
- public DateTime GetDateTime(int col)\r
- {\r
- return Convert.ToDateTime(this[col]);\r
- }\r
- #endregion\r
- #region GetDecimal\r
- ///\r
- ///GetDecimal method\r
- ///\r
- public decimal GetDecimal(int col)\r
- {\r
- return Convert.ToDecimal(this[col]);\r
- }\r
- #endregion\r
- #region GetDouble \r
- ///\r
- /// GetDouble \r
- /// \r
- public double GetDouble(int col)\r
- {\r
- return Convert.ToDouble(this[col]);\r
- }\r
- #endregion\r
- #region GetFieldType\r
- ///\r
- /// Type GetFieldType\r
- ///\r
- public Type GetFieldType(int col)\r
- {\r
- //Again need more research here\r
- return typeof(int);\r
- }\r
- #endregion\r
- #region GetFloat\r
- ///\r
- /// GetFloat\r
- /// \r
- public float GetFloat(int col)\r
- {\r
- return (float) Convert.ToDouble(this[col].ToString(),new CultureInfo("en-US").NumberFormat);\r
- }\r
- #endregion\r
- #region GetGuid\r
- ///\r
- /// GetGuid\r
- /// \r
- public Guid GetGuid(int col)\r
- {\r
- // a Guid is a 128 bit unique value. Could be like a GENERATE UNIQUE in DB2\r
- // as usual, need more research\r
- throw new DB2ClientException("TBD");\r
- }\r
- #endregion\r
- #region The GetInt?? series\r
- ///\r
- ///GetInt16\r
- ///\r
- public short GetInt16(int col)\r
- {\r
- return Convert.ToInt16(this[col]);\r
- }\r
- ///\r
- ///GetInt32\r
- ///\r
- public int GetInt32(int col)\r
- {\r
- return Convert.ToInt32(this[col]);\r
- }\r
- ///\r
- ///GetInt64\r
- ///\r
- public long GetInt64(int col)\r
- {\r
- return Convert.ToInt64(this[col]);\r
- }\r
- #endregion\r
- #region GetName\r
- ///\r
- ///GetName, returns the name of the field\r
- ///\r
- public string GetName(int col)\r
- {\r
- return (rs.Columns[col].ColumnName);\r
- }\r
- #endregion\r
- #region GetOrdinal\r
- ///\r
- /// GetOrdinal, return the index of the named column\r
- /// \r
- public int GetOrdinal(string name)\r
- {\r
- return rs.Columns[name].Ordinal;\r
- }\r
- #endregion\r
- #region GetString\r
- ///\r
- /// GetString returns a string\r
- /// \r
- public string GetString(int col)\r
- {\r
- return Convert.ToString(this[col]);\r
- }\r
- #endregion\r
-\r
- #region GetLobLocator\r
- ///\r
- ///Returns a LOB Locator class\r
- ///\r
- //DB2ClientLOBLocator GetLobLocator(int col)\r
- //{\r
-\r
- #endregion\r
-\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
- #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 numCols = FieldCount;\r
- if (values.Length<numCols)\r
- throw new DB2ClientException("GetValues argument too small for number of columns in row.");\r
- for (int i = 0; i<=numCols; i++)\r
- values[i] = this[i];\r
- return numCols;\r
- }\r
- #endregion\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 false;\r
- }\r
- #endregion\r
-\r
- #endregion ///For IDataRecord\r
- }\r
-\r
-}\r
-#endregion
\ No newline at end of file
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using System.Text;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Exception class. We will throw our own exception in the case of SQL_ERROR returns\r
- /// and call SQLGetDiagRec to get the error info.\r
- /// </summary>\r
- public class DB2ClientException : Exception\r
- {\r
- internal string message;\r
- public DB2ClientException(string Message)\r
- { \r
- this.message = Message;\r
- }\r
- public DB2ClientException(short sqlHandleType, IntPtr sqlHandle, string Message)\r
- { \r
- StringBuilder sqlState = new StringBuilder(50);\r
- StringBuilder errorMessage = new StringBuilder(1025);\r
-\r
- int sqlReturn;\r
- short recNum=1;\r
- short bufLength = 1025;\r
-\r
- IntPtr textLengthPtr = IntPtr.Zero;\r
- IntPtr nativeErrorPtr = IntPtr.Zero;\r
-\r
- sqlReturn = DB2ClientPrototypes.SQLGetDiagRec(sqlHandleType, sqlHandle, recNum, sqlState, ref nativeErrorPtr, errorMessage, bufLength, ref textLengthPtr);\r
- this.message = Message + "\n" + sqlState.ToString() + " " + errorMessage.ToString()+"\n";\r
- //See if there are more errors to retrieve and get them.\r
- while (sqlReturn != DB2ClientConstants.SQL_NO_DATA && sqlReturn > 0)\r
- {\r
- recNum++;\r
- sqlReturn = DB2ClientPrototypes.SQLGetDiagRec(sqlHandleType, sqlHandle, recNum, sqlState, ref nativeErrorPtr, errorMessage, bufLength, ref textLengthPtr);\r
- this.message += "\n" + sqlState.ToString() + " " + errorMessage.ToString()+"\n";\r
- }\r
-\r
- }\r
- public override string Message\r
- {\r
- get\r
- {\r
- return this.message;\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-\r
-namespace DB2DriverCS\r
-{\r
- /// <summary>\r
- /// Summary description for DB2ClientLOB.\r
- /// Base class for LOB support. Other LOB classes inherit from this. My support at first will be limited to \r
- /// handling LOB locators, but we'll see where we go...\r
- /// </summary>\r
- public class DB2ClientLOB\r
- {\r
- internal IntPtr hwndStmt;\r
-\r
- public DB2ClientLOB()\r
- {\r
- //\r
- // TODO: Add constructor logic here\r
- //\r
- }\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Parameter object for DB2 client\r
- /// </summary>\r
- public sealed class DB2ClientParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable\r
- {\r
- private DbType dbType;\r
- private IntPtr db2DataType;\r
- private ParameterDirection direction;\r
- private bool nullable;\r
- private string parameterName;\r
- private string sourceColumn;\r
- private IntPtr paramSize;\r
- private IntPtr decimalDigits;\r
- private DataRowVersion sourceVersion;\r
- object dataVal;\r
- byte[] bDataVal;\r
- private int iDataVal;\r
- private byte scale, precision;\r
- private int size;\r
- bool selfDescribe = false;\r
-\r
- #region Contructors and destructors\r
- public DB2ClientParameter()\r
- {\r
- }\r
- public DB2ClientParameter (string name)\r
- {\r
- parameterName = name;\r
- }\r
-\r
- public DB2ClientParameter(string name, DbType type)\r
- {\r
- parameterName = name;\r
- dbType = type;\r
- }\r
- public DB2ClientParameter(string name, object data)\r
- {\r
- parameterName = name;\r
- this.Value = data;\r
- }\r
- public DB2ClientParameter(string name, DbType type, string columnName)\r
- {\r
- parameterName = name;\r
- dbType = type;\r
- sourceColumn = columnName;\r
- }\r
- public DB2ClientParameter(string name, int db2Type)\r
- {\r
- parameterName = name;\r
- dbType = inferTypeFromDB2Type(db2Type);\r
- db2DataType = new IntPtr(db2Type);\r
- }\r
- #endregion\r
- #region Properties\r
- #region DbType Property\r
- ///\r
- /// Parameter data type\r
- /// \r
- public DbType DbType\r
- {\r
- get \r
- {\r
- return dbType;\r
- }\r
- set \r
- {\r
- dbType = value;\r
- }\r
- }\r
- #endregion\r
- #region Direction\r
- ///\r
- /// In or out parameter, or both\r
- /// \r
- public ParameterDirection Direction\r
- {\r
- get \r
- {\r
- return direction;\r
- }\r
- set \r
- {\r
- direction = value;\r
- }\r
- }\r
- #endregion\r
- #region IsNullable\r
- ///\r
- /// Does this parameter support a null value\r
- /// \r
- public bool IsNullable \r
- {\r
- get \r
- {\r
- return nullable;\r
- }\r
- set \r
- {\r
- nullable = value;\r
- }\r
- }\r
- #endregion\r
- #region ParameterName\r
- public string ParameterName\r
- {\r
- get \r
- {\r
- return parameterName;\r
- }\r
- set \r
- {\r
- parameterName = value;\r
- }\r
- }\r
- #endregion\r
- #region SourceColumn\r
- ///\r
- /// Gets or sets the name of the source column that is mapped to the DataSet\r
- /// \r
- public string SourceColumn\r
- {\r
- get \r
- {\r
- return sourceColumn;\r
- }\r
- set \r
- {\r
- sourceColumn = value;\r
- }\r
- }\r
- #endregion\r
- #region SourceVersion\r
- ///\r
- /// DataRowVersion property\r
- /// \r
- public DataRowVersion SourceVersion \r
- {\r
- get \r
- {\r
- return sourceVersion;\r
- }\r
- set \r
- {\r
- sourceVersion = value;\r
- }\r
- }\r
- #endregion\r
- #region IDbDataParameter properties\r
- public byte Precision \r
- {\r
- get \r
- { \r
- return precision; \r
- }\r
- set \r
- { \r
- precision = value; \r
- }\r
- }\r
- \r
- public byte Scale \r
- {\r
- get \r
- { \r
- return scale; \r
- }\r
- set \r
- { \r
- scale = value; \r
- }\r
- }\r
- \r
- public int Size \r
- {\r
- get \r
- { \r
- return size;\r
- }\r
- set \r
- { \r
- size = value;\r
- }\r
- }\r
- #endregion\r
- #region Value\r
- ///\r
- /// The actual parameter data\r
- /// \r
- public object Value \r
- {\r
- get\r
- {\r
- return dataVal;\r
- }\r
- set \r
- {\r
- this.dataVal = value;\r
- DbType = inferType(dataVal);\r
- // Load buffer with new value\r
- if (dbType==DbType.Int32)\r
- iDataVal=(int) value;\r
- else\r
- {\r
- // Treat everything else as a string\r
- // Init string buffer\r
- if (bDataVal==null || bDataVal.Length< (((int)paramSize>20)?(int)paramSize:20) )\r
- bDataVal=new byte[((int)paramSize>20)?(int)paramSize:20];\r
- else\r
- bDataVal.Initialize();\r
- // Convert value into string and store into buffer\r
- byte[] strValueBuffer=System.Text.Encoding.ASCII.GetBytes(dataVal.ToString());\r
- strValueBuffer.CopyTo(bDataVal,0);\r
- }\r
- }\r
- }\r
- #endregion\r
- #endregion\r
- #region inferType Method\r
- /// <summary>\r
- /// Determine the data type based on the value\r
- /// </summary>\r
- private DbType inferType (object Data)\r
- {\r
- switch (Type.GetTypeCode(Data.GetType()))\r
- {\r
- case TypeCode.Empty:\r
- throw new SystemException("Invalid data type");\r
-\r
- case TypeCode.Object:\r
- return DbType.Object;\r
-\r
- case TypeCode.DBNull:\r
- case TypeCode.Char:\r
- case TypeCode.SByte:\r
- case TypeCode.UInt16:\r
- case TypeCode.UInt32:\r
- case TypeCode.UInt64:\r
- // Throw a SystemException for unsupported data types.\r
- throw new SystemException("Invalid data type");\r
-\r
- case TypeCode.Boolean:\r
- return DbType.Boolean;\r
-\r
- case TypeCode.Byte:\r
- return DbType.Byte;\r
-\r
- case TypeCode.Int16:\r
- return DbType.Int16;\r
-\r
- case TypeCode.Int32:\r
- return DbType.Int32;\r
-\r
- case TypeCode.Int64:\r
- return DbType.Int64;\r
-\r
- case TypeCode.Single:\r
- return DbType.Single;\r
-\r
- case TypeCode.Double:\r
- return DbType.Double;\r
-\r
- case TypeCode.Decimal:\r
- return DbType.Decimal;\r
-\r
- case TypeCode.DateTime:\r
- return DbType.DateTime;\r
-\r
- case TypeCode.String:\r
- return DbType.String;\r
-\r
- default:\r
- throw new SystemException("Value is of unknown data type");\r
- }\r
- }\r
- #endregion\r
- #region inferTypeFromDB2Type\r
- ///\r
- /// Determine the DbType from the SQL type returned by SQLDescribeParam\r
- /// \r
- private DbType inferTypeFromDB2Type(int db2Type)\r
- {\r
- switch (db2Type) \r
- {\r
- case DB2ClientConstants.SQL_CHAR:\r
- return DbType.AnsiString;\r
- case DB2ClientConstants.SQL_NUMERIC:\r
- case DB2ClientConstants.SQL_DECIMAL:\r
- return DbType.Decimal;\r
- case DB2ClientConstants.SQL_DATETIME:\r
- return DbType.DateTime;\r
- case DB2ClientConstants.SQL_FLOAT:\r
- case DB2ClientConstants.SQL_DOUBLE:\r
- return DbType.Double;\r
- case DB2ClientConstants.SQL_INTEGER:\r
- return DbType.Int32;\r
- case DB2ClientConstants.SQL_SMALLINT:\r
- return DbType.Int16;\r
- case DB2ClientConstants.SQL_VARCHAR:\r
- return DbType.String;\r
- case DB2ClientConstants.SQL_USER_DEFINED_TYPE:\r
- return DbType.Object;\r
- default:\r
- throw new SystemException("DB2 Data type is unknown.");\r
- }\r
- }\r
- #endregion\r
- #region Describe\r
- ///\r
- /// Describe the parameter. Use at the caller's discretion\r
- /// \r
- public short Describe(IntPtr hwndStmt, short paramNum)\r
- {\r
- IntPtr nullable = IntPtr.Zero;\r
- paramSize = IntPtr.Zero;\r
- decimalDigits = IntPtr.Zero;\r
- short sqlRet = 0;\r
-\r
- sqlRet = DB2ClientPrototypes.SQLDescribeParam(hwndStmt, paramNum, ref db2DataType, ref paramSize, ref decimalDigits, ref nullable);\r
- return sqlRet;\r
- }\r
- #endregion\r
- #region Bind \r
- ///\r
- /// Bind this parameter\r
- /// \r
- public short Bind(IntPtr hwndStmt, short paramNum)\r
- {\r
- short sqlRet = 0;\r
-\r
- switch ((int)db2DataType) \r
- {\r
- case DB2ClientConstants.SQL_DECIMAL: //These types are treated as SQL_C_CHAR for binding purposes\r
- case DB2ClientConstants.SQL_TYPE_DATE:\r
- case DB2ClientConstants.SQL_TYPE_TIME:\r
- case DB2ClientConstants.SQL_TYPE_TIMESTAMP:\r
- case DB2ClientConstants.SQL_VARCHAR:\r
- case DB2ClientConstants.SQL_CHAR:\r
- sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , (short) decimalDigits, bDataVal, 0, 0);\r
- break;\r
- default:\r
- sqlRet = DB2ClientPrototypes.SQLBindParameter(hwndStmt, (ushort)paramNum, DB2ClientConstants.SQL_PARAM_INPUT, DB2ClientConstants.SQL_C_DEFAULT, (short)db2DataType, Convert.ToUInt32((int)paramSize) , 0, ref iDataVal, 0, 0);\r
- break;\r
- } \r
- return sqlRet;\r
- }\r
- #endregion\r
- object ICloneable.Clone ()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-using System.Collections;\r
-using System.Globalization;\r
-\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Summary description for DB2ClientParameterCollection.\r
- /// </summary>\r
- public class DB2ClientParameterCollection : ArrayList, IDataParameterCollection\r
- {\r
- public object this[string index]\r
- {\r
- get \r
- {\r
- return this[IndexOf(index)];\r
- }\r
- set\r
- {\r
- this[IndexOf(index)] = value;\r
- }\r
- }\r
- public bool Contains(string paramName)\r
- {\r
- return(-1 != IndexOf(paramName));\r
- }\r
-\r
- public int IndexOf(string paramName)\r
- {\r
- int index = 0;\r
- foreach(DB2ClientParameter item in this) \r
- {\r
- if (0 == _cultureAwareCompare(item.ParameterName, paramName))\r
- {\r
- return index;\r
- }\r
- index++;\r
- }\r
- return -1;\r
- }\r
-\r
- public void RemoveAt(string paramName)\r
- {\r
- RemoveAt(IndexOf(paramName));\r
- }\r
-\r
- public override int Add(object value)\r
- {\r
- return Add((DB2ClientParameter)value);\r
- }\r
-\r
- public int Add(DB2ClientParameter value)\r
- {\r
- if (((DB2ClientParameter)value).ParameterName != null)\r
- {\r
- return base.Add(value);\r
- }\r
- else\r
- throw new ArgumentException("parameter must be named");\r
- }\r
-\r
- public int Add(string paramName, DbType type)\r
- {\r
- return Add(new DB2ClientParameter(paramName, type));\r
- }\r
-\r
- public int Add(string paramName, object value)\r
- {\r
- return Add(new DB2ClientParameter(paramName, value));\r
- }\r
-\r
- public int Add(string paramName, DbType dbType, string sourceColumn)\r
- {\r
- return Add(new DB2ClientParameter(paramName, dbType, sourceColumn));\r
- }\r
-\r
- private int _cultureAwareCompare(string strA, string strB)\r
- {\r
- return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase);\r
- }\r
- }\r
-}\r
-\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-\r
-using System;\r
-using System.Data;\r
-using System.Runtime.InteropServices;\r
-using System.Text;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// DB2CLIPrototypes class is a wrapper for the db2cli.lib, IBM's Call Level Interface to DB2\r
- /// </summary>\r
- internal class DB2ClientPrototypes\r
- {\r
- [DllImport("db2cli.dll", EntryPoint = "SQLAllocHandle")]\r
- internal static extern short SQLAllocHandle(short handleType, IntPtr inputHandle, ref IntPtr outputHandle);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLConnect")]\r
- internal static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);\r
- [DllImport("db2cli.Dll", CharSet = CharSet.Auto, EntryPoint = "SQLDisconnect")]\r
- internal static extern short SQLDisconnect(IntPtr sqlHdbc);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLGetDiagRec")]\r
- internal static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, ref IntPtr nativeErrorPtr, [Out] StringBuilder errorMessage, short bufferLength, ref IntPtr shortTextLengthPtr);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLSetConnectAttr")]\r
- internal static extern short SQLSetConnectAttr(IntPtr sqlHdbc, long sqlAttr, [In] IntPtr sqlValuePtr, long sqlValueLength);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLEndTran")]\r
- internal static extern short SQLEndTran (short handleType, IntPtr handle, short fType);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLCancel")]\r
- internal static extern short SQLCancel(IntPtr handle);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLNumResultCols")]\r
- internal static extern short SQLNumResultCols(IntPtr handle, ref int numCols);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLFetch")]\r
- internal static extern short SQLFetch(IntPtr handle);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLRowCount")]\r
- internal static extern short SQLRowCount(IntPtr stmtHandle, ref int numRows);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLExecute")]\r
- internal static extern short SQLExecute(IntPtr handle);\r
- [DllImport ("db2cli.dll", EntryPoint = "SQLExecDirect")]\r
- internal static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);\r
- [DllImport("db2cli.Dll", EntryPoint = "SQLDescribeCol")]\r
- internal static extern short SQLDescribeCol(IntPtr stmtHandle, ushort colNum, [Out] StringBuilder colName, short colNameMaxLength, IntPtr colNameLength, ref IntPtr dataType, ref IntPtr colSizePtr, ref IntPtr scalePtr, ref IntPtr nullablePtr );\r
- [DllImport("db2cli.dll", EntryPoint = "SQLBindCol")]\r
- internal static extern short SQLBindCol(IntPtr stmtHandle, ushort colNum, int dataType, [Out] byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLDriverConnect")]\r
- internal static extern short SQLDriverConnect(IntPtr hdbc, int centered, [In] string inConnectStr, [In] int inStrLength, [Out] StringBuilder outConnectStr, [Out] int outStrCapacity, [Out] IntPtr outStrLengthReturned, [In] int completion);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLPrepare")]\r
- internal static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLDescribeParam")]\r
- internal static extern short SQLDescribeParam(IntPtr stmtHandle, short paramNumber,ref IntPtr dataType, ref IntPtr paramSize, ref IntPtr decimalDigits, ref IntPtr nullable);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLNumParams")]\r
- internal static extern short SQLNumParams(IntPtr stmtHandle, ref IntPtr numParams);\r
- [DllImport("db2cli.dll")]\r
- internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber, \r
- short dataType, short valueType, short paramType, uint colSize, short decDigits, \r
- byte[] dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLBindParameter")]\r
- internal static extern short SQLBindParameter(IntPtr stmtHandle, ushort paramNumber, \r
- short dataType, short valueType, short paramType, uint colSize, short decDigits,\r
- ref int dataBufferPtr, int dataBufferLength, int StrLen_or_IndPtr);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLGetLength")]\r
- internal static extern short SQLGetLength( IntPtr stmtHandle, short locatorCType, int Locator,\r
- IntPtr stringLength, IntPtr indicatorValue);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLGetPosition")]\r
- internal static extern short SQLGetPosition(IntPtr stmtHandle, short locatorCType, int sourceLocator, int searchLocator, \r
- string searchLiteral, int searchLiteralLength, uint fromPosition, IntPtr locatedAt, IntPtr indicatorValue);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLGetPosition")]\r
- internal static extern short SQLBindFileToCol (IntPtr stmtHandle, ushort colNum, string fileName, IntPtr fileNameLength, \r
- IntPtr fileOptions, short maxFileNameLength, IntPtr stringLength, IntPtr indicatorValue);\r
- [DllImport("db2cli.dll", EntryPoint = "SQLGetPosition")]\r
- internal static extern short SQLBindFileToParam (IntPtr stmtHandle, ushort targetType, short dataType, string fileName,\r
- IntPtr fileNameLength, short maxFileNameLength, IntPtr indicatorValue);\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-using System.Data;\r
-using System.Runtime.InteropServices;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// DB2ClientTransaction. DB2 requires nothing specific to be done to open a transaction, so we set the \r
- /// isolation level, make sure AUTOCOMMIT is off. DB2 Also allows you to set transaction isolation\r
- /// at the statement level, but I haven't worked that in here yet.\r
- /// NOTE: AT THE MOMENT, SETTING OF THE ISOLATION LEVEL IS NOT WORKING\r
- /// </summary>\r
- public class DB2ClientTransaction : IDbTransaction\r
- {\r
- DB2ClientUtils util = new DB2ClientUtils();\r
- IsolationLevel IL = IsolationLevel.Unspecified;\r
- DB2ClientConnection db2Conn;\r
- public DB2ClientTransaction(DB2ClientConnection con, IsolationLevel isoL)\r
- {\r
- long db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;\r
- db2Conn = con;\r
- short sqlRet;\r
-\r
- switch (isoL) \r
- {\r
- case System.Data.IsolationLevel.Chaos: //No DB2equivalent, default to SQL_TXN_READ_COMMITTED\r
- break;\r
- case System.Data.IsolationLevel.ReadCommitted: //SQL_TXN_READ_COMMITTED\r
- db2IsoL = DB2ClientConstants.SQL_TXN_READ_COMMITTED;\r
- break;\r
- case System.Data.IsolationLevel.ReadUncommitted: //SQL_TXN_READ_UNCOMMITTED\r
- db2IsoL = DB2ClientConstants.SQL_TXN_READ_UNCOMMITTED;\r
- break;\r
- case System.Data.IsolationLevel.RepeatableRead: //SQL_TXN_REPEATABLE_READ\r
- db2IsoL = DB2ClientConstants.SQL_TXN_REPEATABLE_READ;\r
- break;\r
- case System.Data.IsolationLevel.Serializable: //SQL_TXN_SERIALIZABLE_READ\r
- db2IsoL = DB2ClientConstants.SQL_TXN_SERIALIZABLE_READ;\r
- break;\r
- }\r
-\r
- IL = isoL;\r
- IntPtr iso = new IntPtr(db2IsoL);\r
- IntPtr attr = new IntPtr(DB2ClientConstants.SQL_AUTOCOMMIT_OFF);\r
- sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_AUTOCOMMIT, attr, 0);\r
- util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting AUTOCOMMIT OFF in transaction CTOR.");\r
-// sqlRet = DB2ClientPrototypes.SQLSetConnectAttr(db2Conn.DBHandle, DB2ClientConstants.SQL_TXN_ISOLATION, iso, 0);\r
-// util.DB2CheckReturn(sqlRet, DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, "Error setting TRANSCTION ISOLATION in transaction CTOR.");\r
- \r
- }\r
-\r
- /// <summary>\r
- /// DB2ClientConnection associated with this transaction\r
- /// </summary>\r
- public IDbConnection Connection\r
- {\r
- get\r
- {\r
- return db2Conn;\r
- }\r
- }\r
- /// <summary>\r
- /// IsolationLevel property\r
- /// </summary>\r
- /// \r
- public IsolationLevel IsolationLevel\r
- {\r
- get \r
- {\r
- return IL;\r
- }\r
- }\r
-\r
- public void Commit() {\r
- DB2ClientPrototypes.SQLEndTran(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, DB2ClientConstants.SQL_COMMIT);\r
- }\r
- public void Rollback() \r
- {\r
- DB2ClientPrototypes.SQLEndTran(DB2ClientConstants.SQL_HANDLE_DBC, db2Conn.DBHandle, DB2ClientConstants.SQL_ROLLBACK);\r
- }\r
-\r
- /// <summary>\r
- /// Dispose method.\r
- /// </summary>\r
- private bool Done = false;\r
- public void Dispose()\r
- {\r
- if (Done) \r
- return;\r
- Rollback();\r
- IL = IsolationLevel.Unspecified;\r
- db2Conn = null;\r
- Done = true;\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#region Licence\r
- /// DB2DriverCS - A DB2 driver for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
-#endregion\r
-using System;\r
-\r
-namespace DB2ClientCS\r
-{\r
- /// <summary>\r
- /// Utility functions class, i.e. functions like SQL return code error checking\r
- /// </summary>\r
- public class DB2ClientUtils\r
- {\r
- public DB2ClientUtils()\r
- {\r
- //\r
- // TODO: Add constructor logic here\r
- //\r
- }\r
- #region DB2CheckReturn\r
- /// <summary>\r
- /// Check the return value from a Call Level Interface call and respond to errors (by tossing exception)\r
- /// </summary>\r
- /// <param name="sqlRet"><The return value>\r
- /// <param name="handleType"><Type of handle, 0 means we don't care, so don't try to check the handle for any messages placed there by DB2>\r
- /// <param name="handle"><The handle in question, don't care if handletype is 0>\r
- /// <param name="message"><Message we may throw>\r
- /// <returns></returns>\r
- public int DB2CheckReturn(short sqlRet, short handleType, IntPtr handle, string message)\r
- {\r
- switch ((long)sqlRet) \r
- {\r
- case DB2ClientConstants.SQL_ERROR:\r
- if (handleType != 0)\r
- throw new DB2ClientException(handleType, handle, message);\r
- else\r
- throw new DB2ClientException(message);\r
- default:\r
- return 0;\r
- }\r
- }\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-//\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-//\r
-[assembly: AssemblyTitle("")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("")]\r
-[assembly: AssemblyCopyright("")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")] \r
-\r
-//\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-// Major Version\r
-// Minor Version \r
-// Build Number\r
-// Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-\r
-[assembly: AssemblyVersion("1.0.*")]\r
-\r
-//\r
-// In order to sign your assembly you must specify a key to use. Refer to the \r
-// Microsoft .NET Framework documentation for more information on assembly signing.\r
-//\r
-// Use the attributes below to control which key is used for signing. \r
-//\r
-// Notes: \r
-// (*) If no key is specified, the assembly is not signed.\r
-// (*) KeyName refers to a key that has been installed in the Crypto Service\r
-// Provider (CSP) on your machine. KeyFile refers to a file which contains\r
-// a key.\r
-// (*) If the KeyFile and the KeyName values are both specified, the \r
-// following processing occurs:\r
-// (1) If the KeyName can be found in the CSP, that key is used.\r
-// (2) If the KeyName does not exist and the KeyFile does exist, the key \r
-// in the KeyFile is installed into the CSP and used.\r
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.\r
-// When specifying the KeyFile, the location of the KeyFile should be\r
-// relative to the project output directory which is\r
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is\r
-// located in the project directory, you would specify the AssemblyKeyFile \r
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]\r
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework\r
-// documentation for more information on this.\r
-//\r
-[assembly: AssemblyDelaySign(false)]\r
-[assembly: AssemblyKeyFile("")]\r
-[assembly: AssemblyKeyName("")]\r
+++ /dev/null
-2003-01-18 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * TestDB2Conn.cs: use a different connection string \r
- which uses the format\r
- "DSN=database;UID=userid;PWD=password"\r
-
\ No newline at end of file
+++ /dev/null
-#region Licence\r
- /// DB2DriverCS Test Code - A DB2 driver test for .Net\r
- /// Copyright 2003 By Christopher Bockner\r
- /// Released under the terms of the MIT/X11 Licence\r
- /// Please refer to the Licence.txt file that should be distributed with this package\r
- /// This software requires that DB2 client software be installed correctly on the machine\r
- /// (or instance) on which the driver is running. \r
- /// \r
-#endregion\r
-\r
-using System;\r
-using System.Data;\r
-using DB2ClientCS;\r
-using System.Text;\r
-\r
-namespace TestDB2Conn {\r
- /// <summary>\r
- /// Code to test DB2DriverCS.\r
- /// </summary>\r
- class TestDB2Client \r
- {\r
- static void DoTest(string database, string userid, string password) \r
- {\r
- IDbCommand command = null;\r
- string connectionString = String.Format(\r
- "DSN={0};UID={1};PWD={2}",\r
- database, userid, password);\r
- try {\r
- Console.WriteLine("Create DB2 client Connection...");\r
- DB2ClientConnection DB2Conn = new DB2ClientConnection();\r
- \r
- Console.WriteLine("connection string: " + connectionString);\r
- \r
- Console.WriteLine("Set connection string...");\r
- DB2Conn.ConnectionString = connectionString;\r
- \r
- Console.WriteLine("Open a connection...");\r
- DB2Conn.Open();\r
- \r
- string createTestTableSQL = \r
- "CREATE TABLE mono_db2_test1 ( " +\r
- " testid varchar(2), " +\r
- " testdesc varchar(16) " +\r
- ")";\r
- Console.WriteLine("SQL:\n" + createTestTableSQL);\r
- \r
- Console.WriteLine("Create a command using sql and connection...");\r
- command = new DB2ClientCommand(createTestTableSQL,DB2Conn);\r
- Console.WriteLine("Execute Non Query...");\r
- command.ExecuteNonQuery();\r
-\r
- string selectSQL = "select * from employee";\r
- Console.WriteLine("SQL:\n" + selectSQL);\r
- Console.WriteLine("create command and set connection and connection string...");\r
- command = new DB2ClientCommand(selectSQL,DB2Conn);\r
- Console.WriteLine("ExecuteReader...");\r
- IDataReader dr = command.ExecuteReader();\r
- Console.WriteLine("Read row...");\r
- dr.Read();\r
- Console.WriteLine("Read row...");\r
- dr.Read();\r
- Console.WriteLine("GetString...");\r
- string dt = dr.GetString(1);\r
- Console.WriteLine("dt: " + dt);\r
- string s = dr.GetString(5);\r
- Console.WriteLine("s: " + s);\r
- DateTime t = dr.GetDateTime(6);\r
- Console.WriteLine("t: " + t);\r
- \r
- Console.WriteLine("Close connection...");\r
- DB2Conn.Close();\r
- }\r
- catch(DB2ClientException e) {\r
- System.Console.Write(e.Message);\r
- }\r
- }\r
- /// <summary>\r
- /// The main entry point for the application.\r
- /// </summary>\r
- [STAThread]\r
- static void Main(string[] args) \r
- {\r
- if(args.Length != 3)\r
- Console.WriteLine("Usage: mono TestDB2Conn.exe database userid password");\r
- else {\r
- Console.WriteLine("Test Begin.");\r
- // database, userid, password\r
- DoTest(args[0], args[1], args[2]);\r
- Console.WriteLine("Test End.");\r
- } \r
- }\r
- }\r
-}\r
+++ /dev/null
-Copyright (c) 2003 Christopher Bockner\r
-\r
-Permission is hereby granted, free of charge, to any person obtaining a copy of this \r
-software and associated documentation files (the "Software"), to deal in the Software \r
-without restriction, including without limitation the rights to use, copy, modify, merge, \r
-publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons \r
-to whom the Software is furnished to do so, subject to the following conditions:\r
-\r
-The above copyright notice and this permission notice shall be included in all copies or \r
-substantial portions of the Software.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, \r
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR \r
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \r
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR \r
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER \r
-DEALINGS IN THE SOFTWARE.\r
-\r
+++ /dev/null
-list
-.makefrag
-.response
-library-deps.stamp
+++ /dev/null
-2002-11-13 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlParameter.cs
- * Mono.Data.MySql/MySqlParameterCollection.cs: added
- simple input parameters support. AFAIK, MySQL does not
- support parameters, so this is just a search and replace
-
- * Test/TestParameters.cs: add file to test Parameters
-
- * Test/TestDataAdapter.cs: add file to test MySqlDataAdapter
-
- * Mono.Data.MySql.build: added files to windows build
-
- * list: added files to linux build
-
- * Mono.Data.MySql/MySql.cs: make sure all
- DllImport attributes
- also have the SuppressUnmanagedCodeSecurity attribute
-
- * Mono.Data.MySql/MySqlCommand.cs: add support for
- input parameters, don't execute empty queries,
- and support of CommandTypes of StoredProcedure and TableDirect
-
- * Mono.Data.MySql/MySqlConnection.cs: borrowed Tim Coleman's
- code from SqlConnection to handle connection
- parameters correctly
-
- * Mono.Data.MySql/MySqlTypes.cs
- * Mono.Data.MySql/MySqlDataReader.cs: started support
- for NULL values.
-
- * Test/MySqlTest.cs: test for NULL values, stored procedures,
- executing a non-query via ExecuteReader(), new connection
- string functionality, and exception handling
-
-2002-11-01 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlDataAdapter.cs
- * Mono.Data.MySql/MySqlRowUpdatedEventArgs.cs
- * Mono.Data.MySql/MySqlRowUpdatedEventHandler.cs
- * Mono.Data.MySql/MySqlRowUpdatingEventArgs.cs
- * Mono.Data.MySql/MySqlRowUpdatingEventHandler.cs: added new
- files for the Data Adapter for the MySQL data provider
-
- * list: added new files to Linux build
-
- * Mono.Data.MySql/MySqlCommand.cs: implement the
- interfaces correctly and Dispose(). Allow the provider to
- execute multiple queries for a reader
-
- * Mono.Data.MySql/MySqlTransaction.cs
- * Mono.Data.MySql/MySqlConnection.cs: implement the
- interfaces correctly and Dispose
-
- * Mono.Data.MySql/MySqlDataReader.cs: implement the
- interfaces correctly and Dispose(). Allow the provider to
- execute multiple queries for a reader. Implement
- IEnumerable.GetEnumerator() to return a DbEnumerator
- which can be used to do a
- foreach (DbDataRecord rec in myDataReader) { ... }
- and allows a IDataReader to be "data binded" to a DataGrid.
- Thanks goes to Tim Coleman (I copied this from his SqlDataReader).
-
-2002-10-26 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlError.cs
- * Mono.Data.MySql/MySqlErrorCollection.cs
- * Mono.Data.MySql/MySqlException.cs: added files for
- MySQL Exceptions
-
- * Mono.Data.MySql.build: removed excludes for new
- files (thus adding them to the build) on Windows
-
- * list: added files to build on Linux
-
- * Mono.Data.MySql/MySqlCommand.cs
- * Mono.Data.MySql/MySqlConnection.cs: modified
- to throw a new MySqlException when a MySqlError occurs
-
-2002-10-13 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlDataReader.cs: change "DataType" in
- schema DataTable to be typeof(Type) instead of
- typeof(string) to make it more like MS.NET
-
- * Test/MySqlTest.cs: tweaks
-
-2002-10-13 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlCommand.cs:
- * Mono.Data.MySql/MySqlConnection.cs:
- * Mono.Data.MySql/MySqlDataReader.cs:
- * Mono.Data.MySql/MySqlTypes.cs: modifed -
- handle MySQL types to .NET types and some fixes
-
-2002-10-12 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/MySqlTest.cs: added file - to do
- various Tests for the MySql provider
-
- * Mono.Data.MySql/Field.cs: enum MySqlFieldFlags
- should be unit. Rename class Field to MySqlMarshalledField
- to represent what it really is. Redo handling of field Flags.
-
- * Mono.Data.MySql/MySql.cs: added method AffectedRows() to
- pinvoke into mysql_affected_rows() so we can know what rows
- were affected by an INSERT, UPDATE, or DELETE SQL statement.
-
- * Mono.Data.MySql/MySqlCommand.cs: rename
- internal method rowVal() to GetColumnData(). In GetColumnData,
- if IntPtr.Zero, return an empty "" string instead of "NULL".
- Pass command behavior to data reader.
-
- * Mono.Data.MySql/MySqlDataReader.cs: redo the
- way field meta data and data is structured so
- a schema DataTable can be built. Implement
- GetSchemaTable() to create a DataTable holding the schema
- of the fields. Implemented more methods.
-
- * Mono.Data.MySql/MySqlTypes.cs: added method to
- translate System.Data.DbType to System.Type
-
- * est/TestMySqlExecuteReader.cs: minor tweaks
-
-2002-10-11 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlTransaction.cs: added to
- support transactions (BEGIN, COMMIT/ROLLBACK).
-
- * Mono.Data.MySql.build: included MySqlTransaction
- in build on Windows
-
- * list: included MySqlTransaction
- in build on Linux
-
- * Mono.Data.MySql/MySql.cs: the mysql thread functions
- were misnamed and prevented them from being loaded
- by the mono JIT - my_thread_init() and my_thread_end().
- Now, threading should work in the MySQL provider and
- less memory leaks too.
-
- * Mono.Data.MySql/Test.cs: remove conditional comiliation
- since everything compiles fine on Mono now
-
- * Mono.Data.MySql/MySqlCommand.cs: remove Console.WriteLine()
-
- * Mono.Data.MySql/MySqlConnection.cs: added transaction
- support, implemented method ChangeDatabase(), implemented
- property ServerVersion
-
- * Test/TestMySqlInsert.cs: modified test
- to handle transactions
-
-2002-10-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * makefile.gnu: added makefile for linux build.
-
- * list: updated to contain all missing files.
-
- * Mono.Data.MySql/makefile: removed unneeded makefile.
-
-2002-10-09 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlDataReader.cs: added
- started implementing Reader for MySQL provider
-
- * Mono.Data.MySql/MySqlTypes.cs: added
- to hold internal helper methods, enums, structs, classes
- for handling MySQL data types
-
- * Test/TestMySqlExecuteReader.cs
- * Test/TestMySqlExecuteScalar.cs: added simple tests
- for ExecuteScalar() and ExecuteReader() methods
- in MySqlCommand. We are able to retrieve data
- from MySQL now.
-
- * Mono.Data.MySql.build: took out exclude
- so MySqlExecuteReader.cs will build
-
- * Mono.Data.MySql/Field.cs: added enum to file
- and added helper methods field flags
-
- * Mono.Data.MySql/MySqlCommand.cs: started
- implementation of ExecuteScalar nd ExecuteReader methods
- to retrieve data. Also, added internal method rowVal
- for marshalling field data.
-
- * Mono.Data.MySql/Test.cs: take out a bunch of
- Console.WriteLines'
-
-2002-08-13 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql/MySqlCommand.cs: modified
- rowsRetrieved should be rowsAffected in ExecuteNonQuery
- because the number is only to show the rows affected
- by an INSERT, UPDATE, or DELETE; anything else, the
- number is -1
-
- * Mono.Data.MySql/Test.cs: modified
- enable retrieving the results from a query. even though
- this still does not work for some reason, i thought
- i would enable it so others could see the problem.
-
-2002-05-30 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql.build: modified
- need to copy Mono.Data.MySql.dll to mcs/class/System.Data/Test
- so the SqlSharpCli test program can use MySql too
-
-2002-05-30 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestMySqlInsert.cs: added test
- to do an SQL INSERT to insert a row into table.
- Works on cygwin compiled using mcs and mono and
- runs on mint, but it fails running on mono.
-
- * Mono.Data.MySql/MySqlCommand.cs
- * Mono.Data.MySql/TODOAttribute.cs
- * Mono.Data.MySql/MySqlConnection.cs: added
-
- * list: added
- so can build with mcs/mono on linux
- I only tested it on Cygwin though.
- To work on linux, the library name in the pinvokes
- in MySql.cs will need to be changed.
-
- * Mono.Data.MySql.build: modified
- exclude files from build. also copy Mono.Data.MySql.dll
- to Mono.Data.MySql so you can build and run Test.cs
-
- * Mono.Data.MySql/MySql.cs: modified
- tweaks to compile under mcs/mono and run under mint or mono.
- Runs under mint, but not mono. Had to comment out
- mysql_thread_begin/mysql_thread_end functions because they refused
- to load in mono. Until this is fixed, a memory leak will occur.
- Can not retrieve field data from MySQL because the PtrToStructure()
- needs to be implemented in System.Runtime.InteropServices.Marshal class.
- However, this will be very complicated to do. So, we connect to
- MySQL and execute SQL Commands, but we can not do Queries yet.
-
- * Mono.Data.MySql/Test.cs: modified
- tweaks to test C# bindings with compiling mcs/mono and
- running on mint and mono. Runs on mint, but not mono.
-
-2002-05-28 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql
- * Mono.Data.MySql/Mono.Data.MySql: add directories
- for the Mono.Data.MySql assembly and namespace. This
- will contain the MySql .NET Data Provider which will use
- C# bindings to libMySQL
-
- * Mono.Data.MySql/Test.cs: added file to
- test the C# bindings to MySQL
-
- * Mono.Data.MySql/MySql.cs
- * Mono.Data.MySql/Field.cs: added files
- for the beginnings of C# bindings to MySQL
-
- * Mono.Data.MySql/makefile: added file
- to build the MySQL C# bindings on csc/Microsoft.NET
-
- These C# bindings to the MySQL libMySQL.dll were created by
- Brad Merrill <zbrad@cybercom.net>
- and can be downloaded from
- http://www.cybercom.net/~zbrad/DotNet/MySql/
- and put into the Mono Class Library under the X11/MIT License
- with Brad Merril's permission.
-
+++ /dev/null
-thisdir = class/Mono.Data.MySql
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Data.MySql.dll
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Xml.dll /r:System.Data.dll
-NO_TEST = yes
-
-EXTRA_DISTFILES = \
- Test/MySqlTest.cs \
- Test/TestDataAdapter.cs \
- Test/TestMySqlExecuteReader.cs \
- Test/TestMySqlExecuteScalar.cs \
- Test/TestMySqlInsert.cs \
- Test/TestParameters.cs
-
-include ../../build/library.make
+++ /dev/null
-Mono.Data.MySql/Field.cs
-Mono.Data.MySql/MySqlCommand.cs
-Mono.Data.MySql/MySqlConnection.cs
-Mono.Data.MySql/MySql.cs
-Mono.Data.MySql/TODOAttribute.cs
-Mono.Data.MySql/MySqlDataReader.cs
-Mono.Data.MySql/MySqlTypes.cs
-Mono.Data.MySql/MySqlTransaction.cs
-Mono.Data.MySql/MySqlError.cs
-Mono.Data.MySql/MySqlErrorCollection.cs
-Mono.Data.MySql/MySqlException.cs
-Mono.Data.MySql/MySqlDataAdapter.cs
-Mono.Data.MySql/MySqlRowUpdatedEventArgs.cs
-Mono.Data.MySql/MySqlRowUpdatedEventHandler.cs
-Mono.Data.MySql/MySqlRowUpdatingEventArgs.cs
-Mono.Data.MySql/MySqlRowUpdatingEventHandler.cs
-Mono.Data.MySql/MySqlParameter.cs
-Mono.Data.MySql/MySqlParameterCollection.cs
-
+++ /dev/null
-//
-// Field.cs
-//
-// Provide definition for the Field class
-// Part of the C# bindings to MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C)Copyright 2002 Brad Merril
-// (C)Copyright 2002 Daniel Morgan
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace Mono.Data.MySql {
- using System;
- using System.Runtime.InteropServices;
-
- [Flags]
- internal enum MySqlFieldFlags : uint {
- NOT_NULL_FLAG = 1,
- PRI_KEY_FLAG = 2,
- UNIQUE_KEY_FLAG = 4,
- MULTIPLE_KEY_FLAG = 8,
- BLOB_FLAG = 16,
- UNSIGNED_FLAG = 32,
- ZEROFILL_FLAG = 64,
- BINARY_FLAG = 128,
- ENUM_FLAG = 256,
- AUTO_INCREMENT_FLAG = 512,
- TIMESTAMP_FLAG = 1024,
- SET_FLAG = 2048,
- NUM_FLAG = 32768,
- PART_KEY_FLAG = 16384,
- GROUP_FLAG = 32768,
- UNIQUE_FLAG = 65536
- }
-
- ///<remarks>
- ///<para>
- /// MySql P/Invoke implementation test program
- /// Brad Merrill
- /// 3-Mar-2002
- ///</para>
- ///<para>
- /// This structure contains information about a field, such as the
- /// field's name, type, and size. Its members are described in more
- /// detail below. You may obtain the <see cref="Field"/> structures for
- /// each field by calling
- /// <see cref="MySql.FetchField"/>
- /// repeatedly.
- /// Field values are not part of this structure;
- /// they are contained in a Row structure.
- ///</para>
- ///</remarks>
- [StructLayout(LayoutKind.Sequential)]
- public class MySqlMarshalledField {
-
- ///<value>name of column</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Name;
- ///<value>table of column</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Table;
- ///<value>default value</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Def;
- ///<value>type of field</value>
- public int FieldType;
- ///<value>width of column</value>
- public uint Length;
- ///<value>max width of selected set</value>
- public uint MaxLength;
- ///<value>div flags</value>
- public uint Flags;
- ///<value>number of decimals in field</value>
- public uint Decimals;
- }
-
- internal sealed class MySqlFieldHelper {
-
- public static bool IsPrimaryKey(uint fieldFlags) {
- // if ((SomeEnum)U & SomeEnum.EnumFlagValue) != 0) {...}
- if(! (((MySqlFieldFlags) fieldFlags) & MySqlFieldFlags.PRI_KEY_FLAG).Equals(0))
- return true;
- else
- return false;
- }
-
- public static bool IsNotNull(uint fieldFlags) {
-
- if(! (((MySqlFieldFlags) fieldFlags) & MySqlFieldFlags.NOT_NULL_FLAG).Equals(0))
- return true;
- else
- return false;
- }
-
- public static bool IsBlob(uint fieldFlags) {
-
- if(! (((MySqlFieldFlags) fieldFlags) & MySqlFieldFlags.BLOB_FLAG).Equals(0))
- return true;
- else
- return false;
- }
- }
-}
+++ /dev/null
-//
-// MySql.cs
-//
-// Provides the core of C# bindings
-// to the MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C)Copyright 2002 Brad Merril
-// (C)Copyright 2002 Daniel Morgan
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Data.MySql {
- using System;
- using System.Security;
- using System.Runtime.InteropServices;
-
- internal sealed class MySql {
- ///<value>protocol version</value>
- public static readonly uint ProtocolVersion = 10;
- ///<value>server version</value>
- public static readonly string ServerVersion = "3.23.49";
- ///<value>server suffix</value>
- public static readonly string ServerSuffix = "";
- ///<value>server version as int</value>
- public static readonly uint VersionId = 32349;
- ///<value>server port number</value>
- public static readonly uint Port = 3306;
- ///<value>unix named socket</value>
- public static readonly string UnixAddr = "/tmp/mysql.sock";
- ///<value>character set</value>
- public static readonly string CharSet = "latin1";
-
- ///<summary>Gets or initializes a `MySql' structure</summary>
- ///<returns>An initialized `MYSQL*' handle. IntPtr.Zero if there was insufficient memory to allocate a new object.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL", EntryPoint="mysql_init", ExactSpelling=true)]
- public static extern IntPtr Init(IntPtr db);
-
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL", EntryPoint="mysql_affected_rows", ExactSpelling=true)]
- public static extern ulong AffectedRows(IntPtr db);
- //my_ulonglong mysql_affected_rows(MYSQL *mysql);\r
-
- ///<summary>Connects to a MySql server</summary>
- ///<returns><paramref name="db"/> value on success, else returns IntPtr.Zero</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_connect", ExactSpelling=true)]
- public static extern IntPtr Connect(IntPtr db,
- [In] string host, [In] string user, [In] string passwd,
- [In] string dbname,
- uint port, [In] string socketName, uint flags
- );
-
- ///<summary>Selects a database</summary>
- ///<returns>Zero for success. Non-zero if an error occurred.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_select_db", ExactSpelling=true)]
- public static extern int SelectDb(IntPtr conn, [In] string db);
-
- ///<summary>Closes a server connection</summary>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL", EntryPoint="mysql_close", ExactSpelling=true)]
- public static extern void Close(IntPtr db);
-
- ///<summary>Executes a SQL query specified as a string</summary>
- ///<returns>number of rows changed, -1 if zero</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_query", ExactSpelling=true)]
- public static extern int Query(IntPtr conn, [In] string query);
-
- ///<summary>Retrieves a complete result set to the client</summary>
- ///<returns>An IntPtr result structure with the results. IntPtr.Zero if an error occurred.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_store_result", ExactSpelling=true)]
- public static extern IntPtr StoreResult(IntPtr conn);
-
- ///<returns>Returns the number of rows in a result set</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_num_rows", ExactSpelling=true)]
- public static extern int NumRows(IntPtr r);
-
- ///<returns>Returns the number of columns in a result set</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_num_fields", ExactSpelling=true)]
- public static extern int NumFields(IntPtr r);
-
- ///<returns>Returns an IntPtr to all field structures</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_fetch_field", ExactSpelling=true)]
- public static extern IntPtr FetchField(IntPtr r);
-
- ///<summary>Retrieves the next row of a result set</summary>
- ///<returns>An IntPtr structure for the next row. IntPtr.Zero if there are no more rows to retrieve or if an error occurred.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_fetch_row", ExactSpelling=true)]
- public static extern IntPtr FetchRow(IntPtr r);
-
- ///<summary>Frees the memory allocated for a result set by <see cref="StoreResult"/></summary>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_free_result", ExactSpelling=true)]
- public static extern void FreeResult(IntPtr r);
-
- ///<returns>Returns a string that represents the client library version</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_client_info", ExactSpelling=true)]
- public static extern string GetClientInfo();
-
- ///<returns></returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_host_info", ExactSpelling=true)]
- public static extern string GetHostInfo(IntPtr db);
-
- ///<returns>A string describing the type of connection in use, including the server host name.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_server_info", ExactSpelling=true)]
- public static extern string GetServerInfo(IntPtr db);
-
- ///<returns>A string describing the server status. null if an error occurred.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_stat", ExactSpelling=true)]
- public static extern string Stat(IntPtr db);
-
- ///<summary>
- /// Returns a result set describing the current server
- /// threads. This is the same kind of information as that
- /// reported by `mysqladmin processlist' or a `SHOW PROCESSLIST'
- /// query. You must free the result set with
- /// <see cref="FreeResult"/>.
- ///</summary>
- ///<returns>
- /// A IntPtr result set for success. IntPtr.Zero if an error
- /// occurred.
- ///</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_list_processes", ExactSpelling=true)]
- public static extern IntPtr ListProcesses(IntPtr db);
-
- ///<summary>
- ///<para>
- /// Returns a result set consisting of table names in
- /// the current database that match the simple regular expression
- /// specified by the <paramref name="wild"/> parameter.
- /// <paramref name="wild"/>may contain the wild-card characters
- /// "%" or "_", or may be a null pointer to match all tables.
- ///</para>
- ///<para>
- /// Calling <see cref="ListTables"/> is similar to executing
- /// the query "SHOW tables [LIKE wild]".
- ///</para>
- ///<para>
- /// You must free the result set with <see cref="FreeResult"/>.
- ///</para>
- ///</summary>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_list_tables", ExactSpelling=true)]
- public static extern IntPtr ListTables(IntPtr db, [In] string wild);
-
- ///<summary>
- /// For the connection specified by <paramref name="db"/>,
- /// <see cref="Error"/> returns the
- /// error message for the most recently invoked API function
- /// that can succeed or fail. An empty string ("") is
- /// returned if no error occurred.
- ///</summary>
- ///<returns>
- /// A string that describes the error. An empty string if no error occurred.
- ///</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_error", ExactSpelling=true)]
- public static extern string Error(IntPtr db);
-
- ///<summary>
- ///<para>
- /// This function needs to be called before exiting
- /// to free memory allocated explicitly by
- /// <see cref="ThreadInit"/> or implicitly by
- /// <see cref="Init"/>.
- ///</para>
- ///<para>
- /// Note that this function is NOT invoked automatically by the client
- /// library!
- ///</para>
- ///</summary>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="my_thread_end", ExactSpelling=true)]
- public static extern void ThreadEnd();
-
- ///<summary>
- ///<para>
- /// This function needs to be called for each created thread
- /// to initialize thread specific variables.
- ///</para>
- ///<para>
- /// This is automatically called by <see cref="Init"/>.
- ///</para>
- ///</summary>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="my_thread_init", ExactSpelling=true)]
- public static extern void ThreadInit();
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlCommand.cs
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Daniel Morgan, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Data.MySql {
- public sealed class MySqlCommand : Component, IDbCommand, ICloneable {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private MySqlConnection conn = null;
- private MySqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- private MySqlParameterCollection parmCollection = new
- MySqlParameterCollection();
-
- // MySqlDataReader state data for ExecuteReader()
- //private MySqlDataReader dataReader = null;
- private string[] commands = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- private bool disposed = false;
-
- private const char bindChar = ':';
-
- #endregion // Fields
-
- #region Constructors
-
- public MySqlCommand() {
- sql = "";
- }
-
- public MySqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public MySqlCommand (string cmdText, MySqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- public MySqlCommand (string cmdText, MySqlConnection connection,
- MySqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- return CreateParameter ();
- }
-
- [MonoTODO]
- public MySqlParameter CreateParameter () {
- return new MySqlParameter ();
- }
-
- public int ExecuteNonQuery () {
- int rowsAffected = -1;
-
- IntPtr res = ExecuteSQL (sql);
-
- if(res.Equals(IntPtr.Zero)) {
- // no result set returned, get records affected
- rowsAffected = (int) MySql.AffectedRows(conn.NativeMySqlInitStruct);
- }
-
- MySql.FreeResult(res);
- res = IntPtr.Zero;
-
- // >= 0 of the number of rows affected by
- // INSERT, UPDATE, DELETE
- // otherwise, -1
- return rowsAffected;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- return ExecuteReader ();
- }
-
- [MonoTODO]
- public MySqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
-
- return ExecuteReader (behavior);
- }
-
- [MonoTODO]
- public MySqlDataReader ExecuteReader (CommandBehavior behavior) {
-
- MySqlDataReader reader = null;
-
- currentQuery = -1;
-
- commands = sql.Split(new Char[] {';'});
- reader = new MySqlDataReader(this, behavior);
- reader.NextResult();
-
- return reader;
- }
-
- // called by an MySqlDataReader's NextResult()
- internal IntPtr NextResult (out bool result) {
-
- IntPtr mysqlResult = IntPtr.Zero;
- result = false;
-
- currentQuery++;
- if(currentQuery < commands.Length) {
- string query = "";
-
- // don't execute empty queries
- while((query = commands[currentQuery]).Equals("")) {
- currentQuery++;
- if(currentQuery >= commands.Length)
- return IntPtr.Zero;
- }
- mysqlResult = ExecuteSQL (query);
- result = true; // has result
- }
-
- return mysqlResult;
- }
-
- public object ExecuteScalar () {
-
- object obj = null;
-
- IntPtr res = ExecuteSQL (sql);
-
- int numRows = MySql.NumRows(res);
- int numFields = MySql.NumFields(res);
-
- MySqlMarshalledField fd;
- fd = (MySqlMarshalledField) Marshal.PtrToStructure(MySql.FetchField(res),
- typeof(MySqlMarshalledField));
- string fieldName = fd.Name;
- int fieldType = fd.FieldType;
- MySqlEnumFieldTypes mysqlFieldType = (MySqlEnumFieldTypes) fieldType;
- DbType fieldDbType = MySqlHelper.MySqlTypeToDbType(mysqlFieldType);
-
- IntPtr row;
- row = MySql.FetchRow(res);
- if(row == IntPtr.Zero) {
- // EOF
- obj = null;
- }
- else {
- // only get first column/first row
- string objValue = GetColumnData(row, 0);
- obj = MySqlHelper.ConvertDbTypeToSystem (mysqlFieldType, fieldDbType, objValue);
- row = IntPtr.Zero;
- }
- MySql.FreeResult(res);
- res = IntPtr.Zero;
-
- return obj;
- }
-
- // command: string in - SQL command
- // IntPtr (MySqlResult) return - the result
- // Use of this function needs to check to see if
- // if the return equal to IntPtr.Zero
- // Example: IntPtr res = ExecuteSQL ("SELECT * FROM DB");
- // if (res == IntPtr.Zero) { // do something }
- //
- internal IntPtr ExecuteSQL (string command) {
- string msg = "";
-
- if (conn == null)
- throw new InvalidOperationException(
- "Connection is null");
-
- if (conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- if (sql.Equals (String.Empty))
- throw new InvalidOperationException(
- "CommandText is Empty");
-
- string query = TweakQuery(sql);
-
- int rcq = MySql.Query(conn.NativeMySqlInitStruct, query);
- if (rcq != 0) {
- msg =
- "MySql Error: " +
- "Could not execute command [" +
- sql +
- "] on server because: " +
- MySql.Error(conn.NativeMySqlInitStruct);
- throw new MySqlException(msg);
- }
- IntPtr result = MySql.StoreResult(conn.NativeMySqlInitStruct);
- return result;
- }
-
- string TweakQuery(string query) {
- string statement = "";
-
- switch(cmdType) {
- case CommandType.Text:
- statement = ReplaceParameterPlaceholders (query);
- break;
- case CommandType.StoredProcedure:
- string sParmList = GetStoredProcParmList ();
- statement = "SELECT " + query + "(" + sParmList + ")";
- break;
- case CommandType.TableDirect:
- statement =
- "SELECT * FROM " + query;
- break;
- }
- return statement;
- }
-
- string GetStoredProcParmList () {
- StringBuilder s = new StringBuilder();
-
- int addedCount = 0;
- for(int p = 0; p < parmCollection.Count; p++) {
- MySqlParameter prm = parmCollection[p];
- if(prm.Direction == ParameterDirection.Input) {\r
- string strObj = MySqlHelper.\r
- ObjectToString(prm.DbType, \r
- prm.Value);\r
- if(addedCount > 0)\r
- s.Append(",");\r
- s.Append(strObj);\r
- addedCount++;\r
- }
- }
- return s.ToString();
- }
-
- // TODO: this only supports input parameters,
- // need support for output, input/output,
- // and return parameters
- // As far as I know, MySQL does not support
- // parameters so the parameters support in this
- // provider is just a search and replace.
- string ReplaceParameterPlaceholders (string query) {\r
- \r
- string resultSql = "";\r
-\r
- StringBuilder result = new StringBuilder();\r
- char[] chars = sql.ToCharArray();\r
- bool bStringConstFound = false;\r
-\r
- for(int i = 0; i < chars.Length; i++) {\r
- if(chars[i] == '\'') {\r
- if(bStringConstFound == true)\r
- bStringConstFound = false;\r
- else\r
- bStringConstFound = true;\r
-\r
- result.Append(chars[i]);\r
- }\r
- else if(chars[i] == bindChar && \r
- bStringConstFound == false) {\r
-\r
- StringBuilder parm = new StringBuilder();\r
- i++;\r
- while(i <= chars.Length) {\r
- char ch;\r
- if(i == chars.Length)\r
- ch = ' '; // a space\r
- else\r
- ch = chars[i];\r
-\r
- if(Char.IsLetterOrDigit(ch)) {\r
- parm.Append(ch);\r
- }\r
- else {\r
- string p = parm.ToString();\r
- bool found = BindReplace(result, p);\r
-\r
- if(found == true)\r
- break;\r
- else { \r
- // *** Error Handling\r
- Console.WriteLine("Error: parameter not found: " + p);\r
- return "";\r
- }\r
- }\r
- i++;\r
- }\r
- i--;\r
- }\r
- else \r
- result.Append(chars[i]);\r
- }\r
- \r
- resultSql = result.ToString();\r
- return resultSql;\r
- }\r
-\r
- bool BindReplace (StringBuilder result, string p) {\r
- // bind variable\r
- bool found = false;\r
-\r
- if(parmCollection.Contains(p) == true) {\r
- // parameter found\r
- MySqlParameter prm = parmCollection[p];\r
-\r
- // convert object to string and place\r
- // into SQL\r
- if(prm.Direction == ParameterDirection.Input) {\r
- string strObj = MySqlHelper.\r
- ObjectToString(prm.DbType, \r
- prm.Value);\r
- result.Append(strObj);\r
- }\r
- else\r
- result.Append(bindChar + p);\r
-\r
- found = true;\r
- }\r
- return found;\r
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- //MySqlDataReader dataReader = ExecuteReader ();
- //MySqlXmlTextReader textReader = new MySqlXmlTextReader (dataReader);
- //XmlReader xmlReader = new XmlTextReader (textReader);
- //return xmlReader;
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- // Used to marshal a field value from the database result set.
- // The indexed column data on the current result set row.
- // res = the result set from a MySql.Query().
- // index = the column index.
- internal string GetColumnData(IntPtr res, int index) {
- IntPtr str = Marshal.ReadIntPtr(res, index*IntPtr.Size);
- if (str == IntPtr.Zero)
- return "";
- string s = Marshal.PtrToStringAnsi(str);
- return s;
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (MySqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public MySqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- IDataParameterCollection IDbCommand.Parameters {
- get {
- return Parameters;
- }
- }
-
- public MySqlParameterCollection Parameters {
- get {
- return parmCollection;
- }
- }
-
- IDbTransaction IDbCommand.Transaction {
- get {
- return Transaction;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
- Transaction = (MySqlTransaction) value;
-
- }
- }
-
- public MySqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize()
- ~MySqlCommand () {
- Dispose (false);
- }
-
- #endregion //Destructors
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MyConnection.cs
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Daniel Morgan 2002
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Mono.Data.MySql {
-
- public sealed class MySqlConnection : Component, ICloneable, IDbConnection {
-
- #region Fields
-
- private IntPtr mysqlInitStruct = IntPtr.Zero;
- private IntPtr mysqlConn = IntPtr.Zero;
-
- private string connectionString = "";
- private string mysqlConnectionString = "";
-
- private MySqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // MySQL connection string parameters
- string host = "";
- string user = "";
- string passwd = "";
- string dbname = "";
- uint port = MySql.Port;
- string socketName = "";
- uint flags = 0;
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- //private MySqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public MySqlConnection () {
-
- }
-
- [MonoTODO]
- public MySqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- trans = null;
- }
- // release any unmanaged resources
- mysqlInitStruct = IntPtr.Zero;
- IntPtr mysqlConn = IntPtr.Zero;
-
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize
- ~MySqlConnection() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- return BeginTransaction ();
- }
-
- public MySqlTransaction BeginTransaction () {
- return TransactionBegin (); // call private method
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- return BeginTransaction (il);
- }
-
- public MySqlTransaction BeginTransaction (IsolationLevel il) {
- return TransactionBegin (il); // call private method
- }
-
- [MonoTODO]
- public MySqlTransaction BeginTransaction(string transactionName) {
-
- // FIXME: Can MySQL handle named transactions?
- return TransactionBegin (); // call private method
- }
-
- [MonoTODO]
- public MySqlTransaction BeginTransaction(IsolationLevel iso,\r
- string transactionName) {
-
- // FIXME: Can MySQL handle named transactions?
- return TransactionBegin (iso); // call private method
- }
-
- public void ChangeDatabase (string databaseName) {
- dbname = databaseName;
- int sdb = MySql.SelectDb(mysqlInitStruct, dbname);
- if (sdb != 0) {
- string msg =
- "MySql Error: " +
- "Can not select the " +
- dbname +
- " database because: " +
- MySql.Error(mysqlInitStruct);
- throw new MySqlException (msg);
- }
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public MySqlCommand CreateCommand () {
- MySqlCommand sqlcmd = new MySqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
- else if(connectionString.Equals(String.Empty))
- throw new InvalidOperationException(
- "ConnectionString is not set");
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- mysqlInitStruct = MySql.Init(IntPtr.Zero);
- if (mysqlInitStruct == IntPtr.Zero) {
- throw new MySqlException("MySQL Init failed.");
- }
-
-
- // *** this is what it should be ***
- //mysqlConn = MySql.Connect(mysqlInitStruct,
- // host.Equals("") ? null : host,
- // user.Equals("") ? null : user,
- // passwd.Equals("") ? null : passwd,
- // dbname.Equals("") ? null : dbname,
- // port,
- // socketName.Equals("") ? null : socketName,
- // flags);
- //
- mysqlConn = MySql.Connect(mysqlInitStruct,
- host,
- user,
- passwd,
- dbname,
- port,
- socketName,
- flags);
- if (mysqlConn == IntPtr.Zero) {
- string msg = "MySQL Connect failed, " +
- MySql.Error(mysqlInitStruct);
- throw new MySqlException(msg);
- }
-
- this.ChangeDatabase (dbname);
-
- // Successfully Connected
- SetupConnection();
- }
-
- #endregion // Public Methods
-
- #region Protected Methods
-
- #endregion
-
- #region Internal Methods
-
- // Used to prevent MySqlConnection
- // from doing anything while
- // MySqlDataReader is open.
- // Open the Reader. (called from MySqlCommand)
- /*
- internal void OpenReader(MySqlDataReader reader) {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
- */
-
- // Used to prevent MySqlConnection
- // from doing anything while
- // MySqlDataReader is open
- // Close the Reader (called from MySqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection) {
- if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- private void SetupConnection() {
- conState = ConnectionState.Open;
-
- versionString = GetDatabaseServerVersion();
- }
-
- private string GetDatabaseServerVersion() {
- MySqlCommand cmd = new MySqlCommand("select version()",this);
- return (string) cmd.ExecuteScalar();
- }
-
- private void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- /*
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
- */
- conState = ConnectionState.Closed;
- MySql.Close(mysqlInitStruct);
- MySql.ThreadEnd();
- mysqlConn = IntPtr.Zero;
- }
- }
-
- void SetConnectionString (string connectionString) {
- this.connectionString = connectionString;
-
- connectionString += ";";
- NameValueCollection parameters = new NameValueCollection ();
-
- if (connectionString == String.Empty)
- return;
-
- bool inQuote = false;
- bool inDQuote = false;
-
- string name = String.Empty;
- string value = String.Empty;
- StringBuilder sb = new StringBuilder ();
-
- foreach (char c in connectionString) {
- switch (c) {
- case '\'':
- inQuote = !inQuote;
- break;
- case '"' :
- inDQuote = !inDQuote;
- break;
- case ';' :
- if (!inDQuote && !inQuote) {
- if (name != String.Empty && name != null) {
- value = sb.ToString ();
- parameters [name.ToUpper ().Trim ()] = value.Trim ();
- }
- name = String.Empty;
- value = String.Empty;
- sb = new StringBuilder ();
- }
- else
- sb.Append (c);
- break;
- case '=' :
- if (!inDQuote && !inQuote) {
- name = sb.ToString ();
- sb = new StringBuilder ();
- }
- else
- sb.Append (c);
- break;
- default:
- sb.Append (c);
- break;
- }
- }
-
- SetProperties (parameters);
- }
-
- private void SetProperties (NameValueCollection parameters) {
-
- StringBuilder connectionStr = new StringBuilder();
-
- string value;
- foreach (string name in parameters) {
- value = parameters[name];
-
- bool found = true;
- switch (name) {
- case "PORT" :
- port = UInt32.Parse(value);
- break;
- case "DATA SOURCE" :
- case "SERVER" :
- case "HOST" :
- // set DataSource property
- host = value;
- break;
- case "INITIAL CATALOG" :
- case "DATABASE" :
- case "DBNAME" :
- // set Database property
- dbname = value;
- break;
- case "PASSWORD" :
- case "PWD" :
- case "PASSWD" :
- passwd = value;
- break;
- case "USER ID" :
- case "UID" :
- case "USER" :
- user = value;
- break;
- case "SOCKETNAME":
- socketName = value;
- break;
- case "FLAGS" :
- // FIXME: how to get these flags and
- // and pass to MySQL?
- // flags is a bitfield
- flags = UInt32.Parse(value);
- break;
- default:
- found = false;
- // FIXME: throw exception?
- break;
- }
- if (found == true) {
- string valuePair = name + "=" + value;
- connectionStr.Append (valuePair + " ");
- }
- }
- this.mysqlConnectionString = connectionStr.ToString ();
- }
-
- private MySqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new MySqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private MySqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new MySqlTransaction ();
- // using internal methods of MySqlTransaction
- trans.SetConnection (this);
- trans.SetIsolationLevel (il);
- trans.Begin();
-
- return trans;
- }
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-
- // For Mono.Data.MySql classes
- // to get the current transaction
- // in progress - if any
- internal MySqlTransaction Transaction {
- get {
- return trans;
- }
- }
-
- // For Mono.Data.MySql classes
- // to get the unmanaged MySql connection
- internal IntPtr NativeMySqlConnection {
- get {
- return mysqlConn;
- }
- }
-
- // For Mono.Data.MySql classes
- // to get the unmanaged MySql connection
- internal IntPtr NativeMySqlInitStruct {
- get {
- return mysqlInitStruct;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-/*
- public event
- MyInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-*/
- #endregion
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlDataAdapter.cs
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) Daniel Morgan, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql
-{
- /// <summary>
- /// Represents a set of command-related properties that are used
- /// to fill the DataSet and update a data source, all this
- /// from a SQL database.
- /// </summary>
- public sealed class MySqlDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- #region Fields
-
- MySqlCommand deleteCommand;
- MySqlCommand insertCommand;
- MySqlCommand selectCommand;
- MySqlCommand updateCommand;
-
- static readonly object EventRowUpdated = new object();
- static readonly object EventRowUpdating = new object();
-
- #endregion
-
- #region Constructors
-
- public MySqlDataAdapter ()
- : this (new MySqlCommand ())
- {
- }
-
- public MySqlDataAdapter (MySqlCommand selectCommand)
- {
- DeleteCommand = new MySqlCommand ();
- InsertCommand = new MySqlCommand ();
- SelectCommand = selectCommand;
- UpdateCommand = new MySqlCommand ();
- }
-
- public MySqlDataAdapter (string selectCommandText, MySqlConnection selectConnection)
- : this (new MySqlCommand (selectCommandText, selectConnection))
- {
- }
-
- public MySqlDataAdapter (string selectCommandText, string selectConnectionString)
- : this (selectCommandText, new MySqlConnection (selectConnectionString))
- {
- }
-
- #endregion
-
- #region Properties
-
- public MySqlCommand DeleteCommand {
- get { return deleteCommand; }
- set { deleteCommand = value; }
- }
-
- public MySqlCommand InsertCommand {
- get { return insertCommand; }
- set { insertCommand = value; }
- }
-
- public MySqlCommand SelectCommand {
- get { return selectCommand; }
- set { selectCommand = value; }
- }
-
- public MySqlCommand UpdateCommand {
- get { return updateCommand; }
- set { updateCommand = value; }
- }
-
- IDbCommand IDbDataAdapter.DeleteCommand {
- get { return DeleteCommand; }
- set {
- if (!(value is MySqlCommand))
- throw new ArgumentException ();
- DeleteCommand = (MySqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.InsertCommand {
- get { return InsertCommand; }
- set {
- if (!(value is MySqlCommand))
- throw new ArgumentException ();
- InsertCommand = (MySqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.SelectCommand {
- get { return SelectCommand; }
- set {
- if (!(value is MySqlCommand))
- throw new ArgumentException ();
- SelectCommand = (MySqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.UpdateCommand {
- get { return UpdateCommand; }
- set {
- if (!(value is MySqlCommand))
- throw new ArgumentException ();
- UpdateCommand = (MySqlCommand)value;
- }
- }
-
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new MySqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
-
- protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new MySqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected override void OnRowUpdated (RowUpdatedEventArgs value)
- {
- MySqlRowUpdatedEventHandler handler = (MySqlRowUpdatedEventHandler) Events[EventRowUpdated];
- if ((handler != null) && (value is MySqlRowUpdatedEventArgs))
- handler (this, (MySqlRowUpdatedEventArgs) value);
- }
-
- protected override void OnRowUpdating (RowUpdatingEventArgs value)
- {
- MySqlRowUpdatingEventHandler handler = (MySqlRowUpdatingEventHandler) Events[EventRowUpdating];
- if ((handler != null) && (value is MySqlRowUpdatingEventArgs))
- handler (this, (MySqlRowUpdatingEventArgs) value);
- }
-
- #endregion // Methods
-
- #region Events and Delegates
-
- public event MySqlRowUpdatedEventHandler RowUpdated {
- add { Events.AddHandler (EventRowUpdated, value); }
- remove { Events.RemoveHandler (EventRowUpdated, value); }
- }
-
- public event MySqlRowUpdatingEventHandler RowUpdating {
- add { Events.AddHandler (EventRowUpdating, value); }
- remove { Events.RemoveHandler (EventRowUpdating, value); }
- }
-
- #endregion // Events and Delegates
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlDataReader.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace Mono.Data.MySql {
- /// <summary>
- /// Provides a means of reading one or more forward-only streams
- /// of result sets obtained by executing a command
- /// at a SQL database.
- /// </summary>
- public sealed class MySqlDataReader : MarshalByRefObject,
- IEnumerable, IDataReader, IDisposable, IDataRecord
- {
-
- #region Fields
-
- private MySqlCommand cmd;
-
- // field meta data
- private string[] fieldName;
- private MySqlEnumFieldTypes[] fieldType; // MySQL data type
- private DbType[] fieldDbType; // DbType translated from MySQL type
- private uint[] fieldLength;
- private uint[] fieldMaxLength;
- private uint[] fieldFlags;
- // field data value
- private object[] dataValue;
-
- private bool open = false;
-
- private int recordsAffected = -1;
- private int currentQuery = 0;
-
- private int currentRow = -1;
- private IntPtr res = IntPtr.Zero;
- private IntPtr row = IntPtr.Zero;
-
- private int numFields;
- private int numRows;
-
- private CommandBehavior cmdBehavior;
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- internal MySqlDataReader (MySqlCommand sqlCmd, CommandBehavior behavior) {
-
- cmd = sqlCmd;
- open = true;
- // cmd.OpenReader(this);
- cmdBehavior = behavior;
- }
-
- #endregion // Fields
-
- #region Public Methods
-
- [MonoTODO]
- public void Close() {
- open = false;
-
- // free MySqlDataReader resources in SqlCommand
- // and allow SqlConnection to be used again
- //cmd.CloseReader();
-
- // TODO: get parameters from result
-
- Dispose(true);
- }
-
- public DataTable GetSchemaTable() {
-
- DataTable dataTableSchema = null;
- // Only Results from SQL SELECT Queries
- // get a DataTable for schema of the result
- // otherwise, DataTable is null reference
- if(numFields > 0) {
-
- dataTableSchema = new DataTable ("SchemaTable");
-
- dataTableSchema.Columns.Add ("ColumnName", typeof (string));
- dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
- dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
- dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
- dataTableSchema.Columns.Add ("NumericScale", typeof (int));
- dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
- dataTableSchema.Columns.Add ("IsKey", typeof (bool));
- DataColumn dc = dataTableSchema.Columns["IsKey"];
- dc.AllowDBNull = true; // IsKey can have a DBNull
- dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
- dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
- dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
- dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
- dataTableSchema.Columns.Add ("DataType", typeof(Type));
- dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (int));
- dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
- dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
- dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
- dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
- dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
- dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
- dataTableSchema.Columns.Add ("IsLong", typeof (bool));
- dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-\r
- DataRow schemaRow;
-
- Type typ;
-
- for (int i = 0; i < numFields; i += 1 ) {
-
- schemaRow = dataTableSchema.NewRow ();
-
- schemaRow["ColumnName"] = fieldName[i];
- schemaRow["ColumnOrdinal"] = i + 1;
-
- schemaRow["ColumnSize"] = (int) fieldMaxLength[i];
- schemaRow["NumericPrecision"] = 0;
- schemaRow["NumericScale"] = 0;
-
- if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
- // TODO: need to get KeyInfo
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = false;
- }
- else {
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = DBNull.Value;
- }
- schemaRow["BaseCatalogName"] = "";
-
- schemaRow["BaseColumnName"] = fieldName[i];
- schemaRow["BaseSchemaName"] = "";
- schemaRow["BaseTableName"] = "";
-
- typ = MySqlHelper.DbTypeToSystemType (fieldDbType[i]);\r
- schemaRow["DataType"] = typ;\r
-
- schemaRow["AllowDBNull"] = false;
-
- schemaRow["ProviderType"] = (int) fieldType[i];
- schemaRow["IsAliased"] = false;
- schemaRow["IsExpression"] = false;
- schemaRow["IsIdentity"] = false;
- schemaRow["IsAutoIncrement"] = false;
- schemaRow["IsRowVersion"] = false;
- schemaRow["IsHidden"] = false;
- schemaRow["IsLong"] = false;
- schemaRow["IsReadOnly"] = false;
-
- dataTableSchema.Rows.Add (schemaRow);
- }
- }
-
- return dataTableSchema;
- }
-
- private void ClearFields () {
- numRows = 0;
- numFields = 0;
- fieldName = null;
- fieldType = null;
- fieldLength = null;
- fieldMaxLength = null;
- fieldFlags = null;
- dataValue = null;
- }
-
- public bool NextResult () {
-
- // reset
- recordsAffected = -1;
- currentRow = -1;
-
- bool resultReturned;
- res = cmd.NextResult (out resultReturned);
- if (resultReturned == false)
- return false; // no result returned
-
- if ((cmdBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult)
- if (currentQuery > 0) {
- if(res == IntPtr.Zero)
- recordsAffected = (int) MySql.AffectedRows(cmd.Connection.NativeMySqlInitStruct);
- ClearFields();
- return true; // result returned
- }
-
- if((cmdBehavior & CommandBehavior.SchemaOnly) == CommandBehavior.SchemaOnly) {
- ClearFields ();
- return false; // no result returned
- }
-
- if(res == IntPtr.Zero) {
- // no result set returned
- recordsAffected = (int) MySql.AffectedRows (cmd.Connection.NativeMySqlInitStruct);
- ClearFields();
- }
- else {
- dataValue = null;
-
- // get meta data about result set
- numRows = MySql.NumRows(res);
- numFields = MySql.NumFields(res);
- // get meta data about each field
- fieldName = new string[numFields];
- fieldType = new MySqlEnumFieldTypes[numFields];
- fieldLength = new uint[numFields];
- fieldMaxLength = new uint[numFields];
- fieldFlags = new uint[numFields];
-
- fieldDbType = new DbType[numFields];
-
- // marshal each meta data field
- // into field* arrays
- MySqlMarshalledField marshField = null;
- for (int i = 0; i < numFields; i++) {
- // marshal field
- marshField = (MySqlMarshalledField) Marshal.PtrToStructure(MySql.FetchField(res),
- typeof(MySqlMarshalledField));
-
- // copy memebers in marshalField to fields[i]
- fieldName[i] = marshField.Name;
- int myType = marshField.FieldType;
- fieldType[i] = (MySqlEnumFieldTypes) myType;
- fieldLength[i] = marshField.Length;
- fieldMaxLength[i] = marshField.MaxLength;
- fieldFlags[i] = marshField.Flags;
-
- fieldDbType[i] = MySqlHelper.MySqlTypeToDbType((MySqlEnumFieldTypes)fieldType[i]);
- marshField = null;
- }
- }
- return true; // result returned
- }
-
- public bool Read() {
-
- dataValue = null;
-
- if(currentRow < numRows - 1) {
-
- currentRow++;
-
- if(numFields > 0 && currentRow > 0)\r
- if((cmdBehavior & CommandBehavior.SingleRow) == \r
- CommandBehavior.SingleRow) {\r
-\r
- currentRow = numRows - 1;\r
- return false; // EOF\r
- }\r
-
- row = MySql.FetchRow (res);
- if (row == IntPtr.Zero) {
- MySql.FreeResult (res);
- res = IntPtr.Zero;
- return false; // EOF
- }
- else {
- dataValue = new object[numFields];
- for (int col = 0; col < numFields; col++) {
- GetDataValue (row, col);
- }
- }
- return true; // not EOF
- }
- return false; // EOF
- }
-
- void GetDataValue (IntPtr row, int col) {
- // marshal column data value
- string objValue = cmd.GetColumnData(row, col);
-
- // tranlate from native MySql c type
- // to a .NET type here
- dataValue[col] = MySqlHelper.ConvertDbTypeToSystem (fieldType[col],
- fieldDbType[col], objValue);
-
- // TODO: for CommandBehavior.SequentialAccess -
- // used for reading Large OBjects
- //if((cmdBehavior & CommandBehavior.SequentialAccess) ==
- // CommandBehavior.SequentialAccess) {
- //}
- }
-
- [MonoTODO]
- public byte GetByte (int i) {
- throw new NotImplementedException ();
- }
-
- // TODO: CommandBehavior.SequentialAccess
- // and handling LOBs
- [MonoTODO]
- public long GetBytes (int i, long fieldOffset,
- byte[] buffer, int bufferOffset,
- int length) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public char GetChar (int i) {
- throw new NotImplementedException ();
- }
-
- // TODO: CommandBehavior.SequentialAccess
- // and handling LOBs
- [MonoTODO]
- public long GetChars (int i, long fieldOffset,
- char[] buffer, int bufferOffset,
- int length) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDataReader GetData (int i) {
- throw new NotImplementedException ();
- }
-
- public string GetDataTypeName (int i) {
- return MySqlHelper.GetMySqlTypeName (fieldType[i]);
- }
-
- public DateTime GetDateTime(int i) {
- return (DateTime) dataValue[i];
- }
-
- public decimal GetDecimal(int i) {
- return (decimal) dataValue[i];
- }
-
- public double GetDouble(int i) {
- return (double) dataValue[i];
- }
-
- public Type GetFieldType(int i) {
- return MySqlHelper.DbTypeToSystemType (fieldDbType[i]);
- }
-
- public float GetFloat(int i) {
- return (float) dataValue[i];
- }
-
- public Guid GetGuid(int i) {
- throw new NotImplementedException ();
- }
-
- public short GetInt16(int i) {
- return (short) dataValue[i];
- }
-
- public int GetInt32(int i) {
- return (int) dataValue[i];
- }
-
- public long GetInt64(int i) {
- return (long) dataValue[i];
- }
-
- public string GetName(int i) {
- return fieldName[i];
- }
-
- public int GetOrdinal (string name) {
-
- int i;
-
- for(i = 0; i < numFields; i++) {
- if(fieldName[i].Equals (name))
- return i;
- }
-
- for(i = 0; i < numFields; i++) {
- string ta;
- string n;
-
- ta = fieldName[i].ToUpper ();
- n = name.ToUpper ();
-
- if(ta.Equals (n)) {
- return i;
- }
- }
-
- throw new MissingFieldException ("Missing field: " + name);
- }
-
- public string GetString (int i) {
- return (string) dataValue[i];
- }
-
- public object GetValue (int i) {
- return dataValue[i];
- }
-
- public int GetValues(object[] values)
- {
- Array.Copy (dataValue, values, dataValue.Length);
- return dataValue.Length;
- }
-
- public bool IsDBNull(int i) {
- if(dataValue[i] == DBNull.Value)
- return true;
- return false;
- }
-
- public bool GetBoolean(int i) {
- return (bool) dataValue[i];
- }
-
- IEnumerator IEnumerable.GetEnumerator () {
- return new DbEnumerator (this);
- }
-
- #endregion // Public Methods
-
- #region Destructors
-
- private void Dispose(bool disposing) {
- if(!this.disposed) {
- if(disposing) {
- // release any managed resources
- cmd = null;
- fieldName = null;
- fieldType = null;
- fieldDbType = null;
- fieldLength = null;
- fieldMaxLength = null;
- fieldFlags = null;
- dataValue = null;
- }
- // release any unmanaged resources
-
- // clear unmanaged MySQL result set
- row = IntPtr.Zero;
- if(res != IntPtr.Zero) {
- MySql.FreeResult(res);
- res = IntPtr.Zero;
- }
-
- // close any handles
- this.disposed = true;
- }
- }
-
- void IDisposable.Dispose() {
- Dispose(true);
- }
-
- // aka Finalize
- ~MySqlDataReader() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Properties
-
- public int Depth {
- get {
- return 0; // always return zero, unless
- // this provider will allow
- // nesting of a row
- }
- }
-
- public bool IsClosed {
- get {
- if(open == false)
- return true;
- else
- return false;
- }
- }
-
- public int RecordsAffected {
- get {
- return recordsAffected;
- }
- }
-
- public int FieldCount {
- get {
- return numFields;
- }
- }
-
- public object this[string name] {
- get {
- int i;
-
- for(i = 0; i < numFields; i++) {
- if(fieldName[i].Equals(name))
- return dataValue[i];
- }
-
- for(i = 0; i < numFields; i++) {
- string ta;
- string n;
-
- ta = fieldName[i].ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return dataValue[i];
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
- }
-
- public object this[int i] {
- get {
- return dataValue[i];
- }
- }
-
- #endregion // Properties
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlError
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql\r
-{\r
- public class MySqlError\r
- {\r
- private string message;\r
- private string source;\r
- private string sqlstate;\r
- private int nativeerror;\r
-\r
- #region Constructors
-\r
- internal MySqlError(string Source)\r
- {\r
- nativeerror = 1;\r
- source = Source;\r
- message = "Error in " + source;\r
- sqlstate = "";\r
- }\r
-\r
- #endregion // Constructors
-
- #region Properties
-\r
- public string Message\r
- {\r
- get\r
- {\r
- return message;\r
- }\r
- }\r
-\r
- public int NativeError\r
- {\r
- get\r
- {\r
- return nativeerror;\r
- }\r
- }\r
-\r
- public string Source\r
- {\r
- get\r
- {\r
- return source;\r
- }\r
- }\r
-\r
- public string SQLState\r
- {\r
- get\r
- {\r
- return sqlstate;\r
- }\r
- }\r
-
- #endregion // Properties
-\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlErrorCollection
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)Copyright 2002 Daniel Morgan
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql\r
-{\r
- public sealed class MySqlErrorCollection : ICollection, IEnumerable
- {
- #region Fields
-
- ArrayList list = new ArrayList ();
-
- #endregion // Fields
-
- #region Properties
-
- public int Count \r
- {
- get \r
- {
- return list.Count;
- }
- }
-
- public MySqlError this[int index] \r
- {
- get \r
- {
- return (MySqlError) list[index];
- }
- }
-
- object ICollection.SyncRoot \r
- {
- get \r
- {
- return list.SyncRoot;
- }
- }
-
- bool ICollection.IsSynchronized \r
- {
- get \r
- {
- return list.IsSynchronized;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public void Add (MySqlError error)
- {
- list.Add ((object) error);
- }
-
- [MonoTODO]
- public void CopyTo (Array array, int index)
- {
- ((MySqlError[])(list.ToArray ())).CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- #endregion // Methods
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.Exception
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)Copyright 2002 Daniel Morgan
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace Mono.Data.MySql {\r
- public class MySqlException : SystemException {\r
- MySqlErrorCollection errors;\r
-\r
- internal MySqlException (MySqlError error) : base (error.Message) {\r
- errors = new MySqlErrorCollection ();\r
- errors.Add (error);\r
- }\r
-\r
- internal MySqlException (string message) : base (message) {\r
- MySqlError error = new MySqlError (message);\r
- errors = new MySqlErrorCollection ();\r
- errors.Add (error);\r
- }\r
-\r
- #region Properties\r
-\r
- public int ErrorCode {
- get {
- return errors[0].NativeError;
- }
- }
-
- public MySqlErrorCollection Errors {
- get {
- return errors;
- }
- }
-
- public override string Source {
- get {
- return errors[0].Source;
- }
- }
-\r
- #endregion // Properties\r
-\r
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData (SerializationInfo si, StreamingContext context) {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlParameter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace Mono.Data.MySql
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally,
- /// its mapping to DataSet columns; and is implemented by .NET
- /// data providers that access data sources.
- /// </summary>
- //public sealed class MySqlParameter : MarshalByRefObject,
- // IDbDataParameter, IDataParameter, ICloneable
- public sealed class MySqlParameter : IDbDataParameter, IDataParameter
- {
- private string parmName;
- private DbType dbtype;
- private object objValue;
- private int size;
- private string sourceColumn;
- private ParameterDirection direction;
- private bool isNullable;
- private byte precision;
- private byte scale;
- private DataRowVersion sourceVersion;
- private int offset;
-
- [MonoTODO]
- public MySqlParameter () {
-
- }
-
- [MonoTODO]
- public MySqlParameter (string parameterName, object value) {
- this.parmName = parameterName;
- this.objValue = value;
- }
-
- [MonoTODO]
- public MySqlParameter(string parameterName, DbType dbType) {
- this.parmName = parameterName;
- this.dbtype = dbType;
- }
-
- [MonoTODO]
- public MySqlParameter(string parameterName, DbType dbType,
- int size) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- }
-
- [MonoTODO]
- public MySqlParameter(string parameterName, DbType dbType,
- int size, string sourceColumn) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- }
-
- [MonoTODO]
- public MySqlParameter(string parameterName, DbType dbType,
- int size, ParameterDirection direction,
- bool isNullable, byte precision,
- byte scale, string sourceColumn,
- DataRowVersion sourceVersion, object value) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- this.direction = direction;
- this.isNullable = isNullable;
- this.precision = precision;
- this.scale = scale;
- this.sourceVersion = sourceVersion;
- this.objValue = value;
- }
-
- [MonoTODO]
- public DbType DbType {
- get {
- return dbtype;
- }
- set {
- dbtype = value;
- }
- }
-
- [MonoTODO]
- public ParameterDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- [MonoTODO]
- public bool IsNullable {
- get {
- return isNullable;
- }
- }
-
- [MonoTODO]
- public int Offset {
- get {
- return offset;
- }
-
- set {
- offset = value;
- }
- }
-
-
- string IDataParameter.ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- public string ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- [MonoTODO]
- public string SourceColumn {
- get {
- return sourceColumn;
- }
-
- set {
- sourceColumn = value;
- }
- }
-
- [MonoTODO]
- public DataRowVersion SourceVersion {
- get {
- return sourceVersion;
- }
-
- set {
- sourceVersion = value;
- }
- }
-
- [MonoTODO]
- public object Value {
- get {
- return objValue;
- }
-
- set {
- objValue = value;
- }
- }
-
- [MonoTODO]
- public byte Precision {
- get {
- return precision;
- }
-
- set {
- precision = value;
- }
- }
-
- [MonoTODO]
- public byte Scale {
- get {
- return scale;
- }
-
- set {
- scale = value;
- }
- }
-
- [MonoTODO]
- public int Size
- {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- return parmName;
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlParameterCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-
-namespace Mono.Data.MySql
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object
- /// and their mappings to DataSet columns.
- /// </summary>
- public sealed class MySqlParameterCollection : MarshalByRefObject,
- IDataParameterCollection, IList, ICollection, IEnumerable
- {
- private ArrayList parameterList = new ArrayList();
-
- [MonoTODO]
- public IEnumerator GetEnumerator()
- {
- return new MySqlParameterEnumerator (parameterList);
- }
-
- public int Add( object value)
- {
- // Call the add version that receives a SqlParameter
-
- // Check if value is a MySqlParameter.
- CheckType(value);
- Add((MySqlParameter) value);
-
- return IndexOf (value);
- }
-
-
- public MySqlParameter Add(MySqlParameter value)
- {
- parameterList.Add(value);
- return value;
- }
-
-
- public MySqlParameter Add(string parameterName, object value)
- {
- MySqlParameter sqlparam = new MySqlParameter();
- sqlparam.Value = value;
- // TODO: Get the DbType from system type of value.
-
- return Add(sqlparam);
- }
-
-
- public MySqlParameter Add(string parameterName, DbType dbType)
- {
- MySqlParameter sqlparam = new MySqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.DbType = dbType;
- return Add(sqlparam);
- }
-
-
- public MySqlParameter Add(string parameterName,
- DbType dbType, int size)
- {
- MySqlParameter sqlparam = new MySqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.DbType = dbType;
- sqlparam.Size = size;
- return Add(sqlparam);
- }
-
-
- public MySqlParameter Add(string parameterName,
- DbType dbType, int size, string sourceColumn)
- {
- MySqlParameter sqlparam = new MySqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.DbType = dbType;
- sqlparam.Size = size;
- sqlparam.SourceColumn = sourceColumn;
- return Add(sqlparam);
- }
-
- [MonoTODO]
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
-
- public bool Contains(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return Contains(((MySqlParameter)value).ParameterName);
- }
-
-
- [MonoTODO]
- public bool Contains(string value)
- {
- for(int p = 0; p < parameterList.Count; p++) {
- if(((MySqlParameter)parameterList[p]).ParameterName.Equals(value))
- return true;
- }
- return false;
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- public int IndexOf(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return IndexOf(((MySqlParameter)value).ParameterName);
- }
-
-
- public int IndexOf(string parameterName)
- {
- int p = -1;
-
- for(p = 0; p < parameterList.Count; p++) {
- if(((MySqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
- return p;
- }
- return p;
- }
-
- [MonoTODO]
- public void Insert(int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count {
- get {
- return parameterList.Count;
- }
- }
-
- object IList.this[int index] {
- [MonoTODO]
- get {
- return (MySqlParameter) this[index];
- }
-
- [MonoTODO]
- set {
- this[index] = (MySqlParameter) value;
- }
- }
-
- public MySqlParameter this[int index] {
- get {
- return (MySqlParameter) parameterList[index];
- }
-
- set {
- parameterList[index] = (MySqlParameter) value;
- }
- }
-
- object IDataParameterCollection.this[string parameterName] {
- [MonoTODO]
- get {
- return this[parameterName];
- }
-
- [MonoTODO]
- set {
- CheckType(value);
- this[parameterName] = (MySqlParameter) value;
- }
- }
-
- public MySqlParameter this[string parameterName] {
- get {
- for(int p = 0; p < parameterList.Count; p++) {
- if(parameterName.Equals(((MySqlParameter)parameterList[p]).ParameterName))
- return (MySqlParameter) parameterList[p];
- }
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
-
- set {
- for(int p = 0; p < parameterList.Count; p++) {
- if(parameterName.Equals(((MySqlParameter)parameterList[p]).ParameterName))
- parameterList[p] = value;
- }
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
- }
-
- bool IList.IsFixedSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IList.IsReadOnly {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// This method checks if the parameter value is of
- /// MySqlParameter type. If it doesn't, throws an InvalidCastException.
- /// </summary>
- private void CheckType(object value)
- {
- if(!(value is MySqlParameter))
- throw new InvalidCastException("Only MySqlParameter objects can be used.");
- }
-
- private class MySqlParameterEnumerator : IEnumerator {\r
- public MySqlParameterEnumerator (IList list) {\r
- this.list = list;\r
- Reset ();\r
- }\r
-\r
- public object Current {\r
- get {\r
- if (ptr >= list.Count)\r
- throw new InvalidOperationException ();\r
-\r
- return list[ptr];\r
- }\r
- }\r
-\r
- public bool MoveNext () {\r
- if (ptr > list.Count)\r
- throw new InvalidOperationException ();\r
- \r
- return ++ ptr < list.Count;\r
- }\r
-\r
- public void Reset () {\r
- ptr = -1;\r
- }\r
-\r
- private IList list;\r
- private int ptr;\r
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlRowUpdatedEventArgs.cs
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// Copyright (C) Tim Coleman, 2002
-// Copyright (C) Daniel Morgan, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql {
- public sealed class MySqlRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- [MonoTODO]
- public MySqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new MySqlCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~MySqlRowUpdatedEventArgs ()
- {
- throw new NotImplementedException ();
- }
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlRowUpdatedEventHandler.cs
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Data.MySql {
- public delegate void MySqlRowUpdatedEventHandler(object sender, MySqlRowUpdatedEventArgs e);
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql
-{
- public sealed class MySqlRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- [MonoTODO]
- public MySqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new MySqlCommand Command {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~MySqlRowUpdatingEventArgs() {
- throw new NotImplementedException ();
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlRowUpdatingEventHandler.cs
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.MySql {
- public delegate void MySqlRowUpdatingEventHandler(object sender, MySqlRowUpdatingEventArgs e);
-}
+++ /dev/null
-//
-// Mono.Data.MySql.MySqlTransaction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.MySql
-{
- /// <summary>
- /// Represents a transaction to be performed on a SQL database.
- /// </summary>
- public sealed class MySqlTransaction : MarshalByRefObject,
- IDbTransaction, IDisposable
- {
- #region Fields
-
- private bool doingTransaction = false;
- private MySqlConnection conn = null;
- private IsolationLevel isolationLevel =
- IsolationLevel.ReadCommitted;
- // FIXME: What is the default isolation level for MySQL?
-
- private bool disposed = false;
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Commit ()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Commit transaction.");
-
- MySqlCommand cmd = new MySqlCommand("COMMIT", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- [MonoTODO]
- public void Rollback()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Rollback transaction.");
-
- MySqlCommand cmd = new MySqlCommand("ROLLBACK", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- // For MySQL, Rollback(string) will not be implemented
- // because MySQL does not support Savepoints
- [Obsolete]
- public void Rollback(string transactionName) {
- // throw new NotImplementedException ();
- Rollback();
- }
-
- // For MySQL, Save(string) will not be implemented
- // because MySQL does not support Savepoints
- [Obsolete]
- public void Save (string savePointName) {
- // throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Internal Methods to Mono.Data.MySql Assembly
-
- internal void Begin()
- {
- if(doingTransaction == true)
- throw new InvalidOperationException(
- "Transaction has begun " +
- "and MySQL does not " +
- "support nested transactions.");
-
- MySqlCommand cmd = new MySqlCommand("BEGIN", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = true;
- }
-
- internal void SetIsolationLevel(IsolationLevel isoLevel)
- {
- String sSql = "SET TRANSACTION ISOLATION LEVEL ";
-
- switch (isoLevel) {
- case IsolationLevel.ReadCommitted:
- sSql += "READ COMMITTED";
- break;
- case IsolationLevel.ReadUncommitted:
- sSql += "READ UNCOMMITTED";
- break;
- case IsolationLevel.RepeatableRead:
- sSql += "REPEATABLE READ";
- break;
- case IsolationLevel.Serializable:
- sSql += "SERIALIZABLE";
- break;
- default:
- // generate exception here for anything else
- break;
- }
- MySqlCommand cmd = new MySqlCommand(sSql, conn);
- cmd.ExecuteNonQuery();
-
- this.isolationLevel = isoLevel;
- }
-
- internal void SetConnection(MySqlConnection connection)
- {
- this.conn = connection;
- }
-
- #endregion // Internal Methods to System.Data.dll Assembly
-
- #region Properties
-
- IDbConnection IDbTransaction.Connection {
- get {
- return Connection;
- }
- }
-
- public MySqlConnection Connection {
- get {
- return conn;
- }
- }
-
- public IsolationLevel IsolationLevel {
- get {
- return isolationLevel;
- }
- }
-
- internal bool DoingTransaction {
- get {
- return doingTransaction;
- }
- }
-
- #endregion Properties
-
- #region Destructors
-
- // Destructors aka Finalize and Dispose
-
- private void Dispose(bool disposing) {
- if(!this.disposed) {
- if(disposing) {
- // release any managed resources
- conn = null;
- }
- // release any unmanaged resources
-
- // close any handles
- this.disposed = true;
- }
- }
-
- void IDisposable.Dispose() {
- Dispose(true);
- }
-
- // aka Finalize
- ~MySqlTransaction() {
- Dispose (false);
- }
- #endregion // Destructors
-
- }
-}
+++ /dev/null
-//
-// MySqlTypes.cs - enums, classes, and structs for handling MySql Types
-//
-// Assembly: Mono.Data.MySql.dll
-// Namespace: Mono.Data.MySql
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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
-using System.Collections;\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Text;\r
-
-namespace Mono.Data.MySql {
- internal enum MySqlEnumFieldTypes {
- FIELD_TYPE_DECIMAL,
- FIELD_TYPE_TINY,
- FIELD_TYPE_SHORT,
- FIELD_TYPE_LONG,
- FIELD_TYPE_FLOAT,
- FIELD_TYPE_DOUBLE,
- FIELD_TYPE_NULL,
- FIELD_TYPE_TIMESTAMP,
- FIELD_TYPE_LONGLONG,
- FIELD_TYPE_INT24,
- FIELD_TYPE_DATE,
- FIELD_TYPE_TIME,
- FIELD_TYPE_DATETIME,
- FIELD_TYPE_YEAR,
- FIELD_TYPE_NEWDATE,
- FIELD_TYPE_ENUM=247,
- FIELD_TYPE_SET=248,
- FIELD_TYPE_TINY_BLOB=249,
- FIELD_TYPE_MEDIUM_BLOB=250,
- FIELD_TYPE_LONG_BLOB=251,
- FIELD_TYPE_BLOB=252,
- FIELD_TYPE_VAR_STRING=253,
- FIELD_TYPE_STRING=254
- }
-
- sealed internal class MySqlHelper {
-
- public static string GetMySqlTypeName(MySqlEnumFieldTypes mysqlFieldType) {
-
- string typeName;
-
- switch(mysqlFieldType) {
- case MySqlEnumFieldTypes.FIELD_TYPE_DECIMAL:
- typeName = "decimal";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TINY:
- typeName = "tiny";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_SHORT:
- typeName = "short";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_LONG:
- typeName = "long";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_FLOAT:
- typeName = "float";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DOUBLE:
- typeName = "double";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_NULL:
- typeName = "null";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TIMESTAMP:
- typeName = "timestamp";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_LONGLONG:
- typeName = "longlong";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_INT24:
- typeName = "int24";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DATE:
- typeName = "date";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TIME:
- typeName = "time";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DATETIME:
- typeName = "datetime";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_YEAR:
- typeName = "year";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_NEWDATE:
- typeName = "newdate";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_ENUM:
- typeName = "enum";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_SET:
- typeName = "set";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TINY_BLOB:
- typeName = "tinyblob";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_MEDIUM_BLOB:
- typeName = "mediumblob";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_LONG_BLOB:
- typeName = "longblob";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_BLOB:
- typeName = "blob";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_VAR_STRING:
- typeName = "varchar";
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_STRING:
- typeName = "char";
- break;
- default:
- typeName = "text";
- break;
- }
- return typeName;
- }
-
- public static DbType MySqlTypeToDbType(MySqlEnumFieldTypes mysqlFieldType) {
- DbType dbType;
-
- // FIXME: verify these translation are correct
-
- switch(mysqlFieldType) {
- case MySqlEnumFieldTypes.FIELD_TYPE_DECIMAL:
- dbType = DbType.Decimal;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TINY:
- dbType = DbType.Int16;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_SHORT:
- dbType = DbType.Int16;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_LONG:
- dbType = DbType.Int32;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_FLOAT:
- dbType = DbType.Single;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DOUBLE:
- dbType = DbType.Double;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_NULL:
- dbType = DbType.String;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TIMESTAMP:
- dbType = DbType.String;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_LONGLONG:
- dbType = DbType.Int64;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_INT24:
- dbType = DbType.Int64;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DATE:
- dbType = DbType.Date;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TIME:
- dbType = DbType.Time;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_DATETIME:
- dbType = DbType.DateTime;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_YEAR:
- dbType = DbType.Int16;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_NEWDATE:
- dbType = DbType.Date;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_ENUM:
- dbType = DbType.Int32;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_SET:
- dbType = DbType.String;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_TINY_BLOB:
- case MySqlEnumFieldTypes.FIELD_TYPE_MEDIUM_BLOB:
- case MySqlEnumFieldTypes.FIELD_TYPE_LONG_BLOB:
- case MySqlEnumFieldTypes.FIELD_TYPE_BLOB:
- dbType = DbType.Binary;
- break;
- case MySqlEnumFieldTypes.FIELD_TYPE_VAR_STRING:
- case MySqlEnumFieldTypes.FIELD_TYPE_STRING:
- dbType = DbType.String;
- break;
- default:
- dbType = DbType.String;
- break;
- }
-
- return dbType;
- }
-
- // Translates System.Data.DbType to System.Type
- public static Type DbTypeToSystemType (DbType dType) {
-
- Type typ = null;
-
- switch(dType) {
- case DbType.String:
- typ = typeof(String);
- break;
- case DbType.Boolean:
- typ = typeof(Boolean);
- break;
- case DbType.Int16: \r
- typ = typeof(Int16);\r
- break;\r
- case DbType.Int32:\r
- typ = typeof(Int32);\r
- break;\r
- case DbType.Int64:\r
- typ = typeof(Int64);\r
- break;\r
- case DbType.Decimal:\r
- typ = typeof(Decimal);\r
- break;\r
- case DbType.Single:\r
- typ = typeof(Single);\r
- break;\r
- case DbType.Double:\r
- typ = typeof(Double);\r
- break;\r
- case DbType.Date:\r
- case DbType.Time:\r
- case DbType.DateTime:\r
- typ = typeof(DateTime);\r
- break;\r
- default:\r
- typ = typeof(String);\r
- break;\r
- }
- return typ;
- }
-
- // Converts data value from database to .NET System type.\r
- public static object ConvertDbTypeToSystem (MySqlEnumFieldTypes mysqlFieldType,
- DbType typ, String myValue) {
-
- object obj = null;
-
- //Console.WriteLine("DEBUG: ConvertDbTypeToSystem: " + myValue);
-
- // FIXME: how do you handle NULL and "" for MySQL correctly?
- if(myValue == null) {
- return DBNull.Value;
- }
- else if(myValue.Equals("")) {
- return DBNull.Value;
- }
-
- switch(mysqlFieldType) {
- case MySqlEnumFieldTypes.FIELD_TYPE_TIMESTAMP:
- if(myValue.Equals("00000000000000"))
- return DBNull.Value;
- break;
- }
-
- // Date, Time, and DateTime
- // are parsed based on ISO format
- // "YYYY-MM-DD hh:mi:ss"
-
- switch(typ) {
- case DbType.String:
- obj = String.Copy(myValue);
- break;
- case DbType.Boolean:
- obj = myValue.Equals("t");
- break;
- case DbType.Int16:\r
- obj = Int16.Parse(myValue);\r
- break;\r
- case DbType.Int32:\r
- obj = Int32.Parse(myValue);\r
- break;\r
- case DbType.Int64:\r
- obj = Int64.Parse(myValue);\r
- break;\r
- case DbType.Decimal:\r
- obj = Decimal.Parse(myValue);\r
- break;\r
- case DbType.Single:\r
- obj = Single.Parse(myValue);\r
- break;\r
- case DbType.Double:\r
- obj = Double.Parse(myValue);\r
- break;\r
- case DbType.Date:\r
- String[] sd = myValue.Split(new Char[] {'-'});\r
- obj = new DateTime(\r
- Int32.Parse(sd[0]), Int32.Parse(sd[1]), Int32.Parse(sd[2]),\r
- 0,0,0);\r
- break;\r
- case DbType.Time:\r
- String[] st = myValue.Split(new Char[] {':'});\r
- obj = new DateTime(0001,01,01,\r
- Int32.Parse(st[0]),Int32.Parse(st[1]),Int32.Parse(st[2]));\r
- break;\r
- case DbType.DateTime:\r
- Int32 YYYY,MM,DD,hh,mi,ss;\r
- YYYY = Int32.Parse(myValue.Substring(0,4));\r
- MM = Int32.Parse(myValue.Substring(5,2));\r
- DD = Int32.Parse(myValue.Substring(8,2));\r
- hh = Int32.Parse(myValue.Substring(11,2));\r
- mi = Int32.Parse(myValue.Substring(14,2));\r
- ss = Int32.Parse(myValue.Substring(17,2));\r
- obj = new DateTime(YYYY,MM,DD,hh,mi,ss,0);\r
- break;\r
- default:\r
- obj = String.Copy(myValue);\r
- break;\r
- }
-
- return obj;
- }
-
- // FIXME: handle NULLs correctly in MySQL
- public static string DBNullObjectToString(DbType dbtype) {
-
- string s = "";
-
- const string NullString = "''";
- const string Null = "NULL";
-
- switch(dbtype) {\r
- case DbType.String:
- s = NullString;
- break;
- case DbType.Boolean:
- s = NullString;
- break;
- case DbType.Int16:\r
- s = Null;\r
- break;\r
- case DbType.Int32:\r
- s = Null;\r
- break;\r
- case DbType.Int64:\r
- s = Null;\r
- break;\r
- case DbType.Decimal:\r
- s = Null;\r
- break;\r
- case DbType.Single:\r
- s = Null;\r
- break;\r
- case DbType.Double:\r
- s = Null;\r
- break;\r
- case DbType.Date:\r
- s = NullString;\r
- break;\r
- case DbType.Time:\r
- s = NullString;\r
- break;\r
- case DbType.DateTime:\r
- s = NullString;\r
- break;\r
- default:\r
- // default to DbType.String\r
- s = NullString;\r
- break;\r
- }
-
- return s;
- }
-
- // Convert a .NET System value type (Int32, String, Boolean, etc)
- // to a string that can be included within a SQL statement.
- // This is to methods provides the parameters support
- // for the MySQL .NET Data provider
- public static string ObjectToString(DbType dbtype, object obj) {\r
- \r
- string s = "";\r
-\r
- // FIXME: how do we handle NULLs?\r
- // code is untested\r
- if(obj.Equals(DBNull.Value)) {\r
- return DBNullObjectToString(dbtype);\r
- }\r
-\r
- // Date, Time, and DateTime are expressed in ISO format\r
- // which is "YYYY-MM-DD hh:mm:ss.ms";\r
- DateTime dt;\r
- StringBuilder sb;\r
-\r
- const string zero = "0";\r
-\r
- switch(dbtype) {\r
- case DbType.String:
- s = "'" + obj + "'";
- break;
- case DbType.Boolean:
- if((bool)obj == true)
- s = "'t'";
- else
- s = "'f'";
- break;
- case DbType.Int16:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Int32:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Int64:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Decimal:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Single:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Double:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Date:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // year\r
- if(dt.Year < 10)\r
- sb.Append("000" + dt.Year);\r
- else if(dt.Year < 100)\r
- sb.Append("00" + dt.Year);\r
- else if(dt.Year < 1000)\r
- sb.Append("0" + dt.Year);\r
- else\r
- sb.Append(dt.Year);\r
- sb.Append("-");\r
- // month\r
- if(dt.Month < 10)\r
- sb.Append(zero + dt.Month);\r
- else\r
- sb.Append(dt.Month);\r
- sb.Append("-");\r
- // day\r
- if(dt.Day < 10)\r
- sb.Append(zero + dt.Day);\r
- else\r
- sb.Append(dt.Day);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- case DbType.Time:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // hour\r
- if(dt.Hour < 10)\r
- sb.Append(zero + dt.Hour);\r
- else\r
- sb.Append(dt.Hour);\r
- sb.Append(":");\r
- // minute\r
- if(dt.Minute < 10)\r
- sb.Append(zero + dt.Minute);\r
- else\r
- sb.Append(dt.Minute);\r
- sb.Append(":");\r
- // second\r
- if(dt.Second < 10)\r
- sb.Append(zero + dt.Second);\r
- else\r
- sb.Append(dt.Second);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- case DbType.DateTime:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // year\r
- if(dt.Year < 10)\r
- sb.Append("000" + dt.Year);\r
- else if(dt.Year < 100)\r
- sb.Append("00" + dt.Year);\r
- else if(dt.Year < 1000)\r
- sb.Append("0" + dt.Year);\r
- else\r
- sb.Append(dt.Year);\r
- sb.Append("-");\r
- // month\r
- if(dt.Month < 10)\r
- sb.Append(zero + dt.Month);\r
- else\r
- sb.Append(dt.Month);\r
- sb.Append("-");\r
- // day\r
- if(dt.Day < 10)\r
- sb.Append(zero + dt.Day);\r
- else\r
- sb.Append(dt.Day);\r
- sb.Append(" ");\r
- // hour\r
- if(dt.Hour < 10)\r
- sb.Append(zero + dt.Hour);\r
- else\r
- sb.Append(dt.Hour);\r
- sb.Append(":");\r
- // minute\r
- if(dt.Minute < 10)\r
- sb.Append(zero + dt.Minute);\r
- else\r
- sb.Append(dt.Minute);\r
- sb.Append(":");\r
- // second\r
- if(dt.Second < 10)\r
- sb.Append(zero + dt.Second);\r
- else\r
- sb.Append(dt.Second);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- default:\r
- // default to DbType.String\r
- s = "'" + obj + "'";\r
- break;\r
- }
- return s;
- }
- }
-}
+++ /dev/null
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Mono.Data.MySql {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment {
- get { return comment; }
- }
- }
-}
+++ /dev/null
-//
-// Test.cs
-//
-// Used to Test the C# bindings to MySQL. This test
-// is based on the test that comes with MySQL.
-// Part of the C# bindings to MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-//
-// (C)Copyright 2002 Brad Merril
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using Mono.Data.MySql;
-
-///<remarks>
-///<para>
-/// MySql P/Invoke implementation test program
-/// Brad Merrill
-/// 3-Mar-2002
-///</para>
-///<para>
-/// This is based on the myTest.c program in the
-/// libmysqltest example directory of the mysql distribution.
-///</para>
-///<para>
-/// I noticed during implementation that the C api libraries are
-/// thread sensitive, in that they store information in the
-/// currently executing thread local storage. This is
-/// incompatible with the thread pool model in the CLR, in which
-/// you could be executing the same context on different
-/// threads.
-///</para>
-///<para>
-/// A better implementation would be to rewrite the libmysql
-/// layer in managed code, and do all the socket APIs, and mysql
-/// protocol using the .NET Framework APIs. However, that's a
-/// bit more than a weekend of work.
-///</para>
-///</remarks>
-public class Test {
- [STAThread]
- public static int Main() {
- Console.WriteLine("Test for MySQL C# Bindings started...");
- Console.Out.Flush();
- int rcq;
-
- string myDb = "test";
- string myStmt = "SELECT * FROM sometable";
- string insertStmt = "INSERT INTO SOMETABLE (TID,TDESC,AINT) VALUES ('MySQL','Mono.Data',12)";
-
- Console.WriteLine("MySql Init...");
- Console.Out.Flush();
- IntPtr db = MySql.Init(IntPtr.Zero);
- if (db == IntPtr.Zero) {
- Console.WriteLine("Error: Init failed.");
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("MySql Connection...");
- Console.Out.Flush();
- IntPtr conn = MySql.Connect(db, "", "", "", "", MySql.Port,
- "", (uint)0);
- //IntPtr conn = MySql.mysql_connect(db, null, null, null, null, MySql.Port,
- // null, (uint)0);
- if (conn == IntPtr.Zero) {
- Console.WriteLine("Error: Connect failed.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("MySql Selecting Database: " + myDb + "...");
- Console.Out.Flush();
- int sdb = MySql.SelectDb(db, myDb);
- if (sdb != 0) {
- Console.WriteLine("Error: Can not select the "+myDb+" database.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("Insert SQL: "+insertStmt);
- Console.Out.Flush();
- rcq = MySql.Query(db, insertStmt);
- if (rcq != 0) {
- Console.WriteLine("Couldn't execute ["+insertStmt+"] on server.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("Query: "+myStmt);
- Console.Out.Flush();
- rcq = MySql.Query(db, myStmt);
- if (rcq != 0) {
- Console.WriteLine("?Couldn't execute ["+myStmt+"] on server.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("Process Results...");
- Console.Out.Flush();
- procResults(db);
-
- Console.WriteLine("==== Diagnostic info ====");
- Console.Out.Flush();
- Console.WriteLine("Client info: "+MySql.GetClientInfo());
- Console.WriteLine("Host info: "+MySql.GetHostInfo(db));
- Console.WriteLine("Server info: "+MySql.GetServerInfo(db));
- Console.Out.Flush();
-
- Console.WriteLine("List Processes...");
- Console.Out.Flush();
- listProcesses(db);
- Console.WriteLine("List Tables...");
- Console.Out.Flush();
- listTables(db);
-
- Console.WriteLine("MySql Stat...");
- Console.Out.Flush();
- Console.WriteLine(MySql.Stat(db));
-
- Console.WriteLine("MySql Close...");
- Console.Out.Flush();
- MySql.Close(db);
-
- Console.WriteLine("MySql Thread End...");
- Console.Out.Flush();
- MySql.ThreadEnd();
-
- Console.WriteLine("Exiting...");
- Console.Out.Flush();
-
- return 0;
- }
-
- static void procResults(IntPtr db) {
- IntPtr res = MySql.StoreResult(db);
- int numRows = MySql.NumRows(res);
- Console.WriteLine("Number of records found: " + numRows);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Record #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" theField[[[" + fields[i] + "]]]\n");
- Console.Out.Flush();
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- Console.Out.Flush();
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-
- static string rowVal(IntPtr res, int index) {
- IntPtr str = Marshal.ReadIntPtr(res, index*IntPtr.Size);
- if (str == IntPtr.Zero)
- return "NULL";
- string s = Marshal.PtrToStringAnsi(str);
- return s;
- }
-
- static void listProcesses(IntPtr db) {
- IntPtr res = MySql.ListProcesses(db);
- if (res == IntPtr.Zero) {
- Console.WriteLine("Got error "+MySql.Error(db)+" when retreiving processlist");
- return;
- }
- int numRows = MySql.NumRows(res);
- Console.WriteLine("Number of records found: " + numRows);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Process #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-
- static void listTables(IntPtr db) {
- IntPtr res = MySql.ListTables(db, "%");
- if (res == IntPtr.Zero)
- return;
- int numRows = MySql.NumRows(res);
- Console.WriteLine("Number of records found: " + numRows);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Process #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-}
+++ /dev/null
-/* MySqlTest.cs - based on PostgresTest.cs which is based
- * on postgres-test.c in libgda
- *
- * Copyright (C) 2002 Gonzalo Paniagua Javier
- * Copyright (C) 2002 Daniel Morgan
- *
- * ORIGINAL AUTHOR:
- * Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
- * PORTING FROM C TO C# AUTHOR:
- * Daniel Morgan <danmorg@sc.rr.com>
- *
- * Permission was given from the original author, Gonzalo Paniagua Javier,
- * to port and include his original work in Mono.
- *
- * The original work falls under the LGPL, but the port to C# falls
- * under the X11 license.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-//
-// To compile on Windows using Cygwin, you will need to do:
-// mono C:/cygwin/home/danmorg/mono/install/bin/mcs.exe MySqlTest.cs -r System.Data.dll -r Mono.Data.MySql.dll
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using Mono.Data.MySql;
-
-namespace Test.Mono.Data.MySql {
-
- public class MySqlTest {
-
- // execute SQL CREATE TABLE Command using ExecuteNonQuery()
- public static void CreateTable (IDbConnection cnc) {
-
- IDbCommand createCommand = cnc.CreateCommand();
-
- createCommand.CommandText =
- "CREATE TABLE mono_mysql_test (" +
- "tinyint_value TINYINT," +\r
- "smallint_value SMALLINT," +\r
- "mediumint_value MEDIUMINT," +\r
- "int_value INT," +\r
- "integer_value INTEGER," +\r
- "bigint_value BIGINT," + \r
- "real_value REAL," + \r
- "double_value DOUBLE," + \r
- "float_value FLOAT," +\r
- "decimal_value DECIMAL(8,2)," + \r
- "numeric_value NUMERIC(15,2)," + \r
- "char_value CHAR(2)," + \r
- "varchar_value VARCHAR(5)," + \r
- "date_value DATE," + \r
- "time_value TIME," +\r
- "timestamp_value TIMESTAMP," +\r
- "datetime_value DATETIME," +\r
- "tinyblob_value TINYBLOB," +\r
- "blob_value BLOB," +\r
- "mediumblob_value MEDIUMBLOB," +\r
- "longblob_value LONGBLOB," +\r
- "tinytext_value TINYTEXT," +\r
- "text_value TEXT," +\r
- "mediumtext_value MEDIUMTEXT," +\r
- "longtext_value LONGTEXT," +\r
- "enum_value ENUM('dog','cat','bird','fish')," +\r
- "set_value SET('value1','value2','value3','value4'), " +\r
- "null_tinyint_value TINYINT," +\r
- "null_smallint_value SMALLINT," +\r
- "null_mediumint_value MEDIUMINT," +\r
- "null_int_value INT," +\r
- "null_integer_value INTEGER," +\r
- "null_bigint_value BIGINT," + \r
- "null_real_value REAL," + \r
- "null_double_value DOUBLE," + \r
- "null_float_value FLOAT," +\r
- "null_decimal_value DECIMAL(8,2)," + \r
- "null_numeric_value NUMERIC(15,2)," + \r
- "null_char_value CHAR(2)," + \r
- "null_varchar_value VARCHAR(5)," + \r
- "null_date_value DATE," + \r
- "null_time_value TIME," +\r
- "null_timestamp_value TIMESTAMP," +\r
- "null_datetime_value DATETIME," +\r
- "null_tinyblob_value TINYBLOB," +\r
- "null_blob_value BLOB," +\r
- "null_mediumblob_value MEDIUMBLOB," +\r
- "null_longblob_value LONGBLOB," +\r
- "null_tinytext_value TINYTEXT," +\r
- "null_text_value TEXT," +\r
- "null_mediumtext_value MEDIUMTEXT," +\r
- "null_longtext_value LONGTEXT," +\r
- "null_enum_value ENUM('dog','cat','bird','fish')," +\r
- "null_set_value SET('value1','value2','value3','value4') " +\r
- ") ";
-
- int rowsAffected;
- rowsAffected = createCommand.ExecuteNonQuery ();
- Console.WriteLine("Rows Affected: " + rowsAffected);
- }
-
- // execute SQL DROP TABLE Command using ExecuteNonQuery
- public static void DropTable (IDbConnection cnc) {
-
- IDbCommand dropCommand = cnc.CreateCommand ();
-
- dropCommand.CommandText =
- "DROP TABLE mono_mysql_test";
-
- int rowsAffected;
- rowsAffected = dropCommand.ExecuteNonQuery ();
- Console.WriteLine("Rows Affected: " + rowsAffected);
-
- }
-
- // execute stored procedure using ExecuteScalar()
- public static object CallStoredProcedure (IDbConnection cnc) {
-
- IDbCommand callStoredProcCommand = cnc.CreateCommand ();
- object data;
-
- callStoredProcCommand.CommandType =
- CommandType.StoredProcedure;
- callStoredProcCommand.CommandText =
- "version";
-
- data = callStoredProcCommand.ExecuteScalar ();
-
- return data;
- }
-
- // execute SQL INSERT Command using ExecuteNonQuery()
- public static void InsertData (IDbConnection cnc) {
-
- IDbCommand insertCommand = cnc.CreateCommand();
-
- insertCommand.CommandText =
- "INSERT INTO mono_mysql_test (" +
- "tinyint_value," +\r
- "smallint_value," +\r
- "mediumint_value," +\r
- "int_value," +\r
- "integer_value," +\r
- "bigint_value," + \r
- "real_value," + \r
- "double_value," + \r
- "float_value," +\r
- "decimal_value," + \r
- "numeric_value," + \r
- "char_value," + \r
- "varchar_value," + \r
- "date_value," + \r
- "time_value," +\r
- "timestamp_value," +\r
- "datetime_value," +\r
- "tinyblob_value," +\r
- "blob_value," +\r
- "mediumblob_value," +\r
- "longblob_value," +\r
- "tinytext_value," +\r
- "text_value," +\r
- "mediumtext_value," +\r
- "longtext_value," +\r
- "enum_value," +\r
- "set_value " +
- ") VALUES (" +
- "1,2,3,4,5,6, " +
- "1.1, 2.2, 3.3, " +
- "10.10, 11.11, " +
- "'AB','mono'," +
- "'2002-12-31', '11:15:07'," +
- "'20021231111507', '2002-12-31 11:15:07'," +
- "'fe','fi','fo','thumb','i','smell','some','food'," +
- "'cat', 'value2,value3' " +
- ")";
-
- int rowsAffected;
- rowsAffected = insertCommand.ExecuteNonQuery ();
- Console.WriteLine("Rows Affected: " + rowsAffected);
- }
-
- // execute a SQL SELECT Query using ExecuteReader() to retrieve
- // a IDataReader so we retrieve data
- public static IDataReader SelectData (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // FIXME: System.Data classes need to handle NULLs
- // this would be done by System.DBNull ?
- // FIXME: System.Data needs to handle more data types
-
- selectCommand.CommandText =
- "SELECT * " +
- "FROM mono_mysql_test";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
- // Tests a SQL Command (INSERT, UPDATE, DELETE)
- // executed via ExecuteReader
- public static IDataReader SelectDataUsingInsertCommand (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // This is a SQL INSERT Command, not a Query
- selectCommand.CommandText =
- "INSERT INTO mono_mysql_test (" +
- "tinyint_value," +\r
- "smallint_value," +\r
- "mediumint_value," +\r
- "int_value," +\r
- "integer_value," +\r
- "bigint_value," + \r
- "real_value," + \r
- "double_value," + \r
- "float_value," +\r
- "decimal_value," + \r
- "numeric_value," + \r
- "char_value," + \r
- "varchar_value," + \r
- "date_value," + \r
- "time_value," +\r
- "timestamp_value," +\r
- "datetime_value," +\r
- "tinyblob_value," +\r
- "blob_value," +\r
- "mediumblob_value," +\r
- "longblob_value," +\r
- "tinytext_value," +\r
- "text_value," +\r
- "mediumtext_value," +\r
- "longtext_value," +\r
- "enum_value," +\r
- "set_value " +
- ") VALUES (" +
- "91,92,93,94,95,96, " +
- "91.1, 92.2, 93.3, " +
- "910.10, 911.11, " +
- "'CD','mcs'," +
- "'2003-11-23', '10:24:45'," +
- "'20031123122445', '2003-11-23 10:24:45'," +
- "'ack','bleh','heh','pop','me','nope','yeah','fun'," +
- "'dog', 'value1,value3,value4' " +
- ")";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
- // Tests a SQL Command not (INSERT, UPDATE, DELETE)
- // executed via ExecuteReader
- public static IDataReader SelectDataUsingCommand (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // This is a SQL Command, not a Query
- selectCommand.CommandText =
- "SET AUTOCOMMIT=0";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
-
- // execute an SQL UPDATE Command using ExecuteNonQuery()
- public static void UpdateData (IDbConnection cnc) {
-
- IDbCommand updateCommand = cnc.CreateCommand();
-
- updateCommand.CommandText =
- "UPDATE mono_mysql_test " +
- "SET " +
- "int_value = 777 " +
- "WHERE char_value = 'AB'";
-
- updateCommand.ExecuteNonQuery ();
- }
-
- // used to do a min(), max(), count(), sum(), or avg()
- // execute SQL SELECT Query using ExecuteScalar
- public static object SelectAggregate (IDbConnection cnc, String agg) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- object data;
-
- Console.WriteLine("Aggregate: " + agg);
-
- selectCommand.CommandType = CommandType.Text;
- selectCommand.CommandText =
- "SELECT " + agg +
- "FROM mono_mysql_test";
-
- data = selectCommand.ExecuteScalar ();
-
- Console.WriteLine("Agg Result: " + data);
-
- return data;
- }
-
- // used internally by ReadData() to read each result set
- public 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
- string colName;\r
- string colValue;\r
- foreach (DataRow schemaRow in dt.Rows) {\r
- foreach (DataColumn schemaCol in dt.Columns) {\r
- colName = schemaCol.ColumnName;\r
- colValue = (schemaRow[schemaCol]).ToString();\r
- Console.WriteLine(colName + " = " + colValue);\r
- }\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
- metadataValue = \r
- " Col " + \r
- c + ": " + \r
- rdr.GetName(c);\r
- \r
- // column data\r
- if(rdr.IsDBNull(c) == true)\r
- dataValue = " is NULL";\r
- else\r
- dataValue = \r
- ": " + \r
- rdr.GetValue(c).ToString();\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
- nRows);
- }
-
- // Used to read data from IDataReader after calling IDbCommand:ExecuteReader()
- public static void ReadData(IDataReader rdr) {
-
- int results = 0;
- if(rdr == null) {
-
- Console.WriteLine("IDataReader has a Null Reference.");
- }
- else {
- do {\r
- results++;\r
- if(rdr.FieldCount > 0) {\r
- // Results for\r
- // SQL SELECT Queries\r
- // have RecordsAffected = -1\r
- // and GetSchemaTable() returns a reference to a DataTable\r
- DataTable dt = rdr.GetSchemaTable();\r
- Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);\r
- \r
- Console.WriteLine("Result Set " + results + "...");\r
-\r
- ReadResult(rdr, dt);\r
- }\r
- if(rdr.RecordsAffected >= 0) {\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 {\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
- }\r
- } while(rdr.NextResult());\r
- Console.WriteLine("Total Result sets: " + results);\r
- \r
- rdr.Close();
- }
- }
-
- /* MySQL provider tests */
- public static void PerformTest (IDbConnection cnc) {
-
- IDataReader reader;
- Object oDataValue;
-
- Console.WriteLine ("\tMySQL provider specific tests...\n");
-
- /* Drops the mono_mysql_test table. */
-
- Console.WriteLine ("\t\tDrop table: ");
- try {
- DropTable (cnc);
- Console.WriteLine ("OK");
- }
- catch (MySqlException e) {
- Console.WriteLine("Error (don't worry about this one)" + e);
- }
-
- try {
- /* Creates a table with all supported data types */
- Console.WriteLine ("\t\tCreate table with all supported types: ");
- CreateTable (cnc);
- Console.WriteLine ("OK");
-
- /* Inserts values */
- Console.WriteLine ("\t\tInsert values for all known types: ");
- InsertData (cnc);
- Console.WriteLine ("OK");
-
- /* Update values */
- Console.WriteLine ("\t\tUpdate values: ");
- UpdateData (cnc);
- Console.WriteLine ("OK");
-
- /* Inserts values */
- Console.WriteLine ("\t\tInsert values for all known types: ");
- InsertData (cnc);
- Console.WriteLine ("OK");
-
- /* Select aggregates */
- SelectAggregate (cnc, "count(*)");
- SelectAggregate (cnc, "avg(int_value)");
- SelectAggregate (cnc, "min(char_value)");
- SelectAggregate (cnc, "max(integer_value)");
- SelectAggregate (cnc, "sum(double_value)");
-
- /* Select values */
- Console.WriteLine ("\t\tSelect values from the database: ");
- reader = SelectData (cnc);
- ReadData(reader);
-
- /* SQL Command via ExecuteReader/MySqlDataReader */
- /* Command is not INSERT, UPDATE, or DELETE */
- Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Not INSERT,UPDATE,DELETE).");
- reader = SelectDataUsingCommand(cnc);
- ReadData(reader);
-
- /* SQL Command via ExecuteReader/MySqlDataReader */
- /* Command is INSERT, UPDATE, or DELETE */
- 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
- ((MySqlConnection)cnc).ServerVersion);\r
-\r
- /* Clean up */
- //Console.WriteLine ("Clean up...");
- //Console.WriteLine ("\t\tDrop table...");
- //DropTable (cnc);
- //Console.WriteLine("OK");
- }
- catch(Exception e) {
- Console.WriteLine("Exception caught: " + e);
- }
- }
-
- [STAThread]\r
- public static void Main(string[] args) {\r
-\r
- MySqlConnection dbconn = new MySqlConnection ();\r
- \r
- // ConnectionString can be:\r
- // "Server=localhost;Database=test;User ID=someuser;Password=somepass"\r
- // or it could be:\r
- // "host=localhost;dbname=test;user=someuser;passwd=somepass"\r
- string connectionString =
- "dbname=test;";\r
- dbconn.ConnectionString = connectionString;\r
-\r
- dbconn.Open();\r
- PerformTest(dbconn);
- dbconn.Close();
- }
- }
-}
+++ /dev/null
-
-namespace TestSystemDataSqlClient {
- using System;
- using System.Collections;
- using System.Data;
- using System.Data.Common;
- using Mono.Data.MySql;
-
- public class TestSqlDataAdapter {
- public static void Test() {
- string connectionString;
- string sqlQuery;
-
- MySqlDataAdapter adapter = null;
- DataSet dataSet = null;
-
- connectionString =
- "dbname=test;";
-
-
- sqlQuery = "select * from mono_mysql_test";
-
- System.Console.WriteLine ("new MySqlDataAdapter...");
- adapter = new MySqlDataAdapter (sqlQuery,
- connectionString);
-
- System.Console.WriteLine ("new DataSet...");
- dataSet = new DataSet ();
-
- System.Console.WriteLine("Fill...");
- adapter.Fill (dataSet, "Table1");
-
- System.Console.WriteLine ("Get Each Row in DataTable...");
- if (dataSet != null) {
-
- foreach (DataRow row in dataSet.Tables["Table1"].Rows)
- Console.WriteLine ("int_value: " +
- row["int_value"]);
-
- string filename = "DataSetTest.xml";
- Console.WriteLine ("Write DataSet to XML file: " +
- filename);
- dataSet.WriteXml (filename);
- }
- Console.WriteLine ("Done.");
-
- }
-
- public static void Main() {
- Test();
- }
- }
-}
+++ /dev/null
-//\r
-// Test/SqlDataRead.cs\r
-//\r
-// Test to do read a simple forward read only record set.\r
-// Using SqlCommand.ExecuteReader() to return a SqlDataReader\r
-// which can be used to Read a row\r
-// and Get a String or Int32.\r
-//\r
-// Author:\r
-// Daniel Morgan <danmorg@sc.rr.com>\r
-//\r
-// (C) 2002 Daniel Morgan\r
-//\r
-\r
-namespace TestSystemDataSqlClient {\r
- using System;\r
- using System.Data;\r
- using Mono.Data.MySql;\r
-\r
- class TestSqlDataReader {\r
-\r
- [STAThread]\r
- static void Main(string[] args) {\r
- Console.WriteLine("Started.");\r
-\r
- String connectionString = null;\r
- connectionString =
- "dbname=mysql";
- \r
- MySqlConnection con;\r
- Console.WriteLine("Create MySQL Connection...");\r
- con = new MySqlConnection(connectionString);\r
- Console.WriteLine("Open the connection...");\r
- con.Open();\r
-\r
- string sql;\r
- sql = "select * from db";\r
-\r
- Console.WriteLine("Create command...");\r
- MySqlCommand cmd;\r
- cmd = con.CreateCommand();\r
-\r
- cmd.CommandText = sql;\r
-\r
- MySqlDataReader reader;\r
- Console.WriteLine("ExecuteReader...");\r
- reader = cmd.ExecuteReader();\r
-\r
- int row = 0;\r
- Console.WriteLine("Reading data...");\r
- while(reader.Read()){\r
- row++;\r
- Console.WriteLine("Row: " + row);\r
- for(int col = 0; col < reader.FieldCount; col++) {\r
- Console.WriteLine(" Field: " + col);\r
- \r
- Console.WriteLine(" Name: " + \r
- reader.GetName(col));\r
- Console.WriteLine(" Value: " + \r
- reader.GetValue(col));\r
- }\r
- }\r
- Console.WriteLine("Clean up...");\r
-\r
- reader.Close();\r
- reader = null;\r
- cmd.Dispose();\r
- cmd = null;\r
- con.Close();\r
- con = null;\r
-\r
- Console.WriteLine("Done.");\r
- }\r
- }\r
-}\r
+++ /dev/null
-//
-// TestSqlExecuteScalar.cs
-//
-// To Test MySqlConnection and MySqlCommand by connecting
-// to a MySQL database
-// and then executing an SELECT SQL statement
-// using ExecuteScalar
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// selectStatement
-//
-// To test:
-// mcs TestMySqlExecuteScalar.cs -r System.Data.dll -r Mono.Data.MySql.dll
-// mono TestMySqlExecuteScalar.exe
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C)Copyright 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using Mono.Data.MySql;
-
-namespace TestMonoDataMysql {
- class TestMySqlInsert {
- [STAThread]
- static void Main(string[] args) {
- MySqlConnection conn;
- MySqlCommand cmd;
-
- String connectionString;
- String selectStatement;
-
- connectionString =
- "dbname=test";
-
- selectStatement =
- "select count(*)" +
- "from sometable";
-
- // Connect to a MySQL database
- Console.WriteLine ("Connect to database...");
- conn = new MySqlConnection(connectionString);
- conn.Open();
-
- // create SELECT command
- Console.WriteLine ("Create Command initializing " +
- "with an SELECT statement...");
- cmd = new MySqlCommand (selectStatement, conn);
-
- // execute the SELECT SQL command
- Console.WriteLine ("Execute SELECT SQL Command...");
- Object obj = cmd.ExecuteScalar();
- Console.WriteLine ("Object: " + obj.ToString());
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- }
- }
-}
+++ /dev/null
-//
-// TestSqlInsert.cs
-//
-// To Test MySqlConnection, MySqlCommand, and MySqlTransaction
-// by connecting to a MySQL database
-// and then executing some SQL statements
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// insertStatement
-// sqlToBeRolledBack
-//
-// To test:
-// mcs TestMySqlInsert.cs -r System.Data.dll -r Mono.Data.MySql.dll
-// mono TestMySqlInsert.exe
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C)Copyright 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using Mono.Data.MySql;
-
-namespace TestMonoDataMysql
-{
- class TestMySqlInsert
- {
- [STAThread]
- static void Main(string[] args)
- {
- MySqlConnection conn;
- MySqlCommand cmd;
- MySqlTransaction trans;
-
- int rowsAffected;
-
- String connectionString;
- String insertStatement;
- String deleteStatement;
-
- connectionString =
- "dbname=test";
-
- insertStatement =
- "insert into sometable " +
- "(tid, tdesc) " +
- "values ('beer', 'Beer for All!') ";
-
- deleteStatement =
- "delete from sometable " +
- "where tid = 'beer' ";
-
- // Connect to a MySQL database
- Console.WriteLine ("Connect to database...");
- conn = new MySqlConnection(connectionString);
- conn.Open();
-
- // begin transaction
- Console.WriteLine ("Begin Transaction...");
- trans = conn.BeginTransaction();
-
- // create SQL DELETE command
- Console.WriteLine ("Create Command initializing " +
- "with an DELETE statement...");
- cmd = new MySqlCommand (deleteStatement, conn);
-
- // execute the DELETE SQL command
- Console.WriteLine ("Execute DELETE SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // change the SQL command to an SQL INSERT Command
- Console.WriteLine ("Now use INSERT SQL Command...");
- cmd.CommandText = insertStatement;
-
- // execute the INSERT SQL command
- Console.WriteLine ("Execute INSERT SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // if successfull at INSERT, commit the transaction,
- // otherwise, do a rollback the transaction using
- // trans.Rollback();
- // FIXME: need to have exceptions working in
- // Mono.Data.MySql classes before you can do rollback
- Console.WriteLine ("Commit transaction...");
- trans.Commit();
-
- cmd = null;
- trans = null;
-
- string sqlToBeRolledBack =
- "insert into sometable " +
- "(tid, tdesc) " +
- "values ('beer', 'Will not be committed!') ";
-
- Console.WriteLine("Create new command to be rolled back");
- cmd = conn.CreateCommand();
- cmd.CommandText = sqlToBeRolledBack;
-
- Console.WriteLine("Test Begin Transaction");
- trans = conn.BeginTransaction();
-
- Console.WriteLine("Execute INSERT SQL...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- Console.WriteLine("Rollback Transaction...");
- trans.Rollback();
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- Console.WriteLine ("Verify data in database to " +
- "see if row is there.");
- }
- }
-}
+++ /dev/null
-//\r
-// TestParameters.cs - test parameters for the MySQL .NET Data Provider in Mono\r
-// using *Parameter and *ParameterCollection\r
-//\r
-// Note: it currently only tests input parameters. Output is next on the list.\r
-// Then output/input and return parameters.\r
-//\r
-// Author: \r
-// Daniel Morgan <danmorg@sc.rr.com>\r
-//\r
-// (c)copyright 2002 Daniel Morgan\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Data;\r
-using Mono.Data.MySql;\r
-\r
-namespace TestMonoDataMySql {\r
-\r
- public class TestParameters {\r
- public static void Main() {\r
- Console.WriteLine("** Start Test...");\r
- \r
- String connectionString = null;\r
- connectionString =
- "dbname=test";
- \r
- MySqlConnection con;\r
- Console.WriteLine("** Creating connection...");\r
- con = new MySqlConnection(connectionString);\r
- Console.WriteLine("** opening connection...");\r
- con.Open();\r
- \r
- string charValue = "CD";\r
-\r
- string sql;\r
- sql = "SELECT char_value, int_value FROM mono_mysql_test WHERE char_value = :inCharValue";\r
- \r
- Console.WriteLine("** Creating command...");\r
- MySqlCommand cmd = new MySqlCommand(sql, con);\r
- \r
- // add parameter for inTableName\r
- Console.WriteLine("** Create parameter...");\r
- MySqlParameter parm = new MySqlParameter("inCharValue", DbType.String); \r
- \r
- Console.WriteLine("** set direction of parameter to input");\r
- parm.Direction = ParameterDirection.Input;\r
- \r
- Console.WriteLine("** set the parameter value...");\r
- parm.Value = charValue;\r
- \r
- Console.WriteLine("** add parameter to parameters collection in the command...");\r
- cmd.Parameters.Add(parm);\r
- \r
- MySqlDataReader rdr;\r
- Console.WriteLine("** ExecuteReader()...");\r
- \r
- rdr = cmd.ExecuteReader();\r
- \r
- Console.WriteLine("[][] And now we are going to our results [][]...");\r
- int c;\r
- int results = 0;\r
- do {\r
- results++;\r
- Console.WriteLine("Result Set " + results + "...");\r
-\r
- // get the DataTable that holds\r
- // the schema\r
- DataTable dt = rdr.GetSchemaTable();\r
- \r
- // number of columns in the table\r
- Console.WriteLine(" Total Columns: " +\r
- dt.Columns.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
- string output, metadataValue, dataValue;\r
- int nRows = 0;\r
-\r
- // Read and display the rows\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: " + \r
- nRows);\r
- } while(rdr.NextResult());\r
- Console.WriteLine("Total Result sets: " + results);\r
-\r
- con.Close();\r
- }\r
- }\r
-}\r
+++ /dev/null
-.makefrag
-.response
-library-deps.stamp
+++ /dev/null
-2003-12-19 Tim Coleman <tim@timcoleman.com>
- * Mono.Data.PostgreSqlClient/PgSqlPermission.cs:
- Change constructor so it does not use base
- constructor without arguments. That constructor
- becomes obsolete in .NET 1.2, but it doesn't hurt
- to do it in other builds too.
-
-2002-12-06 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * Mono.Data.PostgreSqlClient/PgSqlCommand.cs: added\r
- public methods EscapeString() and EscapeByteArray()\r
- \r
- * Mono.Data.PostgreSqlClient/PostgresLibrary.cs: updated\r
- DllImport functions PQescapeString() and PQescapeBytea()\r
- \r
-2002-11-26 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * list: changed the name of the files beginning \r
- with Sql to PgSql. Added missing files to linux build.\r
- \r
- * makefile.gnu: added .dll to end of assembly names\r
- \r
- * Mono.Data.PostgreSqlClient: created new directory within\r
- mcs/class/Mono.Data.PostgreSqlClient\r
- \r
- * copy files from ./*.cs to ./Mono.Data.PostgreSqlClient/*.cs\r
- on cvs server (thanks to Miguel) \r
- \r
- * remove ./*.cs files\r
-\r
-2002-11-14 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * PgSqlConnection.cs: redid connection parameters\r
- based on SqlClient's SqlConnection \r
- \r
- * PgSqlCommand.cs: redid handling of different\r
- CommandType of CommandText, StoredProcedure, \r
- and TableDirect. Got rid of debug messages\r
-\r
-2002-11-01 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * PgSqlCommand.cs: get rid of warning\r
- \r
- * PgSqlDataReader.cs: implemented GetEnumerator(),\r
- and Dispose()\r
-\r
-2002-10-16 Daniel Morgan <danmorg@sc.rr.com>\r
-\r
- * ParmUtil.cs\r
- * PostgresLibrary.cs\r
- * PostgresTypes.cs\r
- * SqlClientPermission.cs\r
- * SqlClientPermissionAttribute.cs\r
- * SqlCommand.cs\r
- * SqlCommandBuilder.cs\r
- * SqlConnection.cs\r
- * SqlDataAdapter.cs\r
- * SqlDataReader.cs\r
- * SqlError.cs\r
- * SqlErrorCollection.cs\r
- * SqlException.cs\r
- * SqlInfoMessageEventArgs.cs\r
- * SqlInfoMessageEventHandler.cs\r
- * SqlParameter.cs\r
- * SqlParameterCollection.cs\r
- * SqlRowUpdatedEventArgs.cs\r
- * SqlRowUpdatedEventHandler.cs\r
- * SqlRowUpdatingEventArgs.cs\r
- * SqlRowUpdatingEventHandler.cs\r
- * SqlTransaction.cs: thanks to Miguel, he copied \r
- files on the mono cvs server\r
- from mcs/class/System.Data/System.Data.SqlClient \r
- for the PostgreSQL provider\r
- to mcs/class/Mono.Data.PostgreSqlClient. \r
- This frees up\r
- mcs/class/System.Data/System.Data.SqlClient for \r
- the Microsoft SQL Server provider. \r
- Any Mono.Data.PostgreSqlClient/Sql*.cs files\r
- were copied on the cvs server \r
- to Mono.Data.PostgreSqlClient/PgSql*.cs files \r
- and the old Mono.Data.PostgreSqlClient/Sql*.cs\r
- files were removed. Copying, renaming, and removing\r
- was done on the server so we could keep \r
- the cvs change history.\r
-\r
- * ChangeLog: added this file for logging changes\r
- \r
- * Mono.Data.PostgreSqlClient.build: added file for Windows build\r
-\r
- * library-deps.stamp \r
- * list\r
- * makefile.gnu: added for Linux build\r
-
- * Locale.cs: added file for Locale.GetText(string);
-
- * TODOAttribute.cs: added file for [MonoTODO] attribute
+++ /dev/null
-This module has been deprecated
+++ /dev/null
-thisdir = class/Mono.Data.PostgreSqlClient
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Data.PostgreSqlClient.dll
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Xml.dll /r:System.Data.dll
-NO_TEST = yes
-
-include ../../build/library.make
+++ /dev/null
-Mono.Data.PostgreSqlClient/Locale.cs
-Mono.Data.PostgreSqlClient/ParmUtil.cs
-Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
-Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
-Mono.Data.PostgreSqlClient/PgSqlCommand.cs
-Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
-Mono.Data.PostgreSqlClient/PgSqlConnection.cs
-Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
-Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
-Mono.Data.PostgreSqlClient/PgSqlError.cs
-Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
-Mono.Data.PostgreSqlClient/PgSqlException.cs
-Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
-Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
-Mono.Data.PostgreSqlClient/PgSqlParameter.cs
-Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
-Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
-Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
-Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
-Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
-Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
-Mono.Data.PostgreSqlClient/PostgresLibrary.cs
-Mono.Data.PostgreSqlClient/PostgresTypes.cs
-Mono.Data.PostgreSqlClient/TODOAttribute.cs
+++ /dev/null
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
+++ /dev/null
-//\r
-// ParmUtil.cs - utility to bind variables in a SQL statement to parameters in C# code\r
-// This is in the PostgreSQL .NET Data provider in Mono\r
-//\r
-// Author: \r
-// Daniel Morgan <danmorg@sc.rr.com>\r
-//\r
-// (c)copyright 2002 Daniel Morgan\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
-// comment DEBUG_ParmUtil for production, for debug messages, uncomment\r
-//#define DEBUG_ParmUtil\r
-\r
-using System;\r
-using System.Data;\r
-using System.Text;\r
-\r
-namespace Mono.Data.PostgreSqlClient {\r
-\r
- enum PostgresBindVariableCharacter {\r
- Semicolon,\r
- At,\r
- QuestionMark\r
- }\r
-\r
- public class ParmUtil {\r
-\r
- private string sql = "";\r
- private string resultSql = "";\r
- private PgSqlParameterCollection parmsCollection = null;\r
- \r
- static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;\r
- static char bindChar;\r
-\r
- // static constructor\r
- static ParmUtil() {\r
- switch(PgbindChar) {\r
- case PostgresBindVariableCharacter.Semicolon:\r
- bindChar = ':';\r
- break;\r
- case PostgresBindVariableCharacter.At:\r
- bindChar = '@';\r
- break;\r
- case PostgresBindVariableCharacter.QuestionMark:\r
- // this doesn't have named parameters,\r
- // they must be in order\r
- bindChar = '?';\r
- break;\r
- }\r
- }\r
- \r
- public ParmUtil(string query, PgSqlParameterCollection parms) {\r
- sql = query;\r
- parmsCollection = parms;\r
- }\r
- \r
- public string ResultSql {\r
- get {\r
- return resultSql;\r
- }\r
- }\r
-\r
- // TODO: currently only works for input variables,\r
- // need to do input/output, output, and return\r
- public string ReplaceWithParms() {\r
-\r
- StringBuilder result = new StringBuilder();\r
- char[] chars = sql.ToCharArray();\r
- bool bStringConstFound = false;\r
-\r
- for(int i = 0; i < chars.Length; i++) {\r
- if(chars[i] == '\'') {\r
- if(bStringConstFound == true)\r
- bStringConstFound = false;\r
- else\r
- bStringConstFound = true;\r
-\r
- result.Append(chars[i]);\r
- }\r
- else if(chars[i] == bindChar && \r
- bStringConstFound == false) {\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("Bind Variable character found...");\r
-#endif \r
- StringBuilder parm = new StringBuilder();\r
- i++;\r
- while(i <= chars.Length) {\r
- char ch;\r
- if(i == chars.Length)\r
- ch = ' '; // a space\r
- else\r
- ch = chars[i];\r
-\r
-#if DEBUG_ParmUtil \r
- Console.WriteLine("Is char Letter or digit?");\r
-#endif \r
- if(Char.IsLetterOrDigit(ch)) {\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("Char IS letter or digit. " + \r
- "Now, append char to parm StringBuilder");\r
-#endif\r
- parm.Append(ch);\r
- }\r
- else {\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("Char is NOT letter or char. " + \r
- "thus we got rest of bind variable name. ");\r
- \r
- // replace bind variable placeholder \r
- // with data value constant\r
- Console.WriteLine("parm StringBuilder to string p...");\r
-#endif\r
- string p = parm.ToString();\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("calling BindReplace...");\r
-#endif \r
- bool found = BindReplace(result, p);\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine(" Found = " + found);\r
-#endif\r
- if(found == true)\r
- break;\r
- else { \r
- // *** Error Handling\r
- Console.WriteLine("Error: parameter not found: " + p);\r
- return "";\r
- }\r
- }\r
- i++;\r
- }\r
- i--;\r
- }\r
- else \r
- result.Append(chars[i]);\r
- }\r
- \r
- resultSql = result.ToString();\r
- return resultSql;\r
- }\r
-\r
- public bool BindReplace (StringBuilder result, string p) {\r
- // bind variable\r
- bool found = false;\r
-\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("Does the parmsCollection contain the parameter???: " + p);\r
-#endif\r
- if(parmsCollection.Contains(p) == true) {\r
- // parameter found\r
-#if DEBUG_ParmUtil\r
- Console.WriteLine("Parameter Found: " + p);\r
-#endif\r
- PgSqlParameter prm = parmsCollection[p];\r
-\r
-#if DEBUG_ParmUtil \r
- // DEBUG \r
- Console.WriteLine(" Value: " + prm.Value);\r
- Console.WriteLine(" Direction: " + prm.Direction);\r
-#endif\r
- // convert object to string and place\r
- // into SQL\r
- if(prm.Direction == ParameterDirection.Input) {\r
- string strObj = PostgresHelper.\r
- ObjectToString(prm.DbType, \r
- prm.Value);\r
- result.Append(strObj);\r
- }\r
- else\r
- result.Append(bindChar + p);\r
-\r
- found = true;\r
- }\r
- return found;\r
- }\r
- }\r
-}\r
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlClientPermission.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace Mono.Data.PostgreSqlClient {
-
- public sealed class PgSqlClientPermission : DBDataPermission {
-
-#if NET_2_0
- [Obsolete ("use PgSqlClientPermission(PermissionState.None)", true)]
-#endif
- [MonoTODO]
- public PgSqlClientPermission()
-#if NET_2_0
- : base (PermissionState.None)
-#endif
- {
- }
-
- [MonoTODO]
- public PgSqlClientPermission(PermissionState state)
- : base (state)
- {
- // FIXME: do constructor
- }
-
-#if NET_2_0
- [Obsolete ("use PgSqlClientPermission(PermissionState.None)", true)]
-#endif
- [MonoTODO]
- public PgSqlClientPermission(PermissionState state, bool allowBlankPassword)
-#if NET_2_0
- : base (PermissionState.None)
-#endif
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Copy() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FromXml(SecurityElement
- securityElement) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Intersect(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsSubsetOf(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override SecurityElement ToXml() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Union(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~PgSqlClientPermission() {
- // FIXME: destructor to release resources
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlClientPermissionAttribute.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace Mono.Data.PostgreSqlClient {
-
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Struct |
- AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PgSqlClientPermissionAttribute :
- DBDataPermissionAttribute {
-
- [MonoTODO]
- public PgSqlClientPermissionAttribute(SecurityAction action) :
- base(action)
- {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public override IPermission CreatePermission() {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //~PgSqlClientPermissionAttribute() {
- // // FIXME: destructor to release resources
- //}
- }
-
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlCommand.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002 http://www.ximian.com/
-// (C) Daniel Morgan, 2002
-// (C) Copyright 2002 Tim Coleman
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)\r
-// http://www.gnome-db.org/\r
-// with permission from the authors of the\r
-// PostgreSQL provider in libgda:\r
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// use #define DEBUG_SqlCommand if you want to spew debug messages
-// #define DEBUG_SqlCommand
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Data.PostgreSqlClient {
- /// <summary>
- /// Represents a SQL statement that is executed
- /// while connected to a SQL database.
- /// </summary>
- // public sealed class PgSqlCommand : Component, IDbCommand, ICloneable
- public sealed class PgSqlCommand : IDbCommand {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private PgSqlConnection conn = null;
- private PgSqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- private PgSqlParameterCollection parmCollection = new
- PgSqlParameterCollection();
-
- // PgSqlDataReader state data for ExecuteReader()
- private PgSqlDataReader dataReader = null;
- private string[] queries = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- private ParmUtil parmUtil = null;
-
- #endregion // Fields
-
- #region Constructors
-
- public PgSqlCommand() {
- sql = "";
- }
-
- public PgSqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public PgSqlCommand (string cmdText, PgSqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- public PgSqlCommand (string cmdText, PgSqlConnection connection,
- PgSqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- return CreateParameter ();
- }
-
- [MonoTODO]
- public PgSqlParameter CreateParameter () {
- return new PgSqlParameter ();
- }
-
- public uint EscapeString (string to, string from, uint length) {
- uint result = PostgresLibrary.PQescapeString (out to, from, length);
- return result;
- }
-
- public byte[] EscapeByteArray (byte[] bintext, uint binlen,
- uint bytealen) {
-
- byte[] result;
- result = PostgresLibrary.PQescapeBytea (bintext,
- binlen, bytealen);
-
- return result;
- }
-
- public int ExecuteNonQuery () {
- IntPtr pgResult; // PGresult
- int rowsAffected = -1;
- ExecStatusType execStatus;
- String rowsAffectedString;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK ||
- execStatus == ExecStatusType.PGRES_TUPLES_OK ) {
-
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
-
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.\r
- PQresultErrorMessage(pgResult);\r
-\r
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-\r
- throw new PgSqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);\r
- }
-
- return rowsAffected;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- return ExecuteReader ();
- }
-
- [MonoTODO]
- public PgSqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
- return ExecuteReader (behavior);
- }
-
- [MonoTODO]
- public PgSqlDataReader ExecuteReader (CommandBehavior behavior)
- {
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- cmdBehavior = behavior;
-
- queries = null;
- currentQuery = -1;
- dataReader = new PgSqlDataReader(this);
-
- queries = sql.Split(new Char[] {';'});
-
- dataReader.NextResult();
-
- return dataReader;
- }
-
- internal PgSqlResult NextResult()
- {
- PgSqlResult res = new PgSqlResult();
- res.Connection = this.Connection;
- res.Behavior = cmdBehavior;
- string statement;
-
- currentQuery++;
-
- res.CurrentQuery = currentQuery;
-
- if(currentQuery < queries.Length && queries[currentQuery].Equals("") == false) {
- res.SQL = queries[currentQuery];
- statement = TweakQuery(queries[currentQuery], cmdType);
- ExecuteQuery(statement, res);
- res.ResultReturned = true;
- }
- else {
- res.ResultReturned = false;
- }
-
- return res;
- }
-
- private string TweakQuery(string query, CommandType commandType) {
- string statement = "";
-
- // finish building SQL based on CommandType
- switch(commandType) {
- case CommandType.Text:
- // TODO: this parameters utility
- // currently only support input variables
- // need todo output, input/output, and return.
- parmUtil = new ParmUtil(query, parmCollection);
- statement = parmUtil.ReplaceWithParms();
- break;
- case CommandType.StoredProcedure:
- string sParmList = GetStoredProcParmList ();
- statement = "SELECT " + query + "(" + sParmList + ")";
- break;
- case CommandType.TableDirect:
- statement = "SELECT * FROM " + query;
- break;
- }
-
- return statement;
- }
-
- string GetStoredProcParmList () {
- StringBuilder s = new StringBuilder();
-
- int addedCount = 0;
- for(int p = 0; p < parmCollection.Count; p++) {
- PgSqlParameter prm = parmCollection[p];
- if(prm.Direction == ParameterDirection.Input) {\r
- string strObj = PostgresHelper.\r
- ObjectToString(prm.DbType, \r
- prm.Value);\r
- if(addedCount > 0)\r
- s.Append(",");\r
- s.Append(strObj);\r
- addedCount++;\r
- }
- }
- return s.ToString();
- }
-
- private void ExecuteQuery (string query, PgSqlResult res)
- {
- IntPtr pgResult;
-
- ExecStatusType execStatus;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- res.ExecStatus = execStatus;
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK ||
- execStatus == ExecStatusType.PGRES_COMMAND_OK) {
-
- res.BuildTableSchema(pgResult);
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.\r
- PQresultErrorMessage(pgResult);\r
-\r
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-\r
- throw new PgSqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);\r
- }
- }
-
- // since SqlCommand has resources so SqlDataReader
- // can do Read() and NextResult(), need to free
- // those resources. Also, need to allow this SqlCommand
- // and this SqlConnection to do things again.
- internal void CloseReader() {
- dataReader = null;
- queries = null;
-
- if((cmdBehavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) {
- conn.CloseReader(true);
- }
- else {
- conn.CloseReader(false);
- }
- }
-
- // only meant to be used between SqlConnectioin,
- // SqlCommand, and SqlDataReader
- internal void OpenReader(PgSqlDataReader reader) {
- conn.OpenReader(reader);
- }
-
- /// <summary>\r
- /// ExecuteScalar is used to retrieve one object
- /// from one result set \r
- /// that has one row and one column.\r
- /// It is lightweight compared to ExecuteReader.\r
- /// </summary>
- [MonoTODO]
- public object ExecuteScalar () {
- IntPtr pgResult; // PGresult
- ExecStatusType execStatus;
- object obj = null; // return
- int nRow = 0; // first row
- int nCol = 0; // first column
- String value;
- int nRows;
- int nFields;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK) {
- // result was a SQL Command
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- return null; // return null reference
- }
- else if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- // result was a SQL Query
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- if(nRows > 0 && nFields > 0) {
-
- // get column name
- //String fieldName;
- //fieldName = PostgresLibrary.
- // PQfname(pgResult, nCol);
-
- int oid;
- string sType;
- DbType dbType;
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, nCol);
- sType = PostgresHelper.
- OidToTypname (oid, conn.Types);
- dbType = PostgresHelper.
- TypnameToSqlDbType(sType);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, nCol);
-
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- nRow, nCol);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- nRow, nCol);
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- nRow, nCol);
-
- obj = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- value);
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.\r
- PQresultErrorMessage(pgResult);\r
-\r
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-\r
- throw new PgSqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);\r
- }
-
- return obj;
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public PgSqlCommand Clone () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- // FIXME: for property Connection, is this the correct
- // way to handle a return of a stronger type?
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (PgSqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public PgSqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- // FIXME; for property Parameters, is this the correct
- // way to handle a stronger return type?
- IDataParameterCollection IDbCommand.Parameters {
- get {
- return Parameters;
- }
- }
-
- public PgSqlParameterCollection Parameters {
- get {
- return parmCollection;
- }
- }
-
- // FIXME: for property Transaction, is this the correct
- // way to handle a return of a stronger type?
- IDbTransaction IDbCommand.Transaction {
- get {
- return Transaction;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
-
- // csc
- Transaction = (PgSqlTransaction) value;
- // mcs
- // Transaction = value;
- }
- }
-
- public PgSqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose() {
- // FIXME: need proper way to release resources
- // Dispose(true);
- }
-
- [MonoTODO]
- ~PgSqlCommand() {
- // FIXME: need proper way to release resources
- // Dispose(false);
- }
-
- #endregion //Destructors
- }
-
- // SqlResult is used for passing Result Set data
- // from SqlCommand to SqlDataReader
- internal class PgSqlResult {
-
- private DataTable dataTableSchema = null; // only will contain the schema
- private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
- private int rowCount = 0;
- private int fieldCount = 0;
- private string[] pgtypes = null; // PostgreSQL types (typname)
- private bool resultReturned = false;
- private PgSqlConnection con = null;
- private int rowsAffected = -1;
- private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
- private int currentQuery = -1;
- private string sql = "";
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- internal CommandBehavior Behavior {
- get {
- return cmdBehavior;
- }
- set {
- cmdBehavior = value;
- }
- }
-
- internal string SQL {
- get {
- return sql;
- }
- set {
- sql = value;
- }
- }
-
- internal ExecStatusType ExecStatus {
- get {
- return execStatus;
- }
- set {
- execStatus = value;
- }
- }
-
- internal int CurrentQuery {
- get {
- return currentQuery;
- }
-
- set {
- currentQuery = value;
- }
-
- }
-
- internal PgSqlConnection Connection {
- get {
- return con;
- }
-
- set {
- con = value;
- }
- }
-
- internal int RecordsAffected {
- get {
- return rowsAffected;
- }
- }
-
- internal bool ResultReturned {
- get {
- return resultReturned;
- }
- set {
- resultReturned = value;
- }
- }
-
- internal DataTable Table {
- get {
- return dataTableSchema;
- }
- }
-
- internal IntPtr PgResult {
- get {
- return pg_result;
- }
- }
-
- internal int RowCount {
- get {
- return rowCount;
- }
- }
-
- internal int FieldCount {
- get {
- return fieldCount;
- }
- }
-
- internal string[] PgTypes {
- get {
- return pgtypes;
- }
- }
-
- internal void BuildTableSchema (IntPtr pgResult) {
- pg_result = pgResult;
-
- // need to set IDataReader.RecordsAffected property
- string rowsAffectedString;
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- // Only Results from SQL SELECT Queries
- // get a DataTable for schema of the result
- // otherwise, DataTable is null reference
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
-
- dataTableSchema = new DataTable ();
- dataTableSchema.Columns.Add ("ColumnName", typeof (string));
- dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
- dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
- dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
- dataTableSchema.Columns.Add ("NumericScale", typeof (int));
- dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
- dataTableSchema.Columns.Add ("IsKey", typeof (bool));
- DataColumn dc = dataTableSchema.Columns["IsKey"];
- dc.AllowDBNull = true; // IsKey can have a DBNull
- dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
- dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
- dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
- dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
- dataTableSchema.Columns.Add ("DataType", typeof(Type));
- dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (int));
- dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
- dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
- dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
- dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
- dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
- dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
- dataTableSchema.Columns.Add ("IsLong", typeof (bool));
- dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
- fieldCount = PostgresLibrary.PQnfields (pgResult);
- rowCount = PostgresLibrary.PQntuples(pgResult);
- pgtypes = new string[fieldCount];\r
-\r
- // TODO: for CommandBehavior.SingleRow\r
- // use IRow, otherwise, IRowset\r
- if(fieldCount > 0)\r
- if((cmdBehavior & CommandBehavior.SingleRow) == CommandBehavior.SingleRow)\r
- fieldCount = 1;\r
-
- // TODO: for CommandBehavior.SchemaInfo
- if((cmdBehavior & CommandBehavior.SchemaOnly) == CommandBehavior.SchemaOnly)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SingleResult
- if((cmdBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult)
- if(currentQuery > 0)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SequentialAccess - used for reading Large OBjects
- //if((cmdBehavior & CommandBehavior.SequentialAccess) == CommandBehavior.SequentialAccess) {
- //}
-
- DataRow schemaRow;
- int oid;
- DbType dbType;
- Type typ;
-
- for (int i = 0; i < fieldCount; i += 1 ) {
- schemaRow = dataTableSchema.NewRow ();
-
- string columnName = PostgresLibrary.PQfname (pgResult, i);
-
- schemaRow["ColumnName"] = columnName;
- schemaRow["ColumnOrdinal"] = i+1;
- schemaRow["ColumnSize"] = PostgresLibrary.PQfsize (pgResult, i);
- schemaRow["NumericPrecision"] = 0;
- schemaRow["NumericScale"] = 0;
- // TODO: need to get KeyInfo
- if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
- bool IsUnique, IsKey;
- GetKeyInfo(columnName, out IsUnique, out IsKey);
- }
- else {
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = DBNull.Value;
- }
- schemaRow["BaseCatalogName"] = "";
- schemaRow["BaseColumnName"] = columnName;
- schemaRow["BaseSchemaName"] = "";
- schemaRow["BaseTableName"] = "";
-
- // PostgreSQL type to .NET type stuff
- oid = PostgresLibrary.PQftype (pgResult, i);
- pgtypes[i] = PostgresHelper.OidToTypname (oid, con.Types); \r
- dbType = PostgresHelper.TypnameToSqlDbType (pgtypes[i]);\r
- \r
- typ = PostgresHelper.DbTypeToSystemType (dbType);\r
- string st = typ.ToString();\r
- schemaRow["DataType"] = typ;\r
-
- schemaRow["AllowDBNull"] = false;
- schemaRow["ProviderType"] = oid;
- schemaRow["IsAliased"] = false;
- schemaRow["IsExpression"] = false;
- schemaRow["IsIdentity"] = false;
- schemaRow["IsAutoIncrement"] = false;
- schemaRow["IsRowVersion"] = false;
- schemaRow["IsHidden"] = false;
- schemaRow["IsLong"] = false;
- schemaRow["IsReadOnly"] = false;
- schemaRow.AcceptChanges();
- dataTableSchema.Rows.Add (schemaRow);
- }
-
-#if DEBUG_SqlCommand
- Console.WriteLine("********** DEBUG Table Schema BEGIN ************");
- foreach (DataRow myRow in dataTableSchema.Rows) {\r
- foreach (DataColumn myCol in dataTableSchema.Columns)\r
- Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);\r
- Console.WriteLine();\r
- }
- Console.WriteLine("********** DEBUG Table Schema END ************");
-#endif // DEBUG_SqlCommand
-
- }
- }
-
- // TODO: how do we get the key info if
- // we don't have the tableName?
- private void GetKeyInfo(string columnName, out bool isUnique, out bool isKey) {
- isUnique = false;
- isKey = false;
-/*
- string sql;
-
- sql =
- "SELECT i.indkey, i.indisprimary, i.indisunique " +
- "FROM pg_class c, pg_class c2, pg_index i " +
- "WHERE c.relname = ':tableName' AND c.oid = i.indrelid " +
- "AND i.indexrelid = c2.oid ";
-*/
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlCommandBuilder.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.ComponentModel;
-
-namespace Mono.Data.PostgreSqlClient {\r
-\r
- /// <summary>\r
- /// Builder of one command\r
- /// that will be used in manipulating a table for\r
- /// a DataSet that is assoicated with a database.\r
- /// </summary>\r
- public sealed class PgSqlCommandBuilder : Component {\r
- \r
- [MonoTODO]\r
- public PgSqlCommandBuilder() {\r
-\r
- }\r
-\r
- [MonoTODO]\r
- public PgSqlCommandBuilder(PgSqlDataAdapter adapter) {\r
- \r
- }\r
-\r
- [MonoTODO]\r
- public PgSqlDataAdapter DataAdapter {\r
- get {\r
- throw new NotImplementedException ();\r
- }\r
- \r
- set{\r
- throw new NotImplementedException ();\r
- }\r
- }\r
-\r
- [MonoTODO]\r
- public string QuotePrefix {\r
- get {\r
- throw new NotImplementedException ();\r
- } \r
- \r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
-\r
- [MonoTODO]\r
- public string QuoteSuffix {\r
- get {\r
- throw new NotImplementedException ();\r
- }\r
- \r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
-\r
- [MonoTODO]\r
- public static void DeriveParameters(PgSqlCommand command) {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public PgSqlCommand GetDeleteCommand() {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public PgSqlCommand GetInsertCommand() {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public PgSqlCommand GetUpdateCommand() {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void RefreshSchema() {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void Dispose(bool disposing) {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- ~PgSqlCommandBuilder() {\r
- // FIXME: create destructor - release resources\r
- }\r
- }\r
-}\r
-\r
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlConnection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-// Copyright (C) Tim Coleman, 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)\r
-// http://www.gnome-db.org/\r
-// with permission from the authors of the\r
-// PostgreSQL provider in libgda:\r
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// use #define DEBUG_SqlConnection if you want to spew debug messages
-// #define DEBUG_SqlConnection
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Mono.Data.PostgreSqlClient {
-
- /// <summary>
- /// Represents an open connection to a SQL data source
- /// </summary>
- public sealed class PgSqlConnection : Component, IDbConnection,
- ICloneable
- {
- // FIXME: Need to implement class Component, \r
- // and interfaces: ICloneable and IDisposable
-
- #region Fields
-
- private PostgresTypes types = null;
- private IntPtr pgConn = IntPtr.Zero;
-
- // PGConn (Postgres Connection)
- private string connectionString = "";
- // OLE DB Connection String
- private string pgConnectionString = "";
- // PostgreSQL Connection String
- private PgSqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // connection parameters in connection string
- private string host = "";
- // Name of host to connect to
- private string hostaddr = "";
- // IP address of host to connect to
- // should be in "n.n.n.n" format
- private string port = "";
- // Port number to connect to at the server host
- private string dbname = ""; // The database name.
- private string user = ""; // User name to connect as.
- private string password = "";
- // Password to be used if the server
- // demands password authentication.
- private string options = "";
- // Trace/debug options to be sent to the server.
- private string tty = "";
- // A file or tty for optional
- // debug output from the backend.
- private string requiressl = "";
- // Set to 1 to require
- // SSL connection to the backend.
- // Libpq will then refuse to connect
- // if the server does not
- // support SSL. Set to 0 (default) to
- // negotiate with server.
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- private PgSqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public PgSqlConnection () {
-
- }
-
- [MonoTODO]
- public PgSqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize()
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- [MonoTODO]
- ~PgSqlConnection() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- return BeginTransaction ();
- }
-
- public PgSqlTransaction BeginTransaction () {
- return TransactionBegin (); // call private method
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- return BeginTransaction (il);
- }
-
- public PgSqlTransaction BeginTransaction (IsolationLevel il) {
- return TransactionBegin (il); // call private method
- }
-
- // PostgreSQL does not support named transactions/savepoint
- // nor nested transactions
- [Obsolete]
- public PgSqlTransaction BeginTransaction(string transactionName) {
- return TransactionBegin (); // call private method
- }
-
- [Obsolete]
- public PgSqlTransaction BeginTransaction(IsolationLevel iso,\r
- string transactionName) {
- return TransactionBegin (iso); // call private method
- }
-
- [MonoTODO]
- public void ChangeDatabase (string databaseName) {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public PgSqlCommand CreateCommand () {
- PgSqlCommand sqlcmd = new PgSqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
-
- ConnStatusType connStatus;
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- pgConn = PostgresLibrary.PQconnectdb
- (pgConnectionString);
-
- // FIXME: should we use PQconnectStart/PQconnectPoll
- // instead of PQconnectdb?
- // PQconnectdb blocks
- // PQconnectStart/PQconnectPoll is non-blocking
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus == ConnStatusType.CONNECTION_OK) {
- // Successfully Connected
- disposed = false;
-
- SetupConnection();
- }
- else {
- String errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
-
- throw new PgSqlException(0, 0,
- errorMessage, 0, "",
- host, "SqlConnection", 0);
- }
- }
-
- #endregion // Public Methods
-
- #region Internal Methods
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open.
- // Open the Reader. (called from SqlCommand)
- internal void OpenReader(PgSqlDataReader reader)
- {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- // Close the Reader (called from SqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection)
- { if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- void SetupConnection() {
-
- conState = ConnectionState.Open;
-
- // FIXME: load types into hashtable
- types = new PostgresTypes(this);
- types.Load();
-
- versionString = GetDatabaseServerVersion();
-
- // set DATE style to YYYY/MM/DD
- IntPtr pgResult = IntPtr.Zero;
- pgResult = PostgresLibrary.PQexec (pgConn, "SET DATESTYLE TO 'ISO'");
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- string GetDatabaseServerVersion()
- {
- PgSqlCommand cmd = new PgSqlCommand("select version()",this);
- return (string) cmd.ExecuteScalar();
- }
-
- void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
-
- conState = ConnectionState.Closed;
- PostgresLibrary.PQfinish (pgConn);
- pgConn = IntPtr.Zero;
- }
- }
-
- void SetConnectionString (string connectionString) {
- this.connectionString = connectionString;
- StringBuilder postgresConnectionString = new StringBuilder ();
-
- connectionString += ";";
- NameValueCollection parameters = new NameValueCollection ();
-
- if (connectionString == String.Empty)
- return;
-
- bool inQuote = false;
- bool inDQuote = false;
-
- string name = String.Empty;
- string value = String.Empty;
- StringBuilder sb = new StringBuilder ();
-
- foreach (char c in connectionString) {
- switch (c) {
- case '\'':
- inQuote = !inQuote;
- break;
- case '"' :
- inDQuote = !inDQuote;
- break;
- case ';' :
- if (!inDQuote && !inQuote) {
- if (name != String.Empty && name != null) {
- value = sb.ToString ();
- parameters [name.ToUpper ().Trim ()] = value.Trim ();
- }
- name = String.Empty;
- value = String.Empty;
- sb = new StringBuilder ();
- }
- else
- sb.Append (c);
- break;
- case '=' :
- if (!inDQuote && !inQuote) {
- name = sb.ToString ();
- sb = new StringBuilder ();
- }
- else
- sb.Append (c);
- break;
- default:
- sb.Append (c);
- break;
- }
- }
-
- SetProperties (parameters);
- }
-
- private void SetProperties (NameValueCollection parameters) {
- StringBuilder postgresConnectionString = new StringBuilder ();
-
- string value;
- foreach (string name in parameters) {
- value = parameters[name];
-
- bool found = true;
- switch (name) {
- case "PORT" :
- port = value;
- break;
- case "DATA SOURCE" :
- case "SERVER" :
- case "HOST" :
- // set DataSource property
- host = value;
- break;
- case "OPTIONS" :
- options = value;
- break;
- case "TTY" :
- tty = value;
- break;
- case "REQUIRESSL" :
- requiressl = value;
- break;
- case "ADDRESS" :
- case "ADDR" :
- case "NETWORK ADDRESS" :
- case "HOSTADDR" :
- hostaddr = value;
- break;
- case "INITIAL CATALOG" :
- case "DATABASE" :
- case "DBNAME":
- // set Database property
- dbname = value;
- break;
- case "PASSWORD" :
- case "PWD" :
- password = value;
- break;
- case "UID" :
- case "USER ID" :
- case "USER" :
- user = value;
- break;
- default:
- found = false;
- break;
- }
- if (found == true) {
- string valuePair = name.ToLower() + "=" + value;
- postgresConnectionString.Append (valuePair + " ");
- }
- }
- this.pgConnectionString = postgresConnectionString.ToString ();
- }
-
- private PgSqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new PgSqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private PgSqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new PgSqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.SetIsolationLevel (il);
- trans.Begin();
-
- return trans;
- }
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-
- // For System.Data.SqlClient classes
- // to get the current transaction
- // in progress - if any
- internal PgSqlTransaction Transaction {
- get {
- return trans;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the unmanaged PostgreSQL connection
- internal IntPtr PostgresConnection {
- get {
- return pgConn;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the list PostgreSQL types
- // so can look up based on OID to
- // get the .NET System type.
- internal ArrayList Types {
- get {
- return types.List;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-
- public event
- PgSqlInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-
- #endregion
-
- #region Inner Classes
-
- private class PostgresTypes {
- // TODO: create hashtable for
- // PostgreSQL types to .NET types
- // containing: oid, typname, SqlDbType
-
- private Hashtable hashTypes;
- private ArrayList pgTypes;
- private PgSqlConnection con;
-
- // Got this SQL with the permission from
- // the authors of libgda
- private const string SEL_SQL_GetTypes =
- "SELECT oid, typname FROM pg_type " +
- "WHERE typrelid = 0 AND typname !~ '^_' " +
- " AND typname not in ('SET', 'cid', " +
- "'int2vector', 'oidvector', 'regproc', " +
- "'smgr', 'tid', 'unknown', 'xid') " +
- "ORDER BY typname";
-
- internal PostgresTypes(PgSqlConnection sqlcon) {
-
- con = sqlcon;
- hashTypes = new Hashtable();
- }
-
- private void AddPgType(Hashtable types, \r
- string typname, DbType dbType) {\r
-\r
- PostgresType pgType = new PostgresType();\r
- \r
- pgType.typname = typname;\r
- pgType.dbType = dbType; \r
-\r
- types.Add(pgType.typname, pgType);\r
- }\r
-
- private void BuildTypes(IntPtr pgResult,
- int nRows, int nFields) {
-
- String value;
-
- int r;
- for(r = 0; r < nRows; r++) {
- PostgresType pgType =
- new PostgresType();
-
- // get data value (oid)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 0);
-
- pgType.oid = Int32.Parse(value);\r
-\r
- // get data value (typname)\r
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 1); \r
- pgType.typname = String.Copy(value);\r
- pgType.dbType = PostgresHelper.\r
- TypnameToSqlDbType(\r
- pgType.typname);\r
-\r
- pgTypes.Add(pgType);
- }
- pgTypes = ArrayList.ReadOnly(pgTypes);
- }
-
- internal void Load() {
- pgTypes = new ArrayList();
- IntPtr pgResult = IntPtr.Zero; // PGresult
-
- if(con.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
-
- if(pgResult.Equals(IntPtr.Zero)) {
- throw new PgSqlException(0, 0,
- "No Resultset from PostgreSQL", 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- else {
- ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- int nRows;
- int nFields;
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- BuildTypes (pgResult, nRows, nFields);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.\r
- PQresultErrorMessage(pgResult);\r
-\r
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-\r
- throw new PgSqlException(0, 0,
- errorMessage, 0, "",
- con.DataSource, "SqlConnection", 0);\r
- }
- }
- }
-
- public ArrayList List {
- get {
- return pgTypes;
- }
- }
- }
-
- #endregion
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Represents a set of command-related properties that are used
- /// to fill the DataSet and update a data source, all this
- /// from a SQL database.
- /// </summary>
- public sealed class PgSqlDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- #region Fields
-
- PgSqlCommand deleteCommand;
- PgSqlCommand insertCommand;
- PgSqlCommand selectCommand;
- PgSqlCommand updateCommand;
-
- static readonly object EventRowUpdated = new object();
- static readonly object EventRowUpdating = new object();
-
- #endregion
-
- #region Constructors
-
- public PgSqlDataAdapter ()
- : this (new PgSqlCommand ())
- {
- }
-
- public PgSqlDataAdapter (PgSqlCommand selectCommand)
- {
- DeleteCommand = new PgSqlCommand ();
- InsertCommand = new PgSqlCommand ();
- SelectCommand = selectCommand;
- UpdateCommand = new PgSqlCommand ();
- }
-
- public PgSqlDataAdapter (string selectCommandText, PgSqlConnection selectConnection)
- : this (new PgSqlCommand (selectCommandText, selectConnection))
- {
- }
-
- public PgSqlDataAdapter (string selectCommandText, string selectConnectionString)
- : this (selectCommandText, new PgSqlConnection (selectConnectionString))
- {
- }
-
- #endregion
-
- #region Properties
-
- public PgSqlCommand DeleteCommand {
- get {
- return deleteCommand;
- }
- set {
- deleteCommand = value;
- }
- }
-
- public PgSqlCommand InsertCommand {
- get {
- return insertCommand;
- }
- set {
- insertCommand = value;
- }
- }
-
- public PgSqlCommand SelectCommand {
- get {
- return selectCommand;
- }
- set {
- selectCommand = value;
- }
- }
-
- public PgSqlCommand UpdateCommand {
- get {
- return updateCommand;
- }
- set {
- updateCommand = value;
- }
- }
-
- IDbCommand IDbDataAdapter.DeleteCommand {
- get { return DeleteCommand; }
- set {
- if (!(value is PgSqlCommand))
- throw new ArgumentException ();
- DeleteCommand = (PgSqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.InsertCommand {
- get { return InsertCommand; }
- set {
- if (!(value is PgSqlCommand))
- throw new ArgumentException ();
- InsertCommand = (PgSqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.SelectCommand {
- get { return SelectCommand; }
- set {
- if (!(value is PgSqlCommand))
- throw new ArgumentException ();
- SelectCommand = (PgSqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.UpdateCommand {
- get { return UpdateCommand; }
- set {
- if (!(value is PgSqlCommand))
- throw new ArgumentException ();
- UpdateCommand = (PgSqlCommand)value;
- }
- }
-
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new PgSqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
-
- protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new PgSqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected override void OnRowUpdated (RowUpdatedEventArgs value)
- {
- PgSqlRowUpdatedEventHandler handler = (PgSqlRowUpdatedEventHandler) Events[EventRowUpdated];
- if ((handler != null) && (value is PgSqlRowUpdatedEventArgs))
- handler(this, (PgSqlRowUpdatedEventArgs) value);
- }
-
- protected override void OnRowUpdating (RowUpdatingEventArgs value)
- {
- PgSqlRowUpdatingEventHandler handler = (PgSqlRowUpdatingEventHandler) Events[EventRowUpdating];
- if ((handler != null) && (value is PgSqlRowUpdatingEventArgs))
- handler(this, (PgSqlRowUpdatingEventArgs) value);
- }
-
- #endregion // Methods
-
- #region Events and Delegates
-
- public event PgSqlRowUpdatedEventHandler RowUpdated {
- add { Events.AddHandler (EventRowUpdated, value); }
- remove { Events.RemoveHandler (EventRowUpdated, value); }
- }
-
- public event PgSqlRowUpdatingEventHandler RowUpdating {
- add { Events.AddHandler (EventRowUpdating, value); }
- remove { Events.RemoveHandler (EventRowUpdating, value); }
- }
-
- #endregion // Events and Delegates
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlDataReader.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)\r
-// http://www.gnome-db.org/\r
-// with permission from the authors of the\r
-// PostgreSQL provider in libgda:\r
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_SqlDataReader
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.PostgreSqlClient {
- /// <summary>
- /// Provides a means of reading one or more forward-only streams
- /// of result sets obtained by executing a command
- /// at a SQL database.
- /// </summary>
- public sealed class PgSqlDataReader : MarshalByRefObject,
- IEnumerable, IDataReader, IDisposable, IDataRecord {
-
- #region Fields
-
- private PgSqlCommand cmd;
- private DataTable table = null;
-
- // columns in a row
- private object[] fields; // data value in a .NET type
- private string[] types; // PostgreSQL Type
- private bool[] isNull; // is NULL?
- private int[] actualLength; // ActualLength of data
- private DbType[] dbTypes; // DB data type
- // actucalLength = -1 is variable-length
-
- private bool open = false;
- IntPtr pgResult; // PGresult
- private int rows;
- private int cols;
-
- private int recordsAffected = -1; // TODO: get this value
-
- private int currentRow = -1; // no Read() has been done yet
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- internal PgSqlDataReader (PgSqlCommand sqlCmd) {
-
- cmd = sqlCmd;
- open = true;
- cmd.OpenReader(this);
- }
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Close() {
- open = false;
-
- // free PgSqlDataReader resources in PgSqlCommand
- // and allow PgSqlConnection to be used again
- cmd.CloseReader();
-
- // TODO: get parameters from result
-
- Dispose (true);
- }
-
- [MonoTODO]
- public DataTable GetSchemaTable() {
- return table;
- }
-
- [MonoTODO]
- public bool NextResult() {
- PgSqlResult res;
- currentRow = -1;
- bool resultReturned;
-
- // reset
- table = null;
- pgResult = IntPtr.Zero;
- rows = 0;
- cols = 0;
- types = null;
- recordsAffected = -1;
-
- res = cmd.NextResult();
- resultReturned = res.ResultReturned;
-
- if(resultReturned == true) {
- table = res.Table;
- pgResult = res.PgResult;
- rows = res.RowCount;
- cols = res.FieldCount;
- types = res.PgTypes;
- recordsAffected = res.RecordsAffected;
- }
-
- res = null;
- return resultReturned;
- }
-
- [MonoTODO]
- public bool Read() {
-
- string dataValue;
- int c = 0;
-
- if(currentRow < rows - 1) {
-
- currentRow++;
-
- // re-init row
- fields = new object[cols];
- //dbTypes = new DbType[cols];
- actualLength = new int[cols];
- isNull = new bool[cols];
-
- for(c = 0; c < cols; c++) {
-
- // get data value
- dataValue = PostgresLibrary.
- PQgetvalue(
- pgResult,
- currentRow, c);
-
- // is column NULL?
- //isNull[c] = PostgresLibrary.
- // PQgetisnull(pgResult,
- // currentRow, c);
-
- // get Actual Length
- actualLength[c] = PostgresLibrary.
- PQgetlength(pgResult,
- currentRow, c);
-
- DbType dbType;
- dbType = PostgresHelper.
- TypnameToSqlDbType(types[c]);
-
- if(dataValue == null) {
- fields[c] = null;
- isNull[c] = true;
- }
- else if(dataValue.Equals("")) {
- fields[c] = null;
- isNull[c] = true;
- }
- else {
- isNull[c] = false;
- fields[c] = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- dataValue);
- }
- }
- return true;
- }
- return false; // EOF
- }
-
- [MonoTODO]
- public byte GetByte(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetBytes(int i, long fieldOffset,
- byte[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public char GetChar(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetChars(int i, long fieldOffset,
- char[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDataReader GetData(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetDataTypeName(int i) {
- return types[i];
- }
-
- [MonoTODO]
- public DateTime GetDateTime(int i) {
- return (DateTime) fields[i];
- }
-
- [MonoTODO]
- public decimal GetDecimal(int i) {
- return (decimal) fields[i];
- }
-
- [MonoTODO]
- public double GetDouble(int i) {
- return (double) fields[i];
- }
-
- [MonoTODO]
- public Type GetFieldType(int i) {
-
- DataRow row = table.Rows[i];
- return Type.GetType((string)row["DataType"]);
- }
-
- [MonoTODO]
- public float GetFloat(int i) {
- return (float) fields[i];
- }
-
- [MonoTODO]
- public Guid GetGuid(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public short GetInt16(int i) {
- return (short) fields[i];
- }
-
- [MonoTODO]
- public int GetInt32(int i) {
- return (int) fields[i];
- }
-
- [MonoTODO]
- public long GetInt64(int i) {
- return (long) fields[i];
- }
-
- [MonoTODO]
- public string GetName(int i) {
-
- DataRow row = table.Rows[i];
- return (string) row["ColumnName"];
- }
-
- [MonoTODO]
- public int GetOrdinal(string name) {
-
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(((string) row["ColumnName"]).Equals(name))
- return i;
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return i;
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
-
- [MonoTODO]
- public string GetString(int i) {
- return (string) fields[i];
- }
-
- [MonoTODO]
- public object GetValue(int i) {
- return fields[i];
- }
-
- [MonoTODO]
- public int GetValues(object[] values)
- {
- Array.Copy (fields, values, fields.Length);
- return fields.Length;
- }
-
- [MonoTODO]
- public bool IsDBNull(int i) {
- return isNull[i];
- }
-
- [MonoTODO]
- public bool GetBoolean(int i) {
- return (bool) fields[i];
- }
-
- [MonoTODO]
- IEnumerator IEnumerable.GetEnumerator () {
- return new DbEnumerator (this);
- }
-
- #endregion // Public Methods
-
- #region Destructors
-
- private void Dispose(bool disposing) {
- if(!this.disposed) {
- if(disposing) {
- // release any managed resources
- cmd = null;
- table = null;
- fields = null;
- types = null;
- isNull = null;
- actualLength = null;
- dbTypes = null;
- }
- // release any unmanaged resources
-
- // clear unmanaged PostgreSQL result set
- if (pgResult != IntPtr.Zero) {
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- // close any handles
- this.disposed = true;
- }
- }
-
- void IDisposable.Dispose() {
- Dispose(true);
- }
-
- ~PgSqlDataReader() {
- Dispose(false);
- }
-
- #endregion // Destructors
-
- #region Properties
-
- public int Depth {
- [MonoTODO]
- get {
- return 0; // always return zero, unless
- // this provider will allow
- // nesting of a row
- }
- }
-
- public bool IsClosed {
- [MonoTODO]
- get {
- if(open == false)
- return true;
- else
- return false;
- }
- }
-
- public int RecordsAffected {
- [MonoTODO]
- get {
- return recordsAffected;
- }
- }
-
- public int FieldCount {
- [MonoTODO]
- get {
- return cols;
- }
- }
-
- public object this[string name] {
- [MonoTODO]
- get {
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(row["ColumnName"].Equals(name))
- return fields[i];
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return fields[i];
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
- }
-
- public object this[int i] {
- [MonoTODO]
- get {
- return fields[i];
- }
- }
-
- #endregion // Properties
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class PgSqlError
- {
- byte theClass = 0;
- int lineNumber = 0;
- string message = "";
- int number = 0;
- string procedure = "";
- string server = "";
- string source = "";
- byte state = 0;
-
- internal PgSqlError(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
- this.theClass = theClass;
- this.lineNumber = lineNumber;
- this.message = message;
- this.number = number;
- this.procedure = procedure;
- this.server = server;
- this.source = source;
- this.state = state;
- }
-
- #region Properties
-
- [MonoTODO]
- /// <summary>
- /// severity level of the error
- /// </summary>
- public byte Class {
- get {
- return theClass;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- return lineNumber;
- }
- }
-
- [MonoTODO]
- public string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- return number;
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- return procedure;
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- return server;
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- return source;
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- return state;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString ()
- {
- String toStr;
- String stackTrace;
- stackTrace = " <Stack Trace>";
- // FIXME: generate the correct SQL error string
- toStr = "PgSqlError:" + message + stackTrace;
- return toStr;
- }
-
- internal void SetClass(byte theClass) {
- this.theClass = theClass;
- }
-
- internal void SetLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- internal void SetMessage(string message) {
- this.message = message;
- }
-
- internal void SetNumber(int number) {
- this.number = number;
- }
-
- internal void SetProcedure(string procedure) {
- this.procedure = procedure;
- }
-
- internal void SetServer(string server) {
- this.server = server;
- }
-
- internal void SetSource(string source) {
- this.source = source;
- }
-
- internal void SetState(byte state) {
- this.state = state;
- }
-
- #endregion
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class PgSqlErrorCollection : ICollection, IEnumerable
- {
- ArrayList errorList = new ArrayList();
-
- internal PgSqlErrorCollection() {
- }
-
- internal PgSqlErrorCollection(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public int Count {
- get {
- return errorList.Count;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index) {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- // [MonoTODO]
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- // Index property (indexer)
- // [MonoTODO]
- public PgSqlError this[int index] {
- get {
- return (PgSqlError) errorList[index];
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- internal void Add(PgSqlError error) {
- errorList.Add(error);
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- PgSqlError error = new PgSqlError(theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- Add(error);
- }
-
- #region Destructors
-
- [MonoTODO]
- ~PgSqlErrorCollection()
- {
- // FIXME: do the destructor - release resources
- }
-
- #endregion
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlException.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Data;
-using System.Runtime.Serialization;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Exceptions, as returned by SQL databases.
- /// </summary>
- public sealed class PgSqlException : SystemException
- {
- private PgSqlErrorCollection errors;
-
- internal PgSqlException()
- : base("a SQL Exception has occurred") {
- errors = new PgSqlErrorCollection();
- }
-
- internal PgSqlException(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state)
- : base(message) {
-
- errors = new PgSqlErrorCollection (theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public byte Class {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- else
- return errors[0].Class;
- }
-
- set {
- errors[0].SetClass(value);
- }
- }
-
- [MonoTODO]
- public PgSqlErrorCollection Errors {
- get {
- return errors;
- }
-
- set {
- errors = value;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- return errors[0].LineNumber;
- }
-
- set {
- errors[0].SetLineNumber(value);
- }
- }
-
- [MonoTODO]
- public override string Message {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else {
- String msg = "";
- int i = 0;
-
- for(i = 0; i < errors.Count - 1; i++) {
- msg = msg + errors[i].Message + "\n";
- }
- msg = msg + errors[i].Message;
-
- return msg;
- }
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].Number;
- }
-
- set {
- errors[0].SetNumber(value);
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Procedure;
- }
-
- set {
- errors[0].SetProcedure(value);
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Server;
- }
-
- set {
- errors[0].SetServer(value);
- }
- }
-
- [MonoTODO]
- public override string Source {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Source;
- }
-
- set {
- errors[0].SetSource(value);
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].State;
- }
-
- set {
- errors[0].SetState(value);
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo si,
- StreamingContext context) {
- // FIXME: to do
- }
-
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- public override string ToString() {
- String toStr = "";
- for (int i = 0; i < errors.Count; i++) {
- toStr = toStr + errors[i].ToString() + "\n";
- }
- return toStr;
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- errors.Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- [MonoTODO]
- ~PgSqlException() {
- // FIXME: destructor to release resources
- }
-
- #endregion // Methods
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.PostgreSqlClient
-{
- public sealed class PgSqlInfoMessageEventArgs : EventArgs
- {
- [MonoTODO]
- public PgSqlErrorCollection Errors {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Message
- {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- // representation of InfoMessage event
- return "'ToString() for SqlInfoMessageEventArgs Not Implemented'";
- }
-
- //[MonoTODO]
- //~PgSqlInfoMessageEventArgs() {
- // FIXME: destructor needs to release resources
- //}
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlInfoMessageEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.PostgreSqlClient
-{
- public delegate void
- PgSqlInfoMessageEventHandler (object sender,
- PgSqlInfoMessageEventArgs e);
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlParameter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally,
- /// its mapping to DataSet columns; and is implemented by .NET
- /// data providers that access data sources.
- /// </summary>
- //public sealed class PgSqlParameter : MarshalByRefObject,
- // IDbDataParameter, IDataParameter, ICloneable
- public sealed class PgSqlParameter : IDbDataParameter, IDataParameter
- {
- private string parmName;
- private SqlDbType dbtype;
- private DbType theDbType;
- private object objValue;
- private int size;
- private string sourceColumn;
- private ParameterDirection direction;
- private bool isNullable;
- private byte precision;
- private byte scale;
- private DataRowVersion sourceVersion;
- private int offset;
-
- [MonoTODO]
- public PgSqlParameter () {
-
- }
-
- [MonoTODO]
- public PgSqlParameter (string parameterName, object value) {
- this.parmName = parameterName;
- this.objValue = value;
- }
-
- [MonoTODO]
- public PgSqlParameter(string parameterName, SqlDbType dbType) {
- this.parmName = parameterName;
- this.dbtype = dbType;
- }
-
- [MonoTODO]
- public PgSqlParameter(string parameterName, SqlDbType dbType,
- int size) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- }
-
- [MonoTODO]
- public PgSqlParameter(string parameterName, SqlDbType dbType,
- int size, string sourceColumn) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- }
-
- [MonoTODO]
- public PgSqlParameter(string parameterName, SqlDbType dbType,
- int size, ParameterDirection direction,
- bool isNullable, byte precision,
- byte scale, string sourceColumn,
- DataRowVersion sourceVersion, object value) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- this.direction = direction;
- this.isNullable = isNullable;
- this.precision = precision;
- this.scale = scale;
- this.sourceVersion = sourceVersion;
- this.objValue = value;
- }
-
- [MonoTODO]
- public DbType DbType {
- get {
- return theDbType;
- }
- set {
- theDbType = value;
- }
- }
-
- [MonoTODO]
- public ParameterDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- [MonoTODO]
- public bool IsNullable {
- get {
- return isNullable;
- }
- }
-
- [MonoTODO]
- public int Offset {
- get {
- return offset;
- }
-
- set {
- offset = value;
- }
- }
-
-
- string IDataParameter.ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- public string ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- [MonoTODO]
- public string SourceColumn {
- get {
- return sourceColumn;
- }
-
- set {
- sourceColumn = value;
- }
- }
-
- [MonoTODO]
- public DataRowVersion SourceVersion {
- get {
- return sourceVersion;
- }
-
- set {
- sourceVersion = value;
- }
- }
-
- [MonoTODO]
- public SqlDbType SqlDbType {
- get {
- return dbtype;
- }
-
- set {
- dbtype = value;
- }
- }
-
- [MonoTODO]
- public object Value {
- get {
- return objValue;
- }
-
- set {
- objValue = value;
- }
- }
-
- [MonoTODO]
- public byte Precision {
- get {
- return precision;
- }
-
- set {
- precision = value;
- }
- }
-
- [MonoTODO]
- public byte Scale {
- get {
- return scale;
- }
-
- set {
- scale = value;
- }
- }
-
- [MonoTODO]
- public int Size
- {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- return parmName;
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlParameterCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object
- /// and their mappings to DataSet columns.
- /// </summary>
- // public sealed class PgSqlParameterCollection : MarshalByRefObject,
- // IDataParameterCollection, IList, ICollection, IEnumerable
- public sealed class PgSqlParameterCollection : IDataParameterCollection,
- IList
- {
- private ArrayList parameterList = new ArrayList();
-
- [MonoTODO]
- public IEnumerator GetEnumerator()
- {
- throw new NotImplementedException ();
- }
-
-
- public int Add( object value)
- {
- // Call the add version that receives a SqlParameter
-
- // Check if value is a PgSqlParameter.
- CheckType(value);
- Add((PgSqlParameter) value);
-
- return IndexOf (value);
- }
-
-
- public PgSqlParameter Add(PgSqlParameter value)
- {
- parameterList.Add(value);
- return value;
- }
-
-
- public PgSqlParameter Add(string parameterName, object value)
- {
- PgSqlParameter sqlparam = new PgSqlParameter();
- sqlparam.Value = value;
- // TODO: Get the dbtype and Sqldbtype from system type of value.
-
- return Add(sqlparam);
- }
-
-
- public PgSqlParameter Add(string parameterName, SqlDbType sqlDbType)
- {
- PgSqlParameter sqlparam = new PgSqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- return Add(sqlparam);
- }
-
-
- public PgSqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size)
- {
- PgSqlParameter sqlparam = new PgSqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- return Add(sqlparam);
- }
-
-
- public PgSqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size, string sourceColumn)
- {
- PgSqlParameter sqlparam = new PgSqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- sqlparam.SourceColumn = sourceColumn;
- return Add(sqlparam);
- }
-
- [MonoTODO]
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
-
- public bool Contains(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return Contains(((PgSqlParameter)value).ParameterName);
- }
-
-
- [MonoTODO]
- public bool Contains(string value)
- {
- for(int p = 0; p < parameterList.Count; p++) {
- if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(value))
- return true;
- }
- return false;
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- public int IndexOf(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return IndexOf(((PgSqlParameter)value).ParameterName);
- }
-
-
- public int IndexOf(string parameterName)
- {
- int p = -1;
-
- for(p = 0; p < parameterList.Count; p++) {
- if(((PgSqlParameter)parameterList[p]).ParameterName.Equals(parameterName))
- return p;
- }
- return p;
- }
-
- [MonoTODO]
- public void Insert(int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count {
- get {
- return parameterList.Count;
- }
- }
-
- object IList.this[int index] {
- [MonoTODO]
- get {
- return (PgSqlParameter) this[index];
- }
-
- [MonoTODO]
- set {
- this[index] = (PgSqlParameter) value;
- }
- }
-
- public PgSqlParameter this[int index] {
- get {
- return (PgSqlParameter) parameterList[index];
- }
-
- set {
- parameterList[index] = (PgSqlParameter) value;
- }
- }
-
- object IDataParameterCollection.this[string parameterName] {
- [MonoTODO]
- get {
- return this[parameterName];
- }
-
- [MonoTODO]
- set {
- CheckType(value);
- this[parameterName] = (PgSqlParameter) value;
- }
- }
-
- public PgSqlParameter this[string parameterName] {
- get {
- for(int p = 0; p < parameterList.Count; p++) {
- if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
- return (PgSqlParameter) parameterList[p];
- }
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
-
- set {
- for(int p = 0; p < parameterList.Count; p++) {
- if(parameterName.Equals(((PgSqlParameter)parameterList[p]).ParameterName))
- parameterList[p] = value;
- }
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
- }
-
- bool IList.IsFixedSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IList.IsReadOnly {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// This method checks if the parameter value is of
- /// PgSqlParameter type. If it doesn't, throws an InvalidCastException.
- /// </summary>
- private void CheckType(object value)
- {
- if(!(value is PgSqlParameter))
- throw new InvalidCastException("Only PgSqlParameter objects can be used.");
- }
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.PostgreSqlClient {
- public sealed class PgSqlRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- [MonoTODO]
- public PgSqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new PgSqlCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~PgSqlRowUpdatedEventArgs ()
- {
- throw new NotImplementedException ();
- }
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlRowUpdatedEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.PostgreSqlClient
-{
- public delegate void PgSqlRowUpdatedEventHandler(object sender,
- PgSqlRowUpdatedEventArgs e);
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.PostgreSqlClient
-{
- public sealed class PgSqlRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- [MonoTODO]
- public PgSqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new PgSqlCommand Command {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- ~PgSqlRowUpdatingEventArgs()
- {
- throw new NotImplementedException ();
- }
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlRowUpdatingEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data;
-
-namespace Mono.Data.PostgreSqlClient
-{
- public delegate void PgSqlRowUpdatingEventHandler(object sender,
- PgSqlRowUpdatingEventArgs e);
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PgSqlTransaction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// use #define DEBUG_SqlTransaction if you want to spew debug messages
-// #define DEBUG_SqlTransaction
-
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace Mono.Data.PostgreSqlClient
-{
- /// <summary>
- /// Represents a transaction to be performed on a SQL database.
- /// </summary>
- // public sealed class PgSqlTransaction : MarshalByRefObject,
- // IDbTransaction, IDisposable
- public sealed class PgSqlTransaction : IDbTransaction
- {
- #region Fields
-
- private bool doingTransaction = false;
- private PgSqlConnection conn = null;
- private IsolationLevel isolationLevel =
- IsolationLevel.ReadCommitted;
- // There are only two IsolationLevel's for PostgreSQL:
- // ReadCommitted and Serializable,
- // but ReadCommitted is the default
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Commit ()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Commit transaction.");
-
- PgSqlCommand cmd = new PgSqlCommand("COMMIT", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- [MonoTODO]
- public void Rollback()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Rollback transaction.");
-
- PgSqlCommand cmd = new PgSqlCommand("ROLLBACK", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- // For PostgreSQL, Rollback(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Rollback(string transactionName) {
- // throw new NotImplementedException ();
- Rollback();
- }
-
- // For PostgreSQL, Save(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Save (string savePointName) {
- // throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Internal Methods to Mono.Data.PostgreSqlClient.dll Assembly
-
- internal void Begin()
- {
- if(doingTransaction == true)
- throw new InvalidOperationException(
- "Transaction has begun " +
- "and PostgreSQL does not " +
- "support nested transactions.");
-
- PgSqlCommand cmd = new PgSqlCommand("BEGIN", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = true;
- }
-
- internal void SetIsolationLevel(IsolationLevel isoLevel)
- {
- String sSql = "SET TRANSACTION ISOLATION LEVEL ";
-
- switch (isoLevel) \r
- {
- case IsolationLevel.ReadCommitted:
- sSql += "READ COMMITTED";
- break;
-
- case IsolationLevel.Serializable:
- sSql += "SERIALIZABLE";
- break;
-
- default:
- // FIXME: generate exception here
- // PostgreSQL only supports:
- // ReadCommitted or Serializable
- break;
- }
- PgSqlCommand cmd = new PgSqlCommand(sSql, conn);
- cmd.ExecuteNonQuery();
-
- this.isolationLevel = isoLevel;
- }
-
- internal void SetConnection(PgSqlConnection connection)
- {
- this.conn = connection;
- }
-
- #endregion // Internal Methods to System.Data.dll Assembly
-
- #region Properties
-
- IDbConnection IDbTransaction.Connection {
- get {
- return Connection;
- }
- }
-
- public PgSqlConnection Connection {
- get {
- return conn;
- }
- }
-
- public IsolationLevel IsolationLevel {
- get {
- return isolationLevel;
- }
- }
-
- internal bool DoingTransaction {
- get {
- return doingTransaction;
- }
- }
-
- #endregion Properties
-
- #region Destructors
-
- // Destructors aka Finalize and Dispose
-
- [MonoTODO]
- public void Dispose()
- {
- // FIXME: need to properly release resources
- // Dispose(true);
- }
-
- // Destructor
- [MonoTODO]
- // [Serializable]\r
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- ~PgSqlTransaction() {
- // FIXME: need to properly release resources
- // Dispose(false);
- }
-
- #endregion // Destructors
-
- }
-}
+++ /dev/null
-//
-// Mono.Data.PostgreSqlClient.PostgresLibrary.cs
-//
-// PInvoke methods to libpq
-// which is PostgreSQL client library
-//
-// May also contain enumerations,
-// data types, or wrapper methods.
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_PostgresLibrary
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections;
-
-namespace Mono.Data.PostgreSqlClient {
-
- /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
-
- internal enum ConnStatusType
- {
- CONNECTION_OK,
- CONNECTION_BAD,
- CONNECTION_STARTED,
- CONNECTION_MADE,
- CONNECTION_AWAITING_RESPONSE,
- CONNECTION_AUTH_OK,
- CONNECTION_SETENV
- }
-
- internal enum PostgresPollingStatusType
- {
- PGRES_POLLING_FAILED = 0,
- PGRES_POLLING_READING,
- PGRES_POLLING_WRITING,
- PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE
- }
-
- internal enum ExecStatusType
- {
- PGRES_EMPTY_QUERY = 0,
- PGRES_COMMAND_OK,
- PGRES_TUPLES_OK,
- PGRES_COPY_OUT,
- PGRES_COPY_IN,
- PGRES_BAD_RESPONSE,
- PGRES_NONFATAL_ERROR,
- PGRES_FATAL_ERROR
- }
-
- sealed internal class PostgresLibrary
- {
- #region PInvoke Functions
-
- // pinvoke prototypes to PostgreSQL client library
- // pq.dll on windows and libpq.so on linux
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectStart (string conninfo);
- // PGconn *PQconnectStart(const char *conninfo);
-
- [DllImport("pq")]
- public static extern PostgresPollingStatusType PQconnectPoll (IntPtr conn);
- // PostgresPollingStatusType PQconnectPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectdb (string conninfo);
- // PGconn *PQconnectdb(const char *conninfo);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetdbLogin (string pghost,
- string pgport, string pgoptions,
- string pgtty, string dbName,
- string login, string pwd);
- // PGconn *PQsetdbLogin(const char *pghost,
- // const char *pgport, const char *pgoptions,
- // const char *pgtty, const char *dbName,
- // const char *login, const char *pwd);
-
- [DllImport("pq")]
- public static extern void PQfinish (IntPtr conn);
- // void PQfinish(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconndefaults ();
- // PQconninfoOption *PQconndefaults(void);
-
- [DllImport("pq")]
- public static extern void PQconninfoFree (IntPtr connOptions);
- // void PQconninfoFree(PQconninfoOption *connOptions);
-
- [DllImport("pq")]
- public static extern int PQresetStart (IntPtr conn);
- // int PQresetStart(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQresetPoll (IntPtr conn);
- // PostgresPollingStatusType PQresetPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQreset (IntPtr conn);
- // void PQreset(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQrequestCancel (IntPtr conn);
- // int PQrequestCancel(PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQdb (IntPtr conn);
- // char *PQdb(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQuser (IntPtr conn);
- // char *PQuser(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQpass (IntPtr conn);
- // char *PQpass(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQhost (IntPtr conn);
- // char *PQhost(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQport (IntPtr conn);
- // char *PQport(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQtty (IntPtr conn);
- // char *PQtty(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQoptions (IntPtr conn);
- // char *PQoptions(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern ConnStatusType PQstatus (IntPtr conn);
- // ConnStatusType PQstatus(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQerrorMessage (IntPtr conn);
- // char *PQerrorMessage(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsocket (IntPtr conn);
- // int PQsocket(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQbackendPID (IntPtr conn);
- // int PQbackendPID(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQclientEncoding (IntPtr conn);
- // int PQclientEncoding(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetClientEncoding (IntPtr conn,
- string encoding);
- // int PQsetClientEncoding(PGconn *conn,
- // const char *encoding);
-
- //FIXME: when loading, causes runtime exception
- //[DllImport("pq")]
- //public static extern IntPtr PQgetssl (IntPtr conn);
- // SSL *PQgetssl(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQtrace (IntPtr conn,
- IntPtr debug_port);
- // void PQtrace(PGconn *conn,
- // FILE *debug_port);
-
- [DllImport("pq")]
- public static extern void PQuntrace (IntPtr conn);
- // void PQuntrace(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetNoticeProcessor (IntPtr conn,
- IntPtr proc, IntPtr arg);
- // PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
- // PQnoticeProcessor proc, void *arg);
-
- [DllImport("pq")]
- public static extern uint PQescapeString (out string to,
- string from, uint length);
- // size_t PQescapeString(char *to,
- // const char *from, size_t length);
-
- [DllImport("pq")]
- public static extern byte[] PQescapeBytea (byte[] bintext,
- uint binlen, uint bytealen);
- // unsigned char *PQescapeBytea(unsigned char *bintext,
- // size_t binlen, size_t *bytealen);
-
- [DllImport("pq")]
- public static extern IntPtr PQexec (IntPtr conn,
- string query);
- // PGresult *PQexec(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQnotifies (IntPtr conn);
- // PGnotify *PQnotifies(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQfreeNotify (IntPtr notify);
- // void PQfreeNotify(PGnotify *notify);
-
- [DllImport("pq")]
- public static extern int PQsendQuery (IntPtr conn,
- string query);
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQgetResult (IntPtr conn);
- // PGresult *PQgetResult(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQisBusy (IntPtr conn);
- // int PQisBusy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQconsumeInput (IntPtr conn);
- // int PQconsumeInput(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQgetline (IntPtr conn,
- string str, int length);
- // int PQgetline(PGconn *conn,
- // char *string, int length);
-
- [DllImport("pq")]
- public static extern int PQputline (IntPtr conn,
- string str);
- // int PQputline(PGconn *conn,
- // const char *string);
-
- [DllImport("pq")]
- public static extern int PQgetlineAsync (IntPtr conn,
- string buffer, int bufsize);
- // int PQgetlineAsync(PGconn *conn, char *buffer,
- // int bufsize);
-
- [DllImport("pq")]
- public static extern int PQputnbytes (IntPtr conn,
- string buffer, int nbytes);
- // int PQputnbytes(PGconn *conn,
- //const char *buffer, int nbytes);
-
- [DllImport("pq")]
- public static extern int PQendcopy (IntPtr conn);
- // int PQendcopy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetnonblocking (IntPtr conn,
- int arg);
- // int PQsetnonblocking(PGconn *conn, int arg);
-
- [DllImport("pq")]
- public static extern int PQisnonblocking (IntPtr conn);
- // int PQisnonblocking(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQflush (IntPtr conn);
- // int PQflush(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQfn (IntPtr conn, int fnid,
- IntPtr result_buf, IntPtr result_len,
- int result_is_int, IntPtr args,
- int nargs);
- // PGresult *PQfn(PGconn *conn, int fnid,
- // int *result_buf, int *result_len,
- // int result_is_int, const PQArgBlock *args,
- // int nargs);
-
- [DllImport("pq")]
- public static extern ExecStatusType PQresultStatus (IntPtr res);
- // ExecStatusType PQresultStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQresStatus (ExecStatusType status);
- // char *PQresStatus(ExecStatusType status);
-
- [DllImport("pq")]
- public static extern string PQresultErrorMessage (IntPtr res);
- // char *PQresultErrorMessage(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQntuples (IntPtr res);
- // int PQntuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQnfields (IntPtr res);
- // int PQnfields(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQbinaryTuples (IntPtr res);
- // int PQbinaryTuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQfname (IntPtr res,
- int field_num);
- // char *PQfname(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfnumber (IntPtr res,
- string field_name);
- // int PQfnumber(const PGresult *res,
- // const char *field_name);
-
- [DllImport("pq")]
- public static extern int PQftype (IntPtr res,
- int field_num);
- // Oid PQftype(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfsize (IntPtr res,
- int field_num);
- // int PQfsize(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfmod (IntPtr res, int field_num);
- // int PQfmod(const PGresult *res, int field_num);
-
- [DllImport("pq")]
- public static extern string PQcmdStatus (IntPtr res);
- // char *PQcmdStatus(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQoidStatus (IntPtr res);
- // char *PQoidStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQoidValue (IntPtr res);
- // Oid PQoidValue(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQcmdTuples (IntPtr res);
- // char *PQcmdTuples(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQgetvalue (IntPtr res,
- int tup_num, int field_num);
- // char *PQgetvalue(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetlength (IntPtr res,
- int tup_num, int field_num);
- // int PQgetlength(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetisnull (IntPtr res,
- int tup_num, int field_num);
- // int PQgetisnull(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern void PQclear (IntPtr res);
- // void PQclear(PGresult *res);
-
- [DllImport("pq")]
- public static extern IntPtr PQmakeEmptyPGresult (IntPtr conn,
- IntPtr status);
- // PGresult *PQmakeEmptyPGresult(PGconn *conn,
- // ExecStatusType status);
-
- [DllImport("pq")]
- public static extern void PQprint (IntPtr fout,
- IntPtr res, IntPtr ps);
- // void PQprint(FILE *fout,
- // const PGresult *res, const PQprintOpt *ps);
-
- [DllImport("pq")]
- public static extern void PQdisplayTuples (IntPtr res,
- IntPtr fp, int fillAlign, string fieldSep,
- int printHeader, int quiet);
- // void PQdisplayTuples(const PGresult *res,
- // FILE *fp, int fillAlign, const char *fieldSep,
- // int printHeader, int quiet);
-
- [DllImport("pq")]
- public static extern void PQprintTuples (IntPtr res,
- IntPtr fout, int printAttName, int terseOutput,
- int width);
- // void PQprintTuples(const PGresult *res,
- // FILE *fout, int printAttName, int terseOutput,
- // int width);
-
- [DllImport("pq")]
- public static extern int lo_open (IntPtr conn,
- int lobjId, int mode);
- // int lo_open(PGconn *conn,
- // Oid lobjId, int mode);
-
- [DllImport("pq")]
- public static extern int lo_close (IntPtr conn, int fd);
- // int lo_close(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_read (IntPtr conn,
- int fd, string buf, int len);
- // int lo_read(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_write (IntPtr conn,
- int fd, string buf, int len);
- // int lo_write(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_lseek (IntPtr conn,
- int fd, int offset, int whence);
- // int lo_lseek(PGconn *conn,
- // int fd, int offset, int whence);
-
- [DllImport("pq")]
- public static extern int lo_creat (IntPtr conn,
- int mode);
- // Oid lo_creat(PGconn *conn,
- // int mode);
-
- [DllImport("pq")]
- public static extern int lo_tell (IntPtr conn, int fd);
- // int lo_tell(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_unlink (IntPtr conn,
- int lobjId);
- // int lo_unlink(PGconn *conn,
- // Oid lobjId);
-
- [DllImport("pq")]
- public static extern int lo_import (IntPtr conn,
- string filename);
- // Oid lo_import(PGconn *conn,
- // const char *filename);
-
- [DllImport("pq")]
- public static extern int lo_export (IntPtr conn,
- int lobjId, string filename);
- // int lo_export(PGconn *conn,
- // Oid lobjId, const char *filename);
-
- [DllImport("pq")]
- public static extern int PQmblen (string s,
- int encoding);
- // int PQmblen(const unsigned char *s,
- // int encoding);
-
- [DllImport("pq")]
- public static extern int PQenv2encoding ();
- // int PQenv2encoding(void);
-
- #endregion
- }
-}
+++ /dev/null
-//\r
-// PostgresTypes.cs - holding methods to convert \r
-// between PostgreSQL types and .NET types\r
-//\r
-// Author:\r
-// Daniel Morgan <danmorg@sc.rr.com>\r
-//\r
-// (c)copyright 2002 Daniel Morgan\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
-// Note: this might become PostgresType and PostgresTypeCollection\r
-// also, the PostgresTypes that exist as an inner internal class\r
-// within PgSqlConnection maybe moved here in the future\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Text;\r
-\r
-namespace Mono.Data.PostgreSqlClient {\r
-\r
- internal struct PostgresType {\r
- public int oid;\r
- public string typname;\r
- public DbType dbType;\r
- }\r
-
- sealed internal class PostgresHelper {
-
- // translates the PostgreSQL typname to System.Data.DbType
- public static DbType TypnameToSqlDbType(string typname) {\r
- DbType sqlType;\r
- \r
- // FIXME: use hashtable here?\r
-\r
- switch(typname) {\r
-\r
- case "abstime":\r
- sqlType = DbType.Int32;\r
- break;\r
-\r
- case "aclitem":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "bit":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "bool":\r
- sqlType = DbType.Boolean;\r
- break;\r
-\r
- case "box":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "bpchar":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "bytea":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "char":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "cidr":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "circle":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "date":\r
- sqlType = DbType.Date;\r
- break;\r
-\r
- case "float4":\r
- sqlType = DbType.Single;\r
- break;\r
-\r
- case "float8":\r
- sqlType = DbType.Double;\r
- break;\r
-\r
- case "inet":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "int2":\r
- sqlType = DbType.Int16;\r
- break;\r
-\r
- case "int4":\r
- sqlType = DbType.Int32;\r
- break;\r
-\r
- case "int8":\r
- sqlType = DbType.Int64;\r
- break;\r
-\r
- case "interval":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "line":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "lseg":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "macaddr":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "money":\r
- sqlType = DbType.Decimal;\r
- break;\r
-\r
- case "name":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "numeric":\r
- sqlType = DbType.Decimal;\r
- break;\r
-\r
- case "oid":\r
- sqlType = DbType.Int32;\r
- break;\r
-\r
- case "path":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "point":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "polygon":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "refcursor":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "reltime":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "text":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "time":\r
- sqlType = DbType.Time;\r
- break;\r
-\r
- case "timestamp":\r
- sqlType = DbType.DateTime;\r
- break;\r
-\r
- case "timestamptz":\r
- sqlType = DbType.DateTime;\r
- break;\r
-\r
- case "timetz":\r
- sqlType = DbType.DateTime;\r
- break;\r
-\r
- case "tinterval":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "varbit":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- case "varchar":\r
- sqlType = DbType.String;\r
- break;\r
-\r
- default:\r
- sqlType = DbType.String;\r
- break;\r
- }\r
- return sqlType;\r
- }\r
- \r
- // Converts data value from database to .NET System type.\r
- public static object ConvertDbTypeToSystem (DbType typ, String value) {
- object obj = null;
-
- // FIXME: more types need
- // to be converted
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- // FIXME: need to handle a NULL for each type
- // maybe setting obj to System.DBNull.Value ?
-
-
- if(value == null) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is null");
- return null;
- }
- else if(value.Equals("")) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is string empty");
- return null;
- }
-
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value: " + value);
-
- // Date, Time, and DateTime
- // are parsed based on ISO format
- // "YYYY-MM-DD hh:mi:ss.ms"
-
- switch(typ) {
- case DbType.String:
- obj = String.Copy(value);
- break;
- case DbType.Boolean:
- obj = value.Equals("t");
- break;
- case DbType.Int16:\r
- obj = Int16.Parse(value);\r
- break;\r
- case DbType.Int32:\r
- obj = Int32.Parse(value);\r
- break;\r
- case DbType.Int64:\r
- obj = Int64.Parse(value);\r
- break;\r
- case DbType.Decimal:\r
- obj = Decimal.Parse(value);\r
- break;\r
- case DbType.Single:\r
- obj = Single.Parse(value);\r
- break;\r
- case DbType.Double:\r
- obj = Double.Parse(value);\r
- break;\r
- case DbType.Date:\r
- String[] sd = value.Split(new Char[] {'-'});\r
- obj = new DateTime(\r
- Int32.Parse(sd[0]), Int32.Parse(sd[1]), Int32.Parse(sd[2]),\r
- 0,0,0);\r
- break;\r
- case DbType.Time:\r
- String[] st = value.Split(new Char[] {':'});\r
- obj = new DateTime(0001,01,01,\r
- Int32.Parse(st[0]),Int32.Parse(st[1]),Int32.Parse(st[2]));\r
- break;\r
- case DbType.DateTime:\r
- Int32 YYYY,MM,DD,hh,mi,ss,ms;\r
- YYYY = Int32.Parse(value.Substring(0,4));\r
- MM = Int32.Parse(value.Substring(5,2));\r
- DD = Int32.Parse(value.Substring(8,2));\r
- hh = Int32.Parse(value.Substring(11,2));\r
- mi = Int32.Parse(value.Substring(14,2));\r
- ss = Int32.Parse(value.Substring(17,2));\r
- ms = Int32.Parse(value.Substring(20,2));\r
- obj = new DateTime(YYYY,MM,DD,hh,mi,ss,ms);\r
- break;\r
- default:\r
- obj = String.Copy(value);\r
- break;\r
- }
-
- return obj;
- }
-
- // Translates System.Data.DbType to System.Type
- public static Type DbTypeToSystemType (DbType dType) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- Type typ = null;
-
- switch(dType) {
- case DbType.String:
- typ = typeof(String);
- break;
- case DbType.Boolean:
- typ = typeof(Boolean);
- break;
- case DbType.Int16: \r
- typ = typeof(Int16);\r
- break;\r
- case DbType.Int32:\r
- typ = typeof(Int32);\r
- break;\r
- case DbType.Int64:\r
- typ = typeof(Int64);\r
- break;\r
- case DbType.Decimal:\r
- typ = typeof(Decimal);\r
- break;\r
- case DbType.Single:\r
- typ = typeof(Single);\r
- break;\r
- case DbType.Double:\r
- typ = typeof(Double);\r
- break;\r
- case DbType.Date:\r
- case DbType.Time:\r
- case DbType.DateTime:\r
- typ = typeof(DateTime);\r
- break;\r
- default:\r
- typ = typeof(String);\r
- break;\r
- }
- return typ;
- }
-
- // Find DbType for oid
- // which requires a look up of PostgresTypes
- // DbType <-> typname <-> oid
- public static string OidToTypname (int oid, ArrayList pgTypes) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- string typname = "text"; // default
- int i;
- for(i = 0; i < pgTypes.Count; i++) {
- PostgresType pt = (PostgresType) pgTypes[i];
- if(pt.oid == oid) {
- typname = pt.typname;
- break;
- }
- }
-
- return typname;
- }
-
- // Convert a .NET System value type (Int32, String, Boolean, etc)
- // to a string that can be included within a SQL statement.
- // This is to methods provides the parameters support
- // for the PostgreSQL .NET Data provider
- public static string ObjectToString(DbType dbtype, object obj) {\r
- \r
- // TODO: how do we handle a NULL?\r
- //if(isNull == true)\r
- // return "NULL";\r
-\r
- string s;\r
-\r
- // Date, Time, and DateTime are expressed in ISO format\r
- // which is "YYYY-MM-DD hh:mm:ss.ms";\r
- DateTime dt;\r
- StringBuilder sb;\r
-\r
- const string zero = "0";\r
-\r
- switch(dbtype) {\r
- case DbType.String:
- s = "'" + obj + "'";
- break;
- case DbType.Boolean:
- if((bool)obj == true)
- s = "'t'";
- else
- s = "'f'";
- break;
- case DbType.Int16:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Int32:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Int64:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Decimal:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Single:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Double:\r
- s = obj.ToString();\r
- break;\r
- case DbType.Date:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // year\r
- if(dt.Year < 10)\r
- sb.Append("000" + dt.Year);\r
- else if(dt.Year < 100)\r
- sb.Append("00" + dt.Year);\r
- else if(dt.Year < 1000)\r
- sb.Append("0" + dt.Year);\r
- else\r
- sb.Append(dt.Year);\r
- sb.Append("-");\r
- // month\r
- if(dt.Month < 10)\r
- sb.Append(zero + dt.Month);\r
- else\r
- sb.Append(dt.Month);\r
- sb.Append("-");\r
- // day\r
- if(dt.Day < 10)\r
- sb.Append(zero + dt.Day);\r
- else\r
- sb.Append(dt.Day);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- case DbType.Time:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // hour\r
- if(dt.Hour < 10)\r
- sb.Append(zero + dt.Hour);\r
- else\r
- sb.Append(dt.Hour);\r
- sb.Append(":");\r
- // minute\r
- if(dt.Minute < 10)\r
- sb.Append(zero + dt.Minute);\r
- else\r
- sb.Append(dt.Minute);\r
- sb.Append(":");\r
- // second\r
- if(dt.Second < 10)\r
- sb.Append(zero + dt.Second);\r
- else\r
- sb.Append(dt.Second);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- case DbType.DateTime:\r
- dt = (DateTime) obj;\r
- sb = new StringBuilder();\r
- sb.Append('\'');\r
- // year\r
- if(dt.Year < 10)\r
- sb.Append("000" + dt.Year);\r
- else if(dt.Year < 100)\r
- sb.Append("00" + dt.Year);\r
- else if(dt.Year < 1000)\r
- sb.Append("0" + dt.Year);\r
- else\r
- sb.Append(dt.Year);\r
- sb.Append("-");\r
- // month\r
- if(dt.Month < 10)\r
- sb.Append(zero + dt.Month);\r
- else\r
- sb.Append(dt.Month);\r
- sb.Append("-");\r
- // day\r
- if(dt.Day < 10)\r
- sb.Append(zero + dt.Day);\r
- else\r
- sb.Append(dt.Day);\r
- sb.Append(" ");\r
- // hour\r
- if(dt.Hour < 10)\r
- sb.Append(zero + dt.Hour);\r
- else\r
- sb.Append(dt.Hour);\r
- sb.Append(":");\r
- // minute\r
- if(dt.Minute < 10)\r
- sb.Append(zero + dt.Minute);\r
- else\r
- sb.Append(dt.Minute);\r
- sb.Append(":");\r
- // second\r
- if(dt.Second < 10)\r
- sb.Append(zero + dt.Second);\r
- else\r
- sb.Append(dt.Second);\r
- sb.Append(".");\r
- // millisecond\r
- if(dt.Millisecond < 10)\r
- sb.Append(zero + dt.Millisecond);\r
- else\r
- sb.Append(dt.Millisecond);\r
- sb.Append('\'');\r
- s = sb.ToString();\r
- break;\r
- default:\r
- // default to DbType.String\r
- s = "'" + obj + "'";\r
- break;\r
- }
- return s;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Mono.Data.PostgreSqlClient {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment {
- get { return comment; }
- }
- }
-}
+2005-06-08 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * oops Mono.IsPartOfPackage renamed to Mono.IsPartOfPackageAttribute,
+ as mandates the convention
+
+2005-06-06 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * Mono.GetOptions/OptionList.cs: Some refactoring of Gert's contribution
+ * Added Mono/IsPartOfPackage.cs: new informational assembly attribute
+
2005-06-05 Gert Driesen <drieseng@users.sourceforge.net>
* Mono.GetOptions/OptionList.cs: Support quoted arguments in
response files. Fixes bug #65484.
mbas' CompilerOptions. Added overridable string [] AssembliesToReferenceSoftly
* Mono.GetOptions/Options.cs: new constructor adds support to use a provided ErrorReporter
also added overridable string AdditionalBannerInfo readonly property
- * Mono.GetOptions/OptionList.cs: AdditionalBannerInfo is porcessed byt ShowBanner
+ * Mono.GetOptions/OptionList.cs: AdditionalBannerInfo is processed by ShowBanner
2005-05-09 Raja R Harinath <rharinath@novell.com>
* Mono.GetOptions.Useful/CommonCompilerOptions.cs (AddedReference):
Mono/UsageComplementAttribute.cs
Mono/AdditionalInfoAttribute.cs
Mono/ReportBugsToAttribute.cs
+Mono/IsPartOfPackageAttribute.cs
Mono.GetOptions/ArgumentProcessorAttribute.cs
Mono.GetOptions/OptionAttribute.cs
Mono.GetOptions/OptionsParsingMode.cs
public string Usage
{
- get
- {
+ get {
return "Usage: " + appExeName + " [options] " + appUsageComplement;
}
}
public string AboutDetails
{
- get
- {
+ get {
return appAboutDetails;
}
}
if (argumentProcessor != null)
throw new NotSupportedException("More than one argument processor method found");
- if ((memberInfo.MemberType == MemberTypes.Method && memberInfo is MethodInfo))
- {
+ if ((memberInfo.MemberType == MemberTypes.Method && memberInfo is MethodInfo)) {
if (((MethodInfo)memberInfo).ReturnType.FullName != typeof(void).FullName)
throw new NotSupportedException("Argument processor method must return 'void'");
{
ShowTitleLines();
Console.WriteLine(appAboutDetails);
- StringBuilder sb = new StringBuilder("Authors: ");
- bool first = true;
- foreach(string s in appAuthors)
- {
- if (first)
- first = false;
- else
- sb.Append(", ");
- sb.Append(s);
- }
- Console.WriteLine(sb.ToString());
+ Console.Write("Authors: ");
+ Console.WriteLine(string.Join(", ", appAuthors));
}
private void ShowHelp(bool showSecondLevelHelp)
#endregion
- #region Arguments Processing
+ #region Response File Expansion
+
+ private void processResponseFileLine(string line, ArrayList result, StringBuilder sb)
+ {
+ int t = line.Length;
+ for (int i = 0; i < t; i++) {
+ char c = line [i];
+ if (c == '"' || c == '\'') {
+ char end = c;
+ for (i++; i < t; i++) {
+ c = line [i];
+ if (c == end)
+ break;
+ sb.Append(c);
+ }
+ } else if (c == ' ') {
+ if (sb.Length > 0) {
+ result.Add(sb.ToString());
+ sb.Length = 0;
+ }
+ } else {
+ sb.Append(c);
+ }
+ }
+ if (sb.Length > 0) {
+ result.Add(sb.ToString());
+ sb.Length = 0;
+ }
+ }
+
+ private void processResponseFile(string filename, ArrayList result)
+ {
+ StringBuilder sb = new StringBuilder();
+ string line;
+ try {
+ using (StreamReader responseFile = new StreamReader(filename)) {
+ while ((line = responseFile.ReadLine()) != null)
+ processResponseFileLine(line, result, sb);
+ responseFile.Close ();
+ }
+ } catch (FileNotFoundException) {
+ ReportError(2011, "Unable to find response file '" + filename + "'");
+ } catch (Exception exception) {
+ ReportError(2011, "Unable to open response file '" + filename + "'. " + exception.Message);
+ }
+ }
- public string[] ExpandResponseFiles(string[] args)
+ private ArrayList ExpandResponseFiles(string[] args)
{
ArrayList result = new ArrayList();
-
foreach(string arg in args)
- {
- if (arg.StartsWith("@"))
- {
- try
- {
- using (StreamReader tr = new StreamReader(arg.Substring(1))) {
- string line;
- StringBuilder sb = new StringBuilder ();
-
- while ((line = tr.ReadLine()) != null) {
- int t = line.Length;
-
- for (int i = 0; i < t; i++) {
- char c = line [i];
-
- if (c == '"' || c == '\'') {
- char end = c;
-
- for (i++; i < t; i++) {
- c = line [i];
-
- if (c == end)
- break;
- sb.Append(c);
- }
- } else if (c == ' ') {
- if (sb.Length > 0) {
- result.Add (sb.ToString());
- sb.Length = 0;
- }
- } else {
- sb.Append (c);
- }
- }
- if (sb.Length > 0) {
- result.Add (sb.ToString());
- sb.Length = 0;
- }
- }
- tr.Close ();
- }
- } catch (FileNotFoundException) {
- ReportError(2011, "Unable to open response file '" + arg.Substring(1) + "'");
- continue;
- } catch (Exception exception) {
- ReportError(2011, "Unable to open response file '" + arg.Substring(1) + "'. " + exception.Message);
- continue;
- }
- }
+ if (arg.StartsWith("@"))
+ processResponseFile(arg.Substring(1), result);
else
result.Add(arg);
- }
-
- return (string[])result.ToArray(typeof(string));
+ return result;
}
+
+ #endregion
+
+ #region Arguments Processing
+
private static int IndexOfAny(string where, params char[] what)
{
return where.IndexOfAny(what);
}
- public string[] NormalizeArgs(string[] args)
+ private string[] NormalizeArgs(string[] args)
{
bool ParsingOptions = true;
ArrayList result = new ArrayList();
-
+
foreach(string arg in ExpandResponseFiles(args)) {
if (arg.Length > 0) {
if (ParsingOptions) {
--- /dev/null
+//
+// IsPartOfPackageAttribute.cs
+//
+// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
+//
+// (C) 2005 Rafael Teixeira
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+
+namespace Mono
+{
+ [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
+ public class IsPartOfPackageAttribute : System.Attribute
+ {
+ public string PackageName;
+
+ public IsPartOfPackageAttribute(string packageName)
+ {
+ PackageName = packageName;
+ }
+
+ public override string ToString()
+ {
+ return PackageName;
+ }
+ }
+}
+2005-06-09 Jonathan Pryor <jonpryor@vt.edu>
+
+ * make-map.cs: Look for [Obsolete] members, and mark the UnixConvert
+ conversion functions with the same [Obsolete] message. This should permit
+ more graceful deprecation of enumerations in the future (rather than just
+ API breaks).
+
+2005-06-08 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Syscall.cs: Add execvp(2). (This should have been added with the other
+ exec(2) additions...).
+
+2005-06-08 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Syscall.cs: Update comment with correct exception type.
+ * UnixConvert.cs: Rename ToFilePermissions(string) to
+ FromOctalPermissionString; Add ToOctalPermissionString,
+ FromUnixPermissionString, ToUnixPermissionString.
+ * UnixMarshal.cs: Remove ErrorMarshal.HaveStrerror_r and
+ UnixMarshal.IsErrorDescriptionThreadSafe. strerror(3) is now thread-safe
+ (from managed code, at least). Update comment.
+
+2005-06-07 Jonathan Pryor <jonpryor@vt.edu>
+
+ * UnixFileSystemInfo.cs: Don't use lstat(2), use stat(2). This fits with
+ expectations better -- if you create a UnixFileInfo() on a symlink, you
+ want to get the target's information, not the symlink's info. Add
+ GetFileStatus so UnixSymbolicLinkInfo can override this behavior.
+ * UnixSymbolicLinkInfo.cs: Implement GetFileStatus() (which calls lstat(2)).
+
+2005-06-07 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Syscall.cs: Document naming conventions.
+
2005-06-05 Jonathan Pryor <jonpryor@vt.edu>
* make-map.cs: Change automatic "ifdef HAVE_<header>" support prefix to
// This is the case for using UnixConvert, which will throw an
// exception if an invalid/unsupported value is used.
//
+ // Naming Conventions:
+ // - Syscall method names should have the same name as the function being
+ // wrapped (e.g. Syscall.read ==> read(2)). This allows people to
+ // consult the appropriate man page if necessary.
+ // - Methods need not have the same arguments IF this simplifies or
+ // permits correct usage. The current example is syslog, in which
+ // syslog(3)'s single `priority' argument is split into SyslogFacility
+ // and SyslogLevel arguments.
+ // - Type names (structures, classes, enumerations) are always PascalCased.
+ // - Enumerations are named as <MethodName><ArgumentName>, and are located
+ // in the Mono.Unix namespace. For readability, if ArgumentName is
+ // "cmd", use Command instead. For example, fcntl(2) takes a
+ // FcntlCommand argument. This naming convention is to provide an
+ // assocation between an enumeration and where it should be used, and
+ // allows a single method to accept multiple different enumerations
+ // (see mmap(2), which takes MmapProt and MmapFlags).
+ // - EXCEPTION: if an enumeration is shared between multiple different
+ // methods, AND/OR the "obvious" enumeration name conflicts with an
+ // existing .NET type, a more appropriate name should be used.
+ // Example: FilePermissions
+ // - Enumerations should have the [Map] and (optional) [Flgas] attributes.
+ // [Map] is required for make-map to find the type and generate the
+ // appropriate UnixConvert conversion functions.
+ // - Enumeration contents should match the original Unix names. This helps
+ // with documentation (the existing man pages are still useful), and is
+ // required for use with the make-map generation program.
+ // - Structure names should be the PascalCased version of the actual
+ // structure name (struct flock ==> Flock). Structure members should
+ // have the same names, or a (reasonably) portable subset (Dirent being
+ // the poster child for questionable members).
+ // - Whether the managed type should be a reference type (class) or a
+ // value type (struct) should be determined on a case-by-case basis:
+ // if you ever need to be able to use NULL for it (such as with Dirent,
+ // Group, Passwd, as these are method return types and `null' is used
+ // to signify the end), it should be a reference type; otherwise, use
+ // your discretion, and keep any expected usage patterns in mind.
+ // - Syscall should be a Single Point Of Truth (SPOT). There should be
+ // only ONE way to do anything. By convention, the Linux function names
+ // are used, but that need not always be the case (use your discretion).
+ // It SHOULD NOT be required that developers know what platform they're
+ // on, and choose among a set of similar functions. In short, anything
+ // that requires a platform check is BAD -- Mono.Unix is a wrapper, and
+ // we can afford to clean things up whenever possible.
+ // - Examples:
+ // - Syscall.statfs: Solaris/Mac OS X provide statfs(2), Linux provides
+ // statvfs(2). MonoPosixHelper will "thunk" between the two,
+ // exporting a statvfs that works across platforms.
+ // - Syscall.getfsent: Glibc export which Solaris lacks, while Solaris
+ // instead provides getvfsent(3). MonoPosixHelper provides wrappers
+ // to convert getvfsent(3) into Fstab data.
+ // - Exception: If it isn't possible to cleanly wrap platforms, then the
+ // method shouldn't be exported. The user will be expected to do their
+ // own platform check and their own DllImports.
+ // Examples: mount(2), umount(2), etc.
+ // - Note: if a platform doesn't support a function AT ALL, the
+ // MonoPosixHelper wrapper won't be compiled, resulting in a
+ // EntryPointNotFoundException. This is also consistent with a missing
+ // P/Invoke into libc.so.
+ //
public sealed class Syscall : Stdlib
{
new internal const string LIBC = "libc";
// TODO: execle, execl, execlp
[DllImport (LIBC, SetLastError=true)]
- private static extern int execvp (string path, string[] argv);
+ public static extern int execvp (string path, string[] argv);
[DllImport (LIBC, SetLastError=true)]
public static extern int nice (int inc);
//
// convert from octal representation.
- public static FilePermissions ToFilePermissions (string value)
+ public static FilePermissions FromOctalPermissionString (string value)
{
uint n = Convert.ToUInt32 (value, 8);
return ToFilePermissions (n);
}
+ public static string ToOctalPermissionString (FilePermissions value)
+ {
+ string s = Convert.ToString ((int) (value & ~FilePermissions.S_IFMT), 8);
+ return new string ('0', 4-s.Length) + s;
+ }
+
+ public static FilePermissions FromUnixPermissionString (string value)
+ {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ if (value.Length != 9 && value.Length != 10)
+ throw new ArgumentException ("value", "must contain 9 or 10 characters");
+
+ int i = 0;
+ FilePermissions perms = new FilePermissions ();
+
+ if (value.Length == 10) {
+ perms |= GetUnixPermissionDevice (value [i]);
+ ++i;
+ }
+
+ perms |= GetUnixPermissionGroup (
+ value [i++], FilePermissions.S_IRUSR,
+ value [i++], FilePermissions.S_IWUSR,
+ value [i++], FilePermissions.S_IXUSR,
+ 's', 'S', FilePermissions.S_ISUID);
+
+ perms |= GetUnixPermissionGroup (
+ value [i++], FilePermissions.S_IRGRP,
+ value [i++], FilePermissions.S_IWGRP,
+ value [i++], FilePermissions.S_IXGRP,
+ 's', 'S', FilePermissions.S_ISGID);
+
+ perms |= GetUnixPermissionGroup (
+ value [i++], FilePermissions.S_IROTH,
+ value [i++], FilePermissions.S_IWOTH,
+ value [i++], FilePermissions.S_IXOTH,
+ 't', 'T', FilePermissions.S_ISVTX);
+
+ return perms;
+ }
+
+ private static FilePermissions GetUnixPermissionDevice (char value)
+ {
+ switch (value) {
+ case 'd': return FilePermissions.S_IFDIR;
+ case 'c': return FilePermissions.S_IFCHR;
+ case 'b': return FilePermissions.S_IFBLK;
+ case '-': return FilePermissions.S_IFREG;
+ case 'p': return FilePermissions.S_IFIFO;
+ case 'l': return FilePermissions.S_IFLNK;
+ case 's': return FilePermissions.S_IFSOCK;
+ }
+ throw new ArgumentException ("value", "invalid device specification: " +
+ value);
+ }
+
+ private static FilePermissions GetUnixPermissionGroup (
+ char read, FilePermissions readb,
+ char write, FilePermissions writeb,
+ char exec, FilePermissions execb,
+ char xboth, char xbitonly, FilePermissions xbit)
+ {
+ FilePermissions perms = new FilePermissions ();
+ if (read == 'r')
+ perms |= readb;
+ if (write == 'w')
+ perms |= writeb;
+ if (exec == 'x')
+ perms |= execb;
+ else if (exec == xbitonly)
+ perms |= xbit;
+ else if (exec == xboth)
+ perms |= (execb | xbit);
+ return perms;
+ }
+
+ // Create ls(1) drwxrwxrwx permissions display
+ public static string ToUnixPermissionString (FilePermissions value)
+ {
+ char [] access = new char[] {
+ '-', // device
+ '-', '-', '-', // owner
+ '-', '-', '-', // group
+ '-', '-', '-', // other
+ };
+ bool have_device = true;
+ switch (value & FilePermissions.S_IFMT) {
+ case FilePermissions.S_IFDIR: access [0] = 'd'; break;
+ case FilePermissions.S_IFCHR: access [0] = 'c'; break;
+ case FilePermissions.S_IFBLK: access [0] = 'b'; break;
+ case FilePermissions.S_IFREG: access [0] = '-'; break;
+ case FilePermissions.S_IFIFO: access [0] = 'p'; break;
+ case FilePermissions.S_IFLNK: access [0] = 'l'; break;
+ case FilePermissions.S_IFSOCK: access [0] = 's'; break;
+ default: have_device = false; break;
+ }
+ SetUnixPermissionGroup (value, access, 1,
+ FilePermissions.S_IRUSR, FilePermissions.S_IWUSR, FilePermissions.S_IXUSR,
+ 's', 'S', FilePermissions.S_ISUID);
+ SetUnixPermissionGroup (value, access, 4,
+ FilePermissions.S_IRGRP, FilePermissions.S_IWGRP, FilePermissions.S_IXGRP,
+ 's', 'S', FilePermissions.S_ISGID);
+ SetUnixPermissionGroup (value, access, 7,
+ FilePermissions.S_IROTH, FilePermissions.S_IWOTH, FilePermissions.S_IXOTH,
+ 't', 'T', FilePermissions.S_ISVTX);
+ return have_device
+ ? new string (access)
+ : new string (access, 1, 9);
+ }
+
+ private static void SetUnixPermissionGroup (FilePermissions value,
+ char[] access, int index,
+ FilePermissions read, FilePermissions write, FilePermissions exec,
+ char both, char setonly, FilePermissions setxbit)
+ {
+ if (UnixFileSystemInfo.IsType (value, read))
+ access [index] = 'r';
+ if (UnixFileSystemInfo.IsType (value, write))
+ access [index+1] = 'w';
+ access [index+2] = GetSymbolicMode (value, exec, both, setonly, setxbit);
+ }
+
+ // Implement the GNU ls(1) permissions spec; see `info coreutils ls`,
+ // section 10.1.2, the `-l' argument information.
+ private static char GetSymbolicMode (FilePermissions value,
+ FilePermissions xbit, char both, char setonly, FilePermissions setxbit)
+ {
+ bool is_x = UnixFileSystemInfo.IsType (value, xbit);
+ bool is_sx = UnixFileSystemInfo.IsType (value, setxbit);
+
+ if (is_x && is_sx)
+ return both;
+ if (is_sx)
+ return setonly;
+ if (is_x)
+ return 'x';
+ return '-';
+ }
+
public static readonly DateTime LocalUnixEpoch =
new DateTime (1970, 1, 1).ToLocalTime();
{
if (valid && !force)
return;
- int r = Syscall.lstat (FullPath, out this.stat);
+ int r = GetFileStatus (FullPath, out this.stat);
valid = r == 0;
}
+ protected virtual int GetFileStatus (string path, out Stat stat)
+ {
+ return Syscall.stat (path, out stat);
+ }
+
public void SetLength (long length)
{
int r;
// using strerror(3).
// This should be thread safe, since the check is done within the
// class constructor lock.
- // Problem: But if strerror_r() isn't present, we're not thread safe!
- // Solution: Tough. It's still better than nothing. I think.
- // Check UnixMarshal.IsErrorDescriptionThreadSafe if you need to
- // know which error translator is being used.
+ // Strerror(3) will be thread-safe from managed code, but won't
+ // be thread-safe between managed & unmanaged code.
internal class ErrorMarshal
{
internal delegate string ErrorTranslator (Error errno);
internal static readonly ErrorTranslator Translate;
- internal static readonly bool HaveStrerror_r;
static ErrorMarshal ()
{
try {
Translate = new ErrorTranslator (strerror_r);
Translate (Error.ERANGE);
- HaveStrerror_r = true;
}
catch (EntryPointNotFoundException e) {
Translate = new ErrorTranslator (strerror);
- HaveStrerror_r = false;
}
}
return ErrorMarshal.Translate (errno);
}
- public static bool IsErrorDescriptionThreadSafe {
- get {return ErrorMarshal.HaveStrerror_r;}
- }
-
public static IntPtr Alloc (long size)
{
if (size < 0)
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}
+ protected override int GetFileStatus (string path, out Stat stat)
+ {
+ return Syscall.lstat (path, out stat);
+ }
+
// TODO: Should ReadLink be in UnixSymbolicLinkInfo?
private string ReadLink ()
{
WriteHeader (scs, assembly_name);
scs.WriteLine ("using System;");
scs.WriteLine ("using System.Runtime.InteropServices;");
- scs.WriteLine ("using Mono.Posix;\n");
- scs.WriteLine ("namespace Mono.Posix {\n");
- scs.WriteLine ("\tpublic sealed /* static */ class PosixConvert");
+ scs.WriteLine ("using Mono.Unix;\n");
+ scs.WriteLine ("namespace Mono.Unix {\n");
+ scs.WriteLine ("\tpublic sealed /* static */ class UnixConvert");
scs.WriteLine ("\t{");
- scs.WriteLine ("\t\tprivate PosixConvert () {}\n");
+ scs.WriteLine ("\t\tprivate UnixConvert () {}\n");
scs.WriteLine ("\t\tprivate const string LIB = \"MonoPosixHelper\";\n");
scs.WriteLine ("\t\tprivate static void ThrowArgumentException (object value)");
scs.WriteLine ("\t\t{");
return;
string mtype = Enum.GetUnderlyingType(t).Name;
+ ObsoleteAttribute oa = (ObsoleteAttribute) Attribute.GetCustomAttribute (t,
+ typeof(ObsoleteAttribute), false);
+ string obsolete = "";
+ if (oa != null) {
+ obsolete = "[Obsolete (\"" + oa.Message + "\")]\n\t\t";
+ }
scs.WriteLine ("\t\t[DllImport (LIB, " +
"EntryPoint=\"{0}_From{1}\")]\n" +
"\t\tprivate static extern int From{1} ({1} value, out {2} rval);\n",
ns, t.Name, mtype);
- scs.WriteLine ("\t\tpublic static bool TryFrom{1} ({1} value, out {2} rval)\n" +
+ scs.WriteLine ("\t\t{3}public static bool TryFrom{1} ({1} value, out {2} rval)\n" +
"\t\t{{\n" +
"\t\t\treturn From{1} (value, out rval) == 0;\n" +
- "\t\t}}\n", ns, t.Name, mtype);
- scs.WriteLine ("\t\tpublic static {0} From{1} ({1} value)", mtype, t.Name);
+ "\t\t}}\n", ns, t.Name, mtype, obsolete);
+ scs.WriteLine ("\t\t{2}public static {0} From{1} ({1} value)", mtype, t.Name, obsolete);
scs.WriteLine ("\t\t{");
scs.WriteLine ("\t\t\t{0} rval;", mtype);
scs.WriteLine ("\t\t\tif (From{0} (value, out rval) == -1)\n" +
"EntryPoint=\"{0}_To{1}\")]\n" +
"\t\tprivate static extern int To{1} ({2} value, out {1} rval);\n",
ns, t.Name, mtype);
- scs.WriteLine ("\t\tpublic static bool TryTo{1} ({0} value, out {1} rval)\n" +
+ scs.WriteLine ("\t\t{2}public static bool TryTo{1} ({0} value, out {1} rval)\n" +
"\t\t{{\n" +
"\t\t\treturn To{1} (value, out rval) == 0;\n" +
- "\t\t}}\n", mtype, t.Name);
- scs.WriteLine ("\t\tpublic static {1} To{1} ({0} value)", mtype, t.Name);
+ "\t\t}}\n", mtype, t.Name, obsolete);
+ scs.WriteLine ("\t\t{2}public static {1} To{1} ({0} value)", mtype, t.Name, obsolete);
scs.WriteLine ("\t\t{");
scs.WriteLine ("\t\t\t{0} rval;", t.Name);
scs.WriteLine ("\t\t\tif (To{0} (value, out rval) == -1)\n" +
//
using System;
-using Mono.Security.Protocol.Tls;
namespace Mono.Security.Protocol.Tls
{
RecordOverflow = 22,
DecompressionFailiure = 30,
HandshakeFailiure = 40,
+ NoCertificate = 41, // should be used in SSL3
BadCertificate = 42,
UnsupportedCertificate = 43,
CertificateRevoked = 44,
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Alert.cs: Add NoCertificate (41) which _should_ be used in SSL3
+ if we don't want to send a certificate when requested by a server
+ (e.g. in the case the mutual authentication is optional).
+ * CipherSuite.cs: Fixed recursive property. Changed type to short so
+ it can hold 256 bits (valid value). Fixed ctor so it doesn't assign
+ the it's own value.
+
2005-05-13 Sebastien Pouliot <sebastien@ximian.com>
* SslClientStream.cs: Forgot to set the event in the previous fix.
get { return this.expandedKeyMaterialSize; }
}
- public byte EffectiveKeyBits
+ public short EffectiveKeyBits
{
- get { return this.EffectiveKeyBits; }
+ get { return this.effectiveKeyBits; }
}
public byte IvSize
short code, string name, CipherAlgorithmType cipherAlgorithmType,
HashAlgorithmType hashAlgorithmType, ExchangeAlgorithmType exchangeAlgorithmType,
bool exportable, bool blockMode, byte keyMaterialSize,
- byte expandedKeyMaterialSize, short effectiveKeyBytes,
+ byte expandedKeyMaterialSize, short effectiveKeyBits,
byte ivSize, byte blockSize)
{
this.code = code;
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-#if (NET_1_0)
- [assembly: AssemblyVersion("1.0.3300.0")]
- [assembly: SatelliteContractVersion("1.0.3300.0")]
-#endif
-#if (NET_1_1)
- [assembly: AssemblyVersion("1.0.5000.0")]
- [assembly: SatelliteContractVersion("1.0.5000.0")]
- [assembly: ComCompatibleVersion(1, 0, 3300, 0)]
- [assembly: TypeLibVersion(1, 10)]
-#endif
-
-[assembly: AssemblyTitle("System.Data.ObjectSpaces.dll")]
-[assembly: AssemblyDescription("System.Data.ObjectSpaces.dll")]
-[assembly: AssemblyConfiguration("Development version")]
-[assembly: AssemblyCompany("MONO development team")]
-[assembly: AssemblyProduct("MONO CLI")]
-[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
-[assembly: AssemblyTrademark("")]
-
-// FIXME Add once compliance is reached
-//[assembly: CLSCompliant(true)]
-[assembly: AssemblyDefaultAlias("System.Data.ObjectSpaces.dll")]
-[assembly: AssemblyInformationalVersion("0.0.0.1")]
-[assembly: NeutralResourcesLanguage("en-US")]
-
-[assembly: ComVisible(false)]
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: AssemblyDelaySign(true)]
-[assembly: AssemblyKeyFile("../ecma.pub")]
+++ /dev/null
-2003-11-26 Tim Coleman <tim@timcoleman.com>
- * AssemblyInfo.cs: Added
- * ChangeLog: Added
- * Locale.cs: Added
+++ /dev/null
-//
-// Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 - 2003 Ximian, Inc (http://www.ximian.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-internal sealed class Locale {
-
- private Locale ()
- {
- }
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
-}
+++ /dev/null
-2003-12-29 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces/ObjectContext.cs:
- * System.Data.ObjectSpaces/ObjectReader.cs:
- * System.Data.ObjectSpaces/ObjectSet.cs:
- * System.Data.ObjectSpaces/ObjectSpace.cs:
- Some implementation
- * System.Data.ObjectSpaces/ObjectList.cs:
- * System.Data.ObjectSpaces/ObjectSources.cs:
- * System.Data.ObjectSpaces.Schema/ObjectRelationship.cs:
- * System.Data.ObjectSpaces.Schema/ObjectSchema.cs:
- * System.Data.ObjectSpaces.Schema/SchemaClass.cs:
- * System.Data.ObjectSpaces.Schema/SchemaMember.cs:
- Remove erroneous "private" modifiers
-
-2003-12-13 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces.Query/ObjectExpression.cs:
- Add missing includes
- * System.Data.ObjectSpaces.dll.Sources:
- Add missing files to build.
-
-2003-12-02 Richard Thombs <stony@stony.org>
- * TODOAttribute.cs:
- * System.Data.ObjectSpaces.dll.sources:
- Moved TODOAttribute.cs into System directory as requested
-
-2003-11-27 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces.Query/ObjectExpression.cs:
- * System.Data.ObjectSpaces.Query/ObjectSpaceNode.cs:
- * System.Data.ObjectSpaces_test.dll.sources:
- Various updates for completion
-
-2003-11-26 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces_test.dll.sources:
- * Makefile:
- Add stuff for tests
- * System.Data.ObjectSpaces/PersistenceError.cs:
- * System.Data.ObjectSpaces/PersistenceException.cs:
- * System.Data.ObjectSpaces.Schema/ExtendedProperty.cs:
- * System.Data.ObjectSpaces.Schema/ExtendedPropertyCollection.cs:
- * System.Data.ObjectSpaces.Schema/ObjectRelationship.cs:
- * System.Data.ObjectSpaces.Schema/ObjectRelationshipCollection.cs:
- * System.Data.ObjectSpaces.Schema/ObjectRelationshipType.cs:
- * System.Data.ObjectSpaces.Schema/SchemaClass.cs:
- * System.Data.ObjectSpaces.Schema/SchemaClassCollection.cs:
- * System.Data.ObjectSpaces.Schema/SchemaMember.cs:
- * System.Data.ObjectSpaces.Schema/SchemaMemberCollection.cs:
- * System.Data.ObjectSpaces.dll.sources:
- New class stubs added
- * System.Data.ObjectSpaces/CommonObjectContext.cs:
- * System.Data.ObjectSpaces/ContextException.cs:
- * System.Data.ObjectSpaces/DbObjectReader.cs:
- * System.Data.ObjectSpaces/ObjectContext.cs:
- * System.Data.ObjectSpaces/ObjectException.cs:
- * System.Data.ObjectSpaces/ObjectKeyManager.cs:
- * System.Data.ObjectSpaces/ObjectList.cs:
- * System.Data.ObjectSpaces/OneToManyRelationship.cs:
- * System.Data.ObjectSpaces/OneToOneRelationship.cs:
- * System.Data.ObjectSpaces.Schema/ObjectSchema.cs:
- Updates to make more correct
-
-2003-11-25 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces/PersistenceErrorBehaviour.cs:
- * System.Data.ObjectSpaces/PersisteneceErrorType.cs:
- Remove misnamed class files
- * System.Data.ObjectSpaces/ObjectException.cs:
- * System.Data.ObjectSpaces/ObjectQuery.cs:
- * System.Data.ObjectSpaces/ObjectSet.cs:
- * System.Data.ObjectSpaces/ObjectSources.cs:
- * System.Data.ObjectSpaces/PersistenceErrorBehavior.cs:
- * System.Data.ObjectSpaces/PersistenceErrorType.cs:
- * System.Data.ObjectSpaces/PersistenceOptions.cs:
- New stubs created to get things to compile
- * Makefile:
- Add new dependencies
- * System.Data.ObjectSpaces/ASTBaseParser.cs:
- * System.Data.ObjectSpaces/CommonObjectContext.cs:
- * System.Data.ObjectSpaces/DbObjectReader.cs:
- * System.Data.ObjectSpaces/DynamicAssembly.cs:
- * System.Data.ObjectSpaces/IObjectHelper.cs:
- * System.Data.ObjectSpaces/IObjectNotification.cs:
- * System.Data.ObjectSpaces/KeyGenerator.cs:
- * System.Data.ObjectSpaces/ObjectContext.cs:
- * System.Data.ObjectSpaces/ObjectEngine.cs:
- * System.Data.ObjectSpaces/ObjectKeyManager.cs:
- * System.Data.ObjectSpaces/ObjectList.cs:
- * System.Data.ObjectSpaces/ObjectReader.cs:
- * System.Data.ObjectSpaces/ObjectSpace.cs:
- * System.Data.ObjectSpaces/ValueRecord.cs:
- * System.Data.ObjectSpaces.Query/Axis.cs:
- Changes to get things to compile
-
-2003-11-15 Richard Thombs <stony@stony.org>
-
- * Added initial System.Data.ObjectSpaces.Query stubs
- * Added Makefile et al
-
+++ /dev/null
-thisdir = class/System.Data.ObjectSpaces
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = System.Data.ObjectSpaces.dll
-LIB_MCS_FLAGS = /r:$(corlib),System.dll,System.Data.dll,System.Xml.dll,System.Data.SqlXml.dll
-TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-
-EXTRA_DISTFILES =
-
-include ../../build/library.make
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.ASTQueryParser
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class ASTQueryParser : ASTBaseParser
- {
- public static Int16 AND;
- public static Int16 ASCEND;
- public static Int16 CAST;
- public static Int16 CONST;
- public static Int16 DESCEND;
- public static Int16 FN_FILENAME;
- public static Int16 FN_FILEPATH;
- public static Int16 FN_ISNULL;
- public static Int16 FN_LEN;
- public static Int16 FN_SUBS;
- public static Int16 FN_TRIM;
- public static Int16 IDENT;
- public static Int16 NEG;
- public static Int16 NOT;
- public static Int16 OP_EQ;
- public static Int16 OP_GR;
- public static Int16 OP_GT;
- public static Int16 OP_IIF;
- public static Int16 OP_IN;
- public static Int16 OP_LE;
- public static Int16 OP_LIKE;
- public static Int16 OP_LT;
- public static Int16 OP_NE;
- public static Int16 OR;
- public static Int16 PARAM;
- public static Int16 PARENT;
- public static Int16 REL;
- public static Int16 YYERRCODE;
-
- [MonoTODO()]
- public ASTQueryParser() : base()
- {
- }
-
- // Create an internal parse tree from the query string.
- [MonoTODO()]
- public override void Parse(string query)
- {
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Axis
-//
-//
-// Authors:
-// Richard Thombs (stony@stony.org)
-// Tim Coleman (tim@timcoleman.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Axis : Filter
- {
- [MonoTODO()]
- public Axis(Expression source,Expression constraint) : base(source,constraint)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsConst {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Binary
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Binary : Expression
- {
- [MonoTODO()]
- public Binary(Expression left,Expression right,BinaryOperator _operator) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static Int64 Compare(object vLeft,object vRight,Type type,BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static object EvaluateConstant(Literal left,BinaryOperator op,Literal right)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static Type GetResultType(Expression leftExpr,Expression rightExpr,BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static bool IsInteger(Type type)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static bool IsOperatorArithmetic(BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static bool IsOperatorBoolean(BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static bool IsOperatorLogical(BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static bool IsOperatorRelational(BinaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- // Gets/sets the left operand of this binary expression
- [MonoTODO()]
- public Expression Left
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- // Gets/sets the operator used by this binary expression
- [MonoTODO()]
- public Expression Operator
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- // Gets/sets the right operand of this binary expression
- [MonoTODO()]
- public Expression Right
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-2003-11-15 Richard Thombs <stony@stony.org>
-
- * Added class and constructor stubs for all classes
-
-2003-11-16 Richard Thombs <stony@stony.org>
-
- * Added 'using System' to all files to pick up the change in namespace of MonoTODO()
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Conditional
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Conditional : Expression
- {
- [MonoTODO()]
- public Conditional(Expression condition,Expression tBranch,Expression fBranch) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- // Gets/sets the condition expression
- [MonoTODO()]
- public Expression Condition
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- // Gets/sets the false branch expression
- [MonoTODO()]
- public Expression FBranch
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- // Gets/sets the true branch expression
- [MonoTODO()]
- public Expression TBranch
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Context
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Context : Expression
- {
- [MonoTODO()]
- public Context() : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public Expression Link
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression SourceLink
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query delegates
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-
-namespace System.Data.ObjectSpaces.Query
-{
- public delegate void EnumNodesCallBack(Expression node,object[] opParams);
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Empty
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Empty : Expression
- {
- [MonoTODO()]
- public Empty() : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query enumerations
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-
-namespace System.Data.ObjectSpaces.Query
-{
- public enum AnnotationType
- {
- QilAnnotation,
- ParseAnnotation,
- AxisNode,
- DebugInfo,
- UserInterface
- }
-
- public enum BinaryOperator
- {
- LogicalAnd,
- LogicalOr,
- Equality,
- Inequality,
- LessThan,
- LessEqual,
- GreaterThan,
- GreaterEqual,
- Addition,
- Subtraction,
- Multiplication,
- Division,
- Modulus,
- Concatenation
- }
-
- public enum FunctionOperator
- {
- Trim,
- Len,
- Like,
- Substring
- }
-
- public enum LiteralType
- {
- String,
- SByte,
- Byte,
- Int16,
- Int32,
- Int64,
- UInt16,
- UInt32,
- UInt64,
- Char,
- Single,
- Double,
- Boolean,
- Decimal,
- Guid,
- DateTime,
- TimeSpan
- }
-
- public enum NodeType
- {
- Aggregate,
- Axis,
- Binary,
- Conditional,
- Context,
- Distinct,
- Empty,
- Expression,
- Filter,
- Function,
- Join,
- InOperator,
- Literal,
- ObjectSpaceNode,
- OrderBy,
- Parameter,
- Parent,
- Projection,
- Property,
- RelTraversal,
- Span,
- Reference,
- TypeCast,
- TypeConversion,
- Unary
- }
-
- public enum RelTraversalDirection
- {
- ToTarget,
- ToSource
- }
-
- public enum UnaryOperator
- {
- Negation,
- LogicalNot,
- IsNull,
- Exists
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Expression
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public abstract class Expression : ICloneable
- {
- public Expression parent;
-
- [MonoTODO()]
- protected Expression()
- {
- throw new NotImplementedException();
- }
-
- public abstract object Clone();
-
- [MonoTODO()]
- public static void EnumNodes(Expression root,EnumNodesCallBack callback)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static void EnumNodes(Expression root,EnumNodesCallBack callback,object[] oParams)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public object GetAnnotation(AnnotationType annotationType)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public virtual bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public virtual bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public virtual bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static void Replace(Expression oldNode,Expression newNode)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void SetAnnotation(AnnotationType annotationType,object o)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public string ToXmlString()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public virtual void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public virtual bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public virtual NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Owner
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public virtual Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
-
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Filter
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Filter : Expression
- {
- [MonoTODO()]
- public Filter(Expression source,Expression constraint) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public bool FindContextCallback(Expression oe,object[] oParams)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public Expression Constraint
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Function
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Function : Expression
- {
- [MonoTODO()]
- public Function(FunctionOperator _operator,Expression[] _params) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Operator
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Params
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Literal
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Literal : Expression
- {
- [MonoTODO()]
- public Literal(object v) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public LiteralType LiteralType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public object Value
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.OPath
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Data.ObjectSpaces.Schema;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class OPath
- {
- [MonoTODO()]
- public static ObjectExpression Parse(ObjectQuery oq,ObjectSchema objectSchema)
- {
- throw new NotImplementedException();
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.ObjectExpression
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-// Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System.Data.ObjectSpaces;
-using System.Data.ObjectSpaces.Schema;
-using System.Data.Mapping;
-
-namespace System.Data.ObjectSpaces.Query {
- public class ObjectExpression
- {
- #region Fields
-
- Expression expression;
- ObjectSchema objectSchema;
-
- #endregion // Fields
-
- #region Constructors
-
- [MonoTODO]
- public ObjectExpression (Expression expression, ObjectSchema objectSchama)
- {
- this.expression = expression;
- this.objectSchema = objectSchema;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public Expression Expression {
- get { return expression; }
- }
-
- public ObjectSchema ObjectSchema {
- get { return objectSchema; }
- }
-
- [MonoTODO]
- public Type ObjectType {
- get { throw new NotImplementedException (); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public CompiledQuery Compile (MappingSchema map)
- {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.ObjectSpaceNode
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-// Tim Coleman (tim@timcoleman.com)
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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
-
-namespace System.Data.ObjectSpaces.Query {
- public class ObjectSpaceNode : Expression
- {
- #region Constructors
-
- public ObjectSpaceNode ()
- : base ()
- {
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- #endregion // Methods
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.OrderBy
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class OrderBy : Expression
- {
- [MonoTODO()]
- public OrderBy(Expression source,OrderByItemCollection orderByItems)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public OrderByItemCollection OrderByItems
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.OrderByItem
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class OrderByItem
- {
- [MonoTODO()]
- public OrderByItem(string item,bool ascendent)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public bool Ascendent
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public string Item
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public object PhysicalInfo
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.OrderByItemCollection
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Collections;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class OrderByItemCollection : CollectionBase
- {
- [MonoTODO()]
- public OrderByItemCollection() : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void Add(OrderByItem orderByItem)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public OrderByItemCollection Clone()
- {
- throw new NotImplementedException();
- }
-
- // FIXME: This ain't right...
- [MonoTODO()]
- public OrderByItem Item
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Parameter
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Parameter : Expression
- {
- public Type inferredType;
-
- [MonoTODO()]
- public Parameter(int ordinal)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void SetOrdinal(int ordinal)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public int Ordinal
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Parent
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Parent : Context
- {
- [MonoTODO()]
- public Parent(Context sContext) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public int Level
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Context Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Property
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Property : Expression
- {
- [MonoTODO()]
- public Property(Expression source,string name) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public bool IsRelational
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public string Name
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Type OwnerClass
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public object PhysicalInfo
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Type PropertyType
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.RelTraversal
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class RelTraversal : Expression
- {
- [MonoTODO()]
- public RelTraversal(RelTraversalDirection direction) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public RelTraversal(string relName,RelTraversalDirection direction) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public RelTraversalDirection Direction
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public string RelName
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Span
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-using System.Collections;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Span : Expression
- {
- [MonoTODO()]
- public Span(Expression source,SpanPropertyCollection spanProperties) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AddToSpanList(SpanProperty sp,ArrayList spanList)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public ArrayList GetSpanList()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void SetSpanProperties(SpanPropertyCollection spanProperties)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public SpanPropertyCollection SpanProperties
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.SpanProperty
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class SpanProperty
- {
- public SpanProperty parent;
-
- [MonoTODO()]
- public SpanProperty(string name)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public SpanProperty(string name,SpanPropertyCollection subSpan)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public string ToXmlString()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public string FullName
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public string Name
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public SpanProperty Owner
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public SpanPropertyCollection SubSpan
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.SpanPropertyCollection
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Collections;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class SpanPropertyCollection : CollectionBase
- {
- [MonoTODO()]
- public SpanPropertyCollection() : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public SpanPropertyCollection Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void Add(SpanProperty spanProperty)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AddRoot(SpanProperty spanProperty)
- {
- throw new NotImplementedException();
- }
-
- // FIXME: This isn't right
- [MonoTODO()]
- public SpanProperty Item
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.TypeCast
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class TypeCast : Expression
- {
- [MonoTODO()]
- public TypeCast() : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public TypeCast(string typeName) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public string TypeName
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.TypeConversion
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class TypeConversion : Expression
- {
- [MonoTODO()]
- public TypeConversion(Expression source,Type type)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Type Type
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.TypeFilter
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class TypeFilter : Expression
- {
- [MonoTODO()]
- public TypeFilter(Expression source,Type type) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public TypeFilter(Expression source,Type type,bool baseTypeOnly) : base()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public bool BaseTypeOnly
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Source
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Type Type
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Data.ObjectSpaces.Query.Unary
-//
-//
-// Author:
-// Richard Thombs (stony@stony.org)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Xml;
-
-namespace System.Data.ObjectSpaces.Query
-{
- [MonoTODO()]
- public class Unary : Expression
- {
- [MonoTODO()]
- public Unary(Expression operand,UnaryOperator _operator)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override object Clone()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public static object EvaluateConstant(Literal literal,UnaryOperator op)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsArithmetic()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsBoolean()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsFilter()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override void WriteXml(XmlWriter xmlw)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public override bool IsConst
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override NodeType NodeType
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public Expression Operand
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public UnaryOperator Operator
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO()]
- public override Type ValueType
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
-
-#endif
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ExtendedProperty.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Xml;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class ExtendedProperty \r
- {\r
- #region Fields\r
-\r
- XmlQualifiedName qname;\r
- object propertyValue;\r
- string prefix;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public ExtendedProperty (XmlQualifiedName qualifiedName, object propertyValue)\r
- {\r
- QualifiedName = qualifiedName;\r
- PropertyValue = propertyValue;\r
- }\r
-\r
- public ExtendedProperty (XmlQualifiedName qualifiedName, object propertyValue, string prefix)\r
- : this (qualifiedName, propertyValue)\r
- {\r
- Prefix = prefix;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public string Prefix {\r
- get { return prefix; }\r
- set { prefix = value; }\r
- }\r
-\r
- public object PropertyValue {\r
- get { return propertyValue; }\r
- set { propertyValue = value; }\r
- }\r
-\r
- public XmlQualifiedName QualifiedName {\r
- get { return qname; }\r
- set { qname = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ExtendedPropertyCollection.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Xml;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class ExtendedPropertyCollection : CollectionBase\r
- {\r
- #region Fields\r
-\r
- ArrayList qnames;\r
-\r
- #endregion\r
-\r
- #region Constructors\r
-\r
- public ExtendedPropertyCollection ()\r
- {\r
- qnames = new ArrayList();\r
- }\r
-\r
- public ExtendedPropertyCollection (ExtendedProperty[] value)\r
- : this ()\r
- {\r
- AddRange (value);\r
- }\r
-\r
- public ExtendedPropertyCollection (ExtendedPropertyCollection value)\r
- : this ()\r
- {\r
- AddRange (value);\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public ExtendedProperty this [int obj] {\r
- get { return (ExtendedProperty) List [obj]; }\r
- set { \r
- List [obj] = value;\r
- qnames [obj] = value.QualifiedName;\r
- }\r
- }\r
-\r
- [MonoTODO]\r
- public ExtendedProperty this [XmlQualifiedName type] {\r
- get { return (ExtendedProperty) List [qnames.IndexOf (type)]; }\r
- set { List [qnames.IndexOf (type)] = value; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public void Add (ExtendedProperty value)\r
- {\r
- Insert (Count, value);\r
- }\r
-\r
- public void AddRange (ExtendedProperty[] value)\r
- {\r
- foreach (ExtendedProperty p in value)\r
- Add (p);\r
- }\r
-\r
- public void AddRange (ExtendedPropertyCollection value)\r
- {\r
- foreach (ExtendedProperty p in value)\r
- Add (p);\r
- }\r
-\r
- public bool Contains (ExtendedProperty value)\r
- {\r
- return List.Contains (value);\r
- }\r
-\r
- public void CopyTo (ExtendedProperty[] array, int index)\r
- {\r
- List.CopyTo (array, index);\r
- }\r
-\r
- public int IndexOf (ExtendedProperty value)\r
- {\r
- return List.IndexOf (value);\r
- }\r
-\r
- [MonoTODO]\r
- public void Insert (int index, ExtendedProperty value)\r
- {\r
- List.Insert (index, value);\r
- qnames [index] = value.QualifiedName;\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnInsert (int index, object value)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnRemove (int index, object value)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public void Remove (ExtendedProperty value)\r
- {\r
- int index = IndexOf (value);\r
- List.Remove (value);\r
- qnames.RemoveAt (index);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ObjectRelationship.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public sealed class ObjectRelationship : IDomainConstraint\r
- {\r
- #region Fields\r
-\r
- string name;\r
- SchemaClass childClass;\r
- SchemaMember childMember;\r
- SchemaClass parentClass;\r
- SchemaMember parentMember;\r
- ObjectRelationshipType type;\r
- bool isCascadeDelete;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public ObjectRelationship (string name, SchemaClass parentClass, SchemaMember parentMember, SchemaClass childClass, SchemaMember childMember, ObjectRelationshipType type)\r
- {\r
- Name = name;\r
- Type = type;\r
-\r
- this.parentClass = parentClass;\r
- this.parentMember = parentMember;\r
- this.childClass = childClass;\r
- this.childMember = childMember;\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationship (string name, SchemaClass parentClass, SchemaMember parentMember, SchemaClass childClass, SchemaMember childMember, ObjectRelationshipType type, bool isCascadeDelete)\r
- : this (name, parentClass, parentMember, childClass, childMember, type)\r
- {\r
- IsCascadeDelete = isCascadeDelete;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public SchemaClass ChildClass {\r
- get { return childClass; }\r
- }\r
-\r
- public SchemaMember ChildMember {\r
- get { return childMember; }\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectSchema DeclaringObjectSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ExtendedPropertyCollection ExtendedProperties {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- bool IDomainConstraint.CascadeDelete {\r
- get { return IsCascadeDelete; }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainSchema IDomainConstraint.DomainSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainFieldJoinCollection IDomainConstraint.FieldJoins {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainStructure IDomainConstraint.FromDomainStructure {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainStructure IDomainConstraint.ToDomainStructure {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- public bool IsCascadeDelete {\r
- get { return isCascadeDelete; }\r
- set { isCascadeDelete = value; }\r
- }\r
-\r
- public string Name {\r
- get { return name; }\r
- set { name = value; }\r
- }\r
-\r
-\r
- public SchemaClass ParentClass {\r
- get { return parentClass; }\r
- }\r
-\r
- public SchemaMember ParentMember {\r
- get { return parentMember; }\r
- }\r
-\r
- public ObjectRelationshipType Type {\r
- get { return type; }\r
- set { type = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ObjectRelationshipCollection.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class ObjectRelationshipCollection : CollectionBase\r
- {\r
- #region Properties\r
-\r
- [MonoTODO]\r
- public ObjectRelationship this [string name] {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationship this [int index] {\r
- get { return (ObjectRelationship) List [index]; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public void Add (ObjectRelationship relationship)\r
- {\r
- Insert (Count, relationship);\r
- }\r
-\r
- public bool Contains (ObjectRelationship relationship)\r
- {\r
- return List.Contains (relationship);\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationship[] GetChildRelationships (Type type)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationship[] GetParentRelationships (Type type)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- public int IndexOf (ObjectRelationship relationship)\r
- {\r
- return List.IndexOf (relationship);\r
- }\r
-\r
- public void Insert (int index, ObjectRelationship relationship)\r
- {\r
- List.Insert (index, relationship);\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnInsert (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnRemove (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- public void Remove (ObjectRelationship relation)\r
- {\r
- List.Remove (relation);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ObjectRelationshipType.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public enum ObjectRelationshipType\r
- {\r
- OneToMany,\r
- OneToOne,\r
- ManyToMany\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.ObjectSchema.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-using System.IO;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class ObjectSchema : ICloneable, IDomainSchema\r
- {\r
- #region Fields\r
-\r
- string name;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public ObjectSchema ()\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectSchema (string url)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- [MonoTODO]\r
- public SchemaClassCollection Classes {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ExtendedPropertyCollection ExtendedProperties {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- MappingDataSourceType IDomainSchema.DomainType {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO ("Verify")]\r
- public string Name {\r
- get { return name; }\r
- set { name = value; }\r
- }\r
-\r
- [MonoTODO]\r
- public string Namespace {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationshipCollection Relationships {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string SourceUri {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public Object Clone ()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public string GetSchemaXml ()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- IDomainConstraint IDomainSchema.GetDomainConstraint (string select, IXmlNamespaceResolver namespaces)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- IDomainStructure IDomainSchema.GetDomainStructure (string select, IXmlNamespaceResolver namespaces)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Read (string url)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Read (string url, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Read (XmlReader reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Read (XmlReader reader, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.ReadExtensions (XmlReader reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.ReadExtensions (XmlReader reader, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (string schemaLocation)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (string schemaLocation, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (XmlWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (XmlWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (Stream stream)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (Stream stream, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (TextWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.Write (TextWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.WriteExtensions (XmlWriter reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IDomainSchema.WriteExtensions (XmlWriter reader, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (string url)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (string url, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (XmlReader reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (XmlReader reader, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Reset ()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (string schemaLocation)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (string schemaLocation, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (XmlWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (XmlWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (Stream stream)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (Stream stream, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (TextWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (TextWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.SchemaClass.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-using System.Xml;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public sealed class SchemaClass : IDomainStructure\r
- {\r
- #region Fields\r
-\r
- bool canInherit;\r
- Type classType;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public SchemaClass ()\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaClass (Type classType)\r
- {\r
- ClassType = classType;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public bool CanInherit {\r
- get { return canInherit; }\r
- set { canInherit = value; }\r
- }\r
-\r
- public Type ClassType {\r
- get { return classType; }\r
- set { classType = value; }\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectSchema DeclaringObjectSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ExtendedPropertyCollection ExtendedProperties {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainSchema IDomainStructure.DomainSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- string IDomainStructure.Select {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaMemberCollection SchemaMembers {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- IDomainField IDomainStructure.GetDomainField (string select, IXmlNamespaceResolver namespaces)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.SchemaClassCollection.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class SchemaClassCollection : CollectionBase\r
- {\r
- #region Properties\r
-\r
- public SchemaClass this [int index] {\r
- get { return (SchemaClass) List [index]; }\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaClass this [string typeName] {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public void Add (SchemaClass schemaClass)\r
- {\r
- Insert (Count, schemaClass);\r
- }\r
-\r
- public bool Contains (SchemaClass schemaClass)\r
- {\r
- return List.Contains (schemaClass);\r
- }\r
-\r
- public void CopyTo (SchemaClass[] array, int index)\r
- {\r
- List.CopyTo (array, index);\r
- }\r
-\r
- public int IndexOf (SchemaClass schemaClass)\r
- {\r
- return List.IndexOf (schemaClass);\r
- }\r
-\r
- public void Insert (int index, SchemaClass schemaClass)\r
- {\r
- List.Insert (index, schemaClass);\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnInsert (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnRemove (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- public void Remove (SchemaClass schemaClass)\r
- {\r
- List.Remove (schemaClass);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.SchemaMember.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-using System.Reflection;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class SchemaMember : IDomainField\r
- {\r
- #region Fields\r
-\r
- string alias;\r
- bool isHidden;\r
- bool isKey;\r
- bool isLazyLoad;\r
- KeyGenerator keyGenerator;\r
- string name;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public SchemaMember ()\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaMember (string name)\r
- {\r
- Name = name;\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaMember (string name, bool key)\r
- : this (name)\r
- {\r
- IsKey = key;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public string Alias {\r
- get { return alias; }\r
- set { alias = value; }\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaClass DeclaringSchemaClass {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public ExtendedPropertyCollection ExtendedProperties {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- IDomainStructure IDomainField.DomainStructure {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- public bool IsHidden {\r
- get { return isHidden; }\r
- set { isHidden = value; }\r
- }\r
-\r
- public bool IsKey {\r
- get { return isKey; }\r
- set { isKey = value; }\r
- }\r
-\r
- public bool IsLazyLoad {\r
- get { return isLazyLoad; }\r
- set { isLazyLoad = value; }\r
- }\r
-\r
- public KeyGenerator KeyGenerator {\r
- get { return keyGenerator; }\r
- set { keyGenerator = value; }\r
- }\r
-\r
- [MonoTODO]\r
- public MemberInfo MemberInfo {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- public string Name {\r
- get { return name; }\r
- set { name = value; }\r
- }\r
-\r
- [MonoTODO]\r
- public ObjectRelationship ObjectRelationship {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Schema.SchemaMemberCollection.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces.Schema {\r
- public class SchemaMemberCollection : CollectionBase\r
- {\r
- #region Properties\r
-\r
- public SchemaMember this [int index] {\r
- get { return (SchemaMember) List [index]; }\r
- }\r
-\r
- [MonoTODO]\r
- public SchemaMember this [string typeName] {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public void Add (SchemaMember member)\r
- {\r
- Insert (Count, member);\r
- }\r
-\r
- public bool Contains (SchemaMember member)\r
- {\r
- return List.Contains (member);\r
- }\r
-\r
- public void CopyTo (SchemaMember[] array, int index)\r
- {\r
- List.CopyTo (array, index);\r
- }\r
-\r
- public int IndexOf (SchemaMember member)\r
- {\r
- return List.IndexOf (member);\r
- }\r
-\r
- public void Insert (int index, SchemaMember member)\r
- {\r
- List.Insert (index, member);\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnInsert (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnRemove (int index, object value)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- public void Remove (SchemaMember member)\r
- {\r
- List.Remove (member);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-Assembly/AssemblyInfo.cs
-Assembly/Locale.cs
-System/TODOAttribute.cs
-System.Data.ObjectSpaces/ASTBaseParser.cs
-System.Data.ObjectSpaces/AstKeywords.cs
-System.Data.ObjectSpaces/CommonObjectContext.cs
-System.Data.ObjectSpaces/CompiledQuery.cs
-System.Data.ObjectSpaces/ContextException.cs
-System.Data.ObjectSpaces/DbObjectReader.cs
-System.Data.ObjectSpaces/Depth.cs
-System.Data.ObjectSpaces/DynamicAssembly.cs
-System.Data.ObjectSpaces/InitialState.cs
-System.Data.ObjectSpaces/IObjectHelper.cs
-System.Data.ObjectSpaces/IObjectNotification.cs
-System.Data.ObjectSpaces/KeyGenerator.cs
-System.Data.ObjectSpaces/ManyToManyRelationship.cs
-System.Data.ObjectSpaces/ManyToOneRelationship.cs
-System.Data.ObjectSpaces/ObjectContext.cs
-System.Data.ObjectSpaces/ObjectEngine.cs
-System.Data.ObjectSpaces/ObjectException.cs
-System.Data.ObjectSpaces/ObjectHolder.cs
-System.Data.ObjectSpaces/ObjectKey.cs
-System.Data.ObjectSpaces/ObjectKeyManager.cs
-System.Data.ObjectSpaces/ObjectList.cs
-System.Data.ObjectSpaces/ObjectQuery.cs
-System.Data.ObjectSpaces/ObjectReader.cs
-System.Data.ObjectSpaces/ObjectSet.cs
-System.Data.ObjectSpaces/ObjectSources.cs
-System.Data.ObjectSpaces/ObjectSpace.cs
-System.Data.ObjectSpaces/ObjectState.cs
-System.Data.ObjectSpaces/OneToManyRelationship.cs
-System.Data.ObjectSpaces/OneToOneRelationship.cs
-System.Data.ObjectSpaces/PersistenceError.cs
-System.Data.ObjectSpaces/PersistenceErrorBehavior.cs
-System.Data.ObjectSpaces/PersistenceErrorType.cs
-System.Data.ObjectSpaces/PersistenceException.cs
-System.Data.ObjectSpaces/PersistenceOptions.cs
-System.Data.ObjectSpaces/UpdateErrorType.cs
-System.Data.ObjectSpaces/ValueRecord.cs
-System.Data.ObjectSpaces/ValueRecordMergeEventArgs.cs
-System.Data.ObjectSpaces/ValueRecordMergeEventHandler.cs
-System.Data.ObjectSpaces.Query/ASTQueryParser.cs
-System.Data.ObjectSpaces.Query/Axis.cs
-System.Data.ObjectSpaces.Query/Binary.cs
-System.Data.ObjectSpaces.Query/Conditional.cs
-System.Data.ObjectSpaces.Query/Context.cs
-System.Data.ObjectSpaces.Query/Delegates.cs
-System.Data.ObjectSpaces.Query/Empty.cs
-System.Data.ObjectSpaces.Query/Enumerations.cs
-System.Data.ObjectSpaces.Query/Expression.cs
-System.Data.ObjectSpaces.Query/Filter.cs
-System.Data.ObjectSpaces.Query/Function.cs
-System.Data.ObjectSpaces.Query/Literal.cs
-System.Data.ObjectSpaces.Query/ObjectExpression.cs
-System.Data.ObjectSpaces.Query/ObjectSpaceNode.cs
-System.Data.ObjectSpaces.Query/OPath.cs
-System.Data.ObjectSpaces.Query/OrderBy.cs
-System.Data.ObjectSpaces.Query/OrderByItemCollection.cs
-System.Data.ObjectSpaces.Query/OrderByItem.cs
-System.Data.ObjectSpaces.Query/Parameter.cs
-System.Data.ObjectSpaces.Query/Parent.cs
-System.Data.ObjectSpaces.Query/Property.cs
-System.Data.ObjectSpaces.Query/RelTraversal.cs
-System.Data.ObjectSpaces.Query/Span.cs
-System.Data.ObjectSpaces.Query/SpanPropertyCollection.cs
-System.Data.ObjectSpaces.Query/SpanProperty.cs
-System.Data.ObjectSpaces.Query/TypeCast.cs
-System.Data.ObjectSpaces.Query/TypeConversion.cs
-System.Data.ObjectSpaces.Query/TypeFilter.cs
-System.Data.ObjectSpaces.Query/Unary.cs
-System.Data.ObjectSpaces.Schema/SchemaClass.cs
-System.Data.ObjectSpaces.Schema/ObjectRelationship.cs
-System.Data.ObjectSpaces.Schema/ObjectRelationshipCollection.cs
-System.Data.ObjectSpaces.Schema/ObjectRelationshipType.cs
-System.Data.ObjectSpaces.Schema/ObjectSchema.cs
-System.Data.ObjectSpaces.Schema/SchemaMemberCollection.cs
-System.Data.ObjectSpaces.Schema/SchemaMember.cs
-System.Data.ObjectSpaces.Schema/SchemaClassCollection.cs
-System.Data.ObjectSpaces.Schema/ExtendedProperty.cs
-System.Data.ObjectSpaces.Schema/ExtendedPropertyCollection.cs
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ASTBaseParser.cs - Implements a base Abstract Syntax Tree parser\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-using System.Data.ObjectSpaces.Query;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ASTBaseParser\r
- {\r
- public int lexerPos; //The current position in the lexical analyser\r
- public int parCount; //The parse number\r
- public Expression parseTree; //The parse tree\r
- \r
- [MonoTODO]\r
- public ASTBaseParser () {}\r
- \r
-\r
-\r
- [MonoTODO]\r
- protected Expression BuildBinaryNode (Expression left, Expression right, BinaryOperator op)\r
- {\r
- return null;\r
- }\r
-\r
- [MonoTODO]\r
- protected Expression BuildConditionalNode (Expression condition, Expression trueBranch, Expression falseBranch)\r
- {\r
- return null;\r
- }\r
-\r
- [MonoTODO] \r
- protected Expression BuildUnaryNode (Expression node, UnaryOperator op)\r
- {\r
- return null;\r
- }\r
-\r
- [MonoTODO] \r
- protected Expression GetConstraint (Axis filter)\r
- {\r
- return null;\r
- }\r
-\r
- [MonoTODO]\r
- public virtual void Parse (string opath) {}\r
-\r
- [MonoTODO]\r
- public virtual void ParseObjectQuery (Type type, string opath, bool baseTypeOnly) {}\r
- \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.AstKeywords.cs : The recognised keywords for Abstract Syntax Trees\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class AstKeywords\r
- {\r
- public static string arithmetic;\r
- public static string axisQueries;\r
- public static string boolean;\r
- public static string condition;\r
- public static string conditional;\r
- public static string constraint;\r
- public static string falseBranch;\r
- public static string filter;\r
- public static string first;\r
- public static string left;\r
- public static string len;\r
- public static string like;\r
- public static string name;\r
- public static string objectSchema;\r
- public static string operand;\r
- public static string @operator;\r
- public static string orderByItem;\r
- public static string @params;\r
- public static string right;\r
- public static string second;\r
- public static string source;\r
- public static string spanProperties;\r
- public static string spanProperty;\r
- public static string substring;\r
- public static string trim;\r
- public static string trueBranch;\r
- public static string type;\r
- public static string value;\r
- \r
- [MonoTODO]\r
- public AstKeywords () {}\r
- \r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-2004-01-02 Tim Coleman <tim@timcoleman.com>
- * ChangeLog:
- Start ChangeLog in this directory
- * DynamicAssembly.cs ObjectList.cs ObjectReader.cs ObjectSet.cs
- * ObjectSources.cs PersistenceError.cs PersistenceOptions.cs:
- More implementation of these classes
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.CommonObjectContext.cs : A basic ObjectContext for handling persistent object identity and state.\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-using System.Data.ObjectSpaces.Schema;\r
-using System.Globalization;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class CommonObjectContext : ObjectContext\r
- {\r
- #region Fields\r
-\r
- ObjectSchema objectSchema;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public CommonObjectContext (ObjectSchema objectSchema)\r
- {\r
- if (objectSchema == null)\r
- throw new ArgumentNullException ("objectSchema", Locale.GetText ("'objectSchema' argument cannot be null."));\r
- this.objectSchema = objectSchema;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
- \r
- [MonoTODO]\r
- public override void Add (object obj, ObjectState state)\r
- {\r
- if (obj == null)\r
- throw new ContextException (Locale.GetText ("Cannot add null object into any object context."));\r
- if (!Enum.IsDefined (typeof (ObjectState), state))\r
- throw new NullReferenceException ();\r
- if (state == ObjectState.Unknown)\r
- throw new ContextException (Locale.GetText ("Cannot add any object into an object context as an Unknown object."));\r
- }\r
-\r
- [MonoTODO]\r
- public override void Delete (object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- }\r
- \r
- [MonoTODO]\r
- public override ValueRecord GetCurrentValueRecord (object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- \r
- return null; \r
- }\r
- \r
- [MonoTODO]\r
- public override ObjectState GetObjectState (object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- \r
- throw new NotImplementedException ();\r
- }\r
- \r
- [MonoTODO]\r
- public override ValueRecord GetOriginalValueRecord (object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- \r
- return null; \r
- }\r
- \r
- [MonoTODO]\r
- public override void Import (ObjectContext context)\r
- {\r
- if (context == null)\r
- throw new ArgumentNullException ("context", Locale.GetText ("'context' argument cannot be null."));\r
- }\r
- \r
- [MonoTODO]\r
- public override void Import (ObjectContext context, object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- if (context == null)\r
- throw new ArgumentNullException ("context", Locale.GetText ("'context' argument cannot be null."));\r
- }\r
-\r
- [MonoTODO]\r
- public override void Remove (object obj)\r
- {\r
- if (obj == null)\r
- throw new ArgumentNullException ("obj", Locale.GetText ("'obj' argument cannot be null."));\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.CompiledQuery.cs : A pre-compiled OPath query\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class CompiledQuery\r
- {\r
- [MonoTODO]\r
- private CompiledQuery () {}\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ContextException.cs : The exception thrown when an ObjectContext encounters an error\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-using System.Globalization;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ContextException : ObjectException\r
- {\r
- [MonoTODO] \r
- public ContextException () \r
- : base (Locale.GetText ("A Context Exception has occurred."))\r
- {\r
- }\r
- \r
- [MonoTODO]\r
- protected ContextException (SerializationInfo info, StreamingContext context) \r
- : base (info, context)\r
- {\r
- }\r
- \r
- [MonoTODO]\r
- public ContextException (string message) \r
- : base (message)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public ContextException (string message, Exception innerException) \r
- : base (message, innerException)\r
- {\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.DbObjectReader.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-using System.Data;\r
-using System.Data.Mapping;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class DbObjectReader : ObjectReader\r
- {\r
- [MonoTODO]\r
- public DbObjectReader (IDataReader dataReader, Type type, MappingSchema map) \r
- {\r
- if (dataReader == null || type == null || map == null)\r
- throw new ObjectException ();\r
- \r
- }\r
- \r
- [MonoTODO] \r
- public DbObjectReader (IDataReader dataReader, Type type, MappingSchema map, ObjectContext context)\r
- {\r
- if (dataReader == null || type == null || map == null || context == null)\r
- throw new ObjectException (); \r
- }\r
-\r
- [MonoTODO]\r
- public override bool HasObjects {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- [MonoTODO]\r
- public bool NextResult (Type type, MappingSchema map)\r
- {\r
- return false; \r
- }\r
-\r
- [MonoTODO]\r
- public bool NextResult (Type type, MappingSchema map, ObjectContext context)\r
- {\r
- return false; \r
- }\r
- \r
- [MonoTODO]\r
- public override void Close ()\r
- { \r
- base.Close();\r
- }\r
- \r
- [MonoTODO]\r
- public override bool Read()\r
- {\r
- return false; \r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Depth.cs - Specifies the shallowness of object changing operations\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum Depth\r
- {\r
- SingleObject,\r
- ObjectGraph\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.DynamicAssembly.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-using System.Reflection;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class DynamicAssembly\r
- {\r
- private Type type; //The underlying type\r
- protected FieldInfo fInfo;\r
- protected PropertyInfo pInfo;\r
- \r
- [MonoTODO]\r
- protected DynamicAssembly (Type type) \r
- {\r
- ConstructorInfo ci = type.GetConstructor (Type.EmptyTypes);\r
- if (ci == null)\r
- throw new ObjectException (String.Format ("Cannot find suitable constructor in type '{0}'", type.FullName));\r
- this.type = type;\r
- }\r
-\r
- public Type UnderlyingType {\r
- get { return this.type; }\r
- }\r
- \r
- \r
- [MonoTODO]\r
- public virtual object CreateObject (ObjectEngine engine,\r
- ObjectContext context,\r
- MappingSchema map,\r
- ObjectSources sources) \r
- {\r
- return null; \r
- }\r
-\r
- internal static DynamicAssembly GetDynamicAssembly (Type type)\r
- {\r
- return new DynamicAssembly (type);\r
- }\r
-\r
- [MonoTODO]\r
- public FieldInfo[] GetFields() \r
- {\r
- return null; \r
- }\r
-\r
- [MonoTODO]\r
- public PropertyInfo[] GetProperties () \r
- {\r
- return null; \r
- }\r
-\r
-\r
-\r
- [MonoTODO]\r
- public virtual object GetValue (object obj, PropertyInfo propertyInfo) \r
- {\r
- return null; \r
- }\r
- \r
- [MonoTODO]\r
- public virtual object GetValue (object obj, FieldInfo fieldInfo)\r
- {\r
- return null; \r
- }\r
- \r
- [MonoTODO]\r
- public virtual object GetValue (object obj, MemberInfo memberInfo, string memberPath)\r
- {\r
- return null; \r
- }\r
-\r
-\r
-\r
- [MonoTODO]\r
- public virtual void SetValue (object obj, PropertyInfo propertyInfo, object value) {}\r
- \r
- [MonoTODO]\r
- public virtual void SetValue (object obj, FieldInfo fieldInfo, object value) {}\r
- \r
- [MonoTODO]\r
- public virtual void SetValue (object obj, MemberInfo memberInfo, string memberPath, object value) {} \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.IObjectHelper.cs - Helps out a bit...\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public interface IObjectHelper\r
- {\r
- object this [string name] {\r
- get;\r
- set;\r
- }\r
- \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.IObjectNotification.cs - Provides notification of events during a persisted objects lifetime\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public interface IObjectNotification\r
- {\r
- void OnCreated ();\r
- void OnCreating ();\r
- void OnDeleted ();\r
- void OnDeleting ();\r
- void OnMaterialized ();\r
- void OnPersistError ();\r
- void OnUpdated ();\r
- void OnUpdating ();\r
- \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.InitialState.cs - The initial ObjectState for new objects\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum InitialState\r
- {\r
- Inserted,\r
- Changed\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.KeyGenerator.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public abstract class KeyGenerator\r
- {\r
- [MonoTODO]\r
- protected KeyGenerator () \r
- {\r
- }\r
- \r
- public abstract Type OwnerType { get; }\r
-\r
- public abstract string UserParameter { get; }\r
- \r
- public abstract Type GetKeyType ();\r
- \r
- public abstract void Initialize (Type type, string userParameter);\r
- \r
- public abstract object NextKey ();\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ManyToManyRelationship.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ManyToManyRelationship : ObjectKeyManager \r
- {\r
- [MonoTODO]\r
- public ArrayList ObjectKeys {\r
- get { return null; }\r
- } \r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ManyToOneRelationship.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ManyToOneRelationship : ObjectKeyManager \r
- {\r
- [MonoTODO]\r
- public ObjectKey ForeignKey {\r
- get { return null; }\r
- set {}\r
- } \r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectContext.cs : Handles identity and state for persistent objects.\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public abstract class ObjectContext\r
- {\r
- [MonoTODO]\r
- protected ObjectContext () \r
- {\r
- }\r
- \r
- public virtual void Add (object obj) \r
- {\r
- Add (obj, (ObjectState) (-1));\r
- }\r
- \r
- [MonoTODO]\r
- public virtual void Add (object obj, ObjectState state) \r
- {\r
- }\r
-\r
- public abstract void Delete (object obj);\r
- public abstract ValueRecord GetCurrentValueRecord (object obj);\r
- \r
- public static ObjectContext GetInternalContext (ObjectSpace objectSpace)\r
- {\r
- return objectSpace.ObjectContext;\r
- }\r
- \r
- public static ObjectContext GetInternalContext (ObjectSet objectSet)\r
- {\r
- return objectSet.ObjectContext;\r
- }\r
- \r
- public abstract ObjectState GetObjectState (object obj);\r
- public abstract ValueRecord GetOriginalValueRecord (object obj);\r
- public abstract void Import (ObjectContext context);\r
- public abstract void Import (ObjectContext context, object obj);\r
- public abstract void Remove (object obj);\r
- \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectEngine.cs : Handles low-level object persistence operations with data sources.\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Data.Mapping;\r
-using System.Reflection;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ObjectEngine\r
- {\r
- [MonoTODO]\r
- public static void Fetch (MappingSchema map, ObjectSources sources, ObjectContext context,\r
- object obj, string propertyName) {}\r
-\r
- [MonoTODO]\r
- public static ObjectReader GetObjectReader (ObjectSources sources, ObjectContext context,\r
- CompiledQuery compiledQuery, object[] parameters)\r
- {\r
- return null; \r
- }\r
-\r
- [MonoTODO]\r
- public static ValueRecord GetPersistentValueRecord (MappingSchema map, ObjectSources sources, object obj)\r
- {\r
- return null; \r
- }\r
- \r
- [MonoTODO]\r
- public static void PersistChanges(MappingSchema map, ObjectSources sources,\r
- ObjectContext context, ICollection objs, PersistenceOptions options) {}\r
- \r
- [MonoTODO]\r
- public static void Resync (MappingSchema map, ObjectSources sources,\r
- ObjectContext context, ICollection objs, Depth depth) {}\r
- \r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectException.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-using System.Globalization;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ObjectException : SystemException\r
- {\r
- [MonoTODO()]\r
- protected ObjectException (SerializationInfo info, StreamingContext context)\r
- : base (info, context)\r
- {\r
- }\r
-\r
- [MonoTODO()]\r
- public ObjectException ()\r
- : base (Locale.GetText ("An object exception has occurred."))\r
- {\r
- }\r
-\r
- [MonoTODO()]\r
- public ObjectException (String s)\r
- : base (s)\r
- {\r
- }\r
-\r
- [MonoTODO()]\r
- public ObjectException (String s, Exception innerException)\r
- : base (s, innerException)\r
- {\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectHolder.cs - An object wrapper to facilitate delayed loading\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ObjectHolder\r
- {\r
- private object innerObject; //The wrapped object\r
- \r
- [MonoTODO]\r
- public ObjectHolder () {}\r
- \r
- [MonoTODO]\r
- public object InnerObject {\r
- get { return this.innerObject; }\r
- set { this.innerObject = value; }\r
- } \r
- \r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectKey.cs : Provides a unique identifer for persistable objects\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ObjectKey\r
- {\r
- \r
- [MonoTODO]\r
- public ObjectKey (Type type, object[] values) {}\r
- \r
- [MonoTODO]\r
- public ObjectKey (Type type, string key) {}\r
-\r
- [MonoTODO]\r
- public string KeyText { \r
- get{ return String.Empty; }\r
- }\r
- \r
- [MonoTODO]\r
- public Type Type { \r
- get{ return typeof(object); }\r
- }\r
- \r
- [MonoTODO]\r
- public object[] Values { \r
- get{ return null; }\r
- }\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectKeyManager.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public abstract class ObjectKeyManager \r
- {\r
- [MonoTODO]\r
- public override bool Equals (object obj) \r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public override int GetHashCode () \r
- {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectList.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Reflection;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ObjectList : ICollection, IEnumerable, IList\r
- {\r
- #region Fields\r
-\r
- IList list;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public ObjectList () \r
- : this (typeof (ArrayList), null) \r
- {\r
- }\r
-\r
- public ObjectList (Type type, object[] parameters)\r
- {\r
- if (type == null)\r
- throw new ObjectException ();\r
-\r
- bool isIList = false;\r
- foreach (Type t in type.GetInterfaces ())\r
- if (t.Equals (typeof (IList))) {\r
- isIList = true;\r
- break;\r
- }\r
-\r
- if (!isIList)\r
- throw new ObjectException ();\r
-\r
- Type[] types = Type.EmptyTypes;\r
- if (parameters != null)\r
- types = Type.GetTypeArray (parameters);\r
-\r
- ConstructorInfo ci = type.GetConstructor (types);\r
- list = (IList) ci.Invoke (parameters);\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public int Count {\r
- get { return InnerList.Count; }\r
- } \r
-\r
- bool ICollection.IsSynchronized { \r
- get { return InnerList.IsSynchronized; }\r
- }\r
-\r
- object ICollection.SyncRoot {\r
- get { return InnerList.SyncRoot; }\r
- }\r
- \r
- public IList InnerList {\r
- get { return list; }\r
- } \r
- \r
- public bool IsFixedSize {\r
- get { return InnerList.IsFixedSize; }\r
- } \r
-\r
- public bool IsReadOnly {\r
- get { return InnerList.IsReadOnly; }\r
- }\r
- \r
- public object this [int index] {\r
- get { return InnerList [index]; }\r
- set { InnerList [index] = value; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
- \r
- public int Add (object value)\r
- {\r
- return InnerList.Add (value);\r
- }\r
- \r
- public void Clear () \r
- {\r
- InnerList.Clear ();\r
- }\r
- \r
- public bool Contains (object value)\r
- {\r
- return InnerList.Contains (value);\r
- }\r
- \r
- public void CopyTo (Array array, int index) \r
- {\r
- InnerList.CopyTo (array, index);\r
- }\r
- \r
- public IEnumerator GetEnumerator ()\r
- {\r
- return InnerList.GetEnumerator (); \r
- }\r
- \r
- public int IndexOf (object value)\r
- {\r
- return InnerList.IndexOf (value);\r
- }\r
- \r
- public void Insert (int index, object value) \r
- {\r
- InnerList.Insert (index, value);\r
- }\r
- \r
- public void Remove (object value) \r
- {\r
- InnerList.Remove (value);\r
- }\r
- \r
- public void RemoveAt (int index) \r
- {\r
- InnerList.RemoveAt (index);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectQuery.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ObjectQuery\r
- {\r
- bool baseTypeOnly;\r
- Type objectType;\r
- string query;\r
- string sort;\r
- string span;\r
-\r
- [MonoTODO()]\r
- public ObjectQuery (Type type, string query)\r
- : this (type, query, null)\r
- {\r
- }\r
-\r
- [MonoTODO()]\r
- public ObjectQuery (Type type, string query, string span)\r
- {\r
- SetObjectType (type);\r
- SetQuery (query);\r
-\r
- this.baseTypeOnly = false;\r
- this.sort = null;\r
- this.span = span;\r
- }\r
-\r
- [MonoTODO("Error handling")]\r
- public bool BaseTypeOnly {\r
- get { return baseTypeOnly; }\r
- set { baseTypeOnly = value; }\r
- }\r
-\r
- public Type ObjectType {\r
- get { return objectType; }\r
- }\r
-\r
- public string Query {\r
- get { return query; }\r
- }\r
-\r
- public string Sort {\r
- get { return sort; }\r
- set { sort = value; }\r
- }\r
-\r
- public string Span {\r
- get { return span; }\r
- }\r
-\r
- [MonoTODO()]\r
- private void SetObjectType (Type type)\r
- {\r
- objectType = type;\r
- }\r
-\r
- [MonoTODO()]\r
- private void SetQuery (string query)\r
- {\r
- this.query = query;\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectReader.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public abstract class ObjectReader : IDisposable, IEnumerable\r
- {\r
- #region Fields\r
-\r
- bool isClosed = true; \r
- bool disposed;\r
-\r
- #endregion // Fields\r
-\r
- #region Properties\r
-\r
- [MonoTODO]\r
- public object Current { \r
- get { return null; }\r
- }\r
-\r
- public abstract bool HasObjects { get; }\r
-\r
- [MonoTODO]\r
- public virtual bool IsClosed { \r
- get { return this.isClosed; } \r
- } \r
-\r
-\r
- [MonoTODO]\r
- public ObjectContext ObjectContext { \r
- get { return null; } \r
- }\r
-\r
-\r
- [MonoTODO]\r
- public Type ObjectType { \r
- get { return null; } \r
- }\r
-\r
-\r
- [MonoTODO]\r
- public virtual void Close ()\r
- { \r
- this.isClosed = true;\r
- } \r
-\r
- #endregion // Properties\r
-\r
- #region Events and Delegates\r
-\r
- //Inform listeners when a ValueRecord is being merged\r
- public event ValueRecordMergeEventHandler ValueMerging; \r
-\r
- #endregion // Events and Delegates\r
-\r
- #region Methods\r
-\r
- protected virtual void Dispose (bool disposing) \r
- {\r
- if (!disposed) {\r
- if (disposing) {\r
- Close ();\r
- }\r
- disposed = true;\r
- }\r
- }\r
-\r
- [MonoTODO]\r
- public IEnumerator GetEnumerator ()\r
- {\r
- return null;\r
- }\r
-\r
- void IDisposable.Dispose ()\r
- {\r
- Dispose (true);\r
- GC.SuppressFinalize (this);\r
- }\r
-\r
- [MonoTODO]\r
- protected virtual void OnValueMerging (ValueRecordMergeEventArgs e)\r
- {\r
- if (this.ValueMerging != null)\r
- this.ValueMerging (this, e);\r
- }\r
- \r
- \r
- [MonoTODO]\r
- public virtual bool Read()\r
- {\r
- return false; \r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectSet.cs \r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.ComponentModel;\r
-using System.Data.ObjectSpaces.Schema;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-using System.Xml.Serialization;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ObjectSet : CollectionBase, IListSource, IXmlSerializable\r
- { \r
- #region Fields\r
-\r
- DynamicAssembly da;\r
- ObjectContext context;\r
- ObjectSchema os;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public ObjectSet (Type t, ObjectSchema oschema)\r
- {\r
- da = DynamicAssembly.GetDynamicAssembly (t);\r
- os = oschema;\r
- context = new CommonObjectContext (oschema);\r
- }\r
-\r
- public ObjectSet ()\r
- : this (typeof (object), new ObjectSchema ())\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- [MonoTODO]\r
- public object this [int i] {\r
- get { return InnerList [i]; }\r
- set { InnerList [i] = value; }\r
- }\r
-\r
- [MonoTODO]\r
- bool IListSource.ContainsListCollection {\r
- get { throw new NotImplementedException(); }\r
- }\r
- \r
- internal ObjectContext ObjectContext {\r
- get { return context; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public void Add (object o)\r
- {\r
- Type t = o.GetType ();\r
- if (t != da.UnderlyingType)\r
- throw new ObjectException (String.Format (Locale.GetText ("Wrong Object type '{0}' added to ObjectSet. ObjectSet type is '{1}'"), t.FullName, da.UnderlyingType.FullName));\r
- context.Add (o, ObjectState.Inserted);\r
- InnerList.Add (o);\r
- }\r
-\r
- public void Add (ICollection c)\r
- {\r
- foreach (object o in c)\r
- Add (o);\r
- }\r
-\r
- public void Add (object o, ObjectState state)\r
- {\r
- Type t = o.GetType ();\r
- if (t != da.UnderlyingType)\r
- throw new ObjectException (String.Format (Locale.GetText ("Wrong Object type '{0}' added to ObjectSet. ObjectSet type is '{1}'"), t.FullName, da.UnderlyingType.FullName));\r
- context.Add (o, state);\r
- InnerList.Add (o);\r
- }\r
-\r
- [MonoTODO]\r
- public void GetRemotingDiffGram (XmlWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- IList IListSource.GetList ()\r
- {\r
- return List;\r
- }\r
-\r
- [MonoTODO]\r
- XmlSchema IXmlSerializable.GetSchema()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- void IXmlSerializable.ReadXml (XmlReader reader)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- void IXmlSerializable.WriteXml (XmlWriter writer)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnInsertComplete (int index, object value)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnRemoveComplete (int index, object value)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- protected override void OnSetComplete (int index, object oldValue, object newValue)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- public void StartTracking (Object o, InitialState state)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectSources.cs \r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public class ObjectSources : IDataSources, IEnumerable\r
- {\r
- Hashtable table;\r
-\r
- #region Constructors\r
-\r
- public ObjectSources ()\r
- {\r
- table = new Hashtable ();\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties \r
-\r
- public int Count {\r
- get { return table.Count; }\r
- }\r
-\r
- public object this [string name] {\r
- get { return table [name]; }\r
- }\r
-\r
- #endregion // Properties\r
- \r
- #region Methods\r
-\r
- public void Add (string name, IDbConnection connection)\r
- {\r
- table.Add (name, connection);\r
- }\r
-\r
- public void Add (string name, IDbTransaction transaction)\r
- {\r
- table.Add (name, transaction);\r
- }\r
-\r
- public void Clear ()\r
- {\r
- table.Clear ();\r
- }\r
-\r
- public bool Contains (string name)\r
- {\r
- return table.Contains (name);\r
- }\r
-\r
- public void Remove (string name)\r
- {\r
- table.Remove (name);\r
- }\r
-\r
- public virtual IDictionaryEnumerator GetEnumerator ()\r
- {\r
- return table.GetEnumerator ();\r
- }\r
-\r
- IEnumerator IEnumerable.GetEnumerator ()\r
- {\r
- return GetEnumerator ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectSpace.cs : Handles high-level object persistence interactions with a data source.\r
-//\r
-// Authors:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Data;\r
-using System.Data.Mapping;\r
-using System.Data.ObjectSpaces.Query;\r
-using System.Data.ObjectSpaces.Schema;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ObjectSpace\r
- { \r
- #region Fields\r
-\r
- MappingSchema map;\r
- ObjectSources sources;\r
- ObjectSchema os;\r
- CommonObjectContext context;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- private ObjectSpace ()\r
- : base ()\r
- {\r
- os = new ObjectSchema ();\r
- context = new CommonObjectContext (os);\r
- }\r
-\r
- [MonoTODO] \r
- public ObjectSpace (MappingSchema map, ObjectSources sources) \r
- : this ()\r
- {\r
- this.map = map;\r
- this.sources = sources;\r
- }\r
- \r
- [MonoTODO ("Figure out correct name")]\r
- public ObjectSpace (string mapFile, IDbConnection con) \r
- : this ()\r
- {\r
- map = new MappingSchema (mapFile);\r
- sources = new ObjectSources ();\r
- sources.Add (map.DataSources [0].Name, con);\r
- }\r
- \r
- public ObjectSpace (string mapFile, ObjectSources sources) \r
- : this ()\r
- {\r
- map = new MappingSchema (mapFile);\r
- this.sources = sources;\r
- }\r
- \r
- [MonoTODO ("Figure out correct name")]\r
- public ObjectSpace (MappingSchema map, IDbConnection con) \r
- : this ()\r
- {\r
- this.map = map;\r
- sources = new ObjectSources ();\r
- sources.Add (map.DataSources [0].Name, con);\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- internal ObjectContext ObjectContext {\r
- get { return context; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public object GetObject (ObjectQuery query, object[] parameters)\r
- {\r
- return GetObject (GetObjectReader (query, parameters));\r
- }\r
-\r
- public object GetObject (Type type, string queryString)\r
- {\r
- return GetObject (GetObjectReader (type, queryString));\r
- }\r
-\r
- public object GetObject (Type type, string queryString, string relatedSpan)\r
- {\r
- return GetObject (GetObjectReader (type, queryString));\r
- }\r
-\r
- private object GetObject (ObjectReader reader)\r
- {\r
- reader.Read ();\r
- object result = reader.Current;\r
- reader.Close ();\r
- return result;\r
- }\r
-\r
- public ObjectReader GetObjectReader (ObjectQuery query, object[] parameters)\r
- {\r
- ObjectExpression oe = OPath.Parse (query, os);\r
- CompiledQuery cq = oe.Compile (map);\r
- return ObjectEngine.GetObjectReader (sources, context, cq, parameters);\r
- }\r
-\r
- public ObjectReader GetObjectReader (Type type, string queryString)\r
- {\r
- return GetObjectReader (new ObjectQuery (type, queryString), null);\r
- }\r
-\r
- public ObjectReader GetObjectReader (Type type, string queryString, string relatedSpan)\r
- {\r
- return GetObjectReader (new ObjectQuery (type, queryString, relatedSpan), null);\r
- }\r
-\r
- public ObjectSet GetObjectSet (ObjectQuery query, object[] parameters)\r
- {\r
- return GetObjectSet (GetObjectReader (query, parameters));\r
- }\r
-\r
- public ObjectSet GetObjectSet (Type type, string queryString)\r
- {\r
- return GetObjectSet (GetObjectReader (type, queryString));\r
- }\r
-\r
- public ObjectSet GetObjectSet (Type type, string queryString, string relatedSpan)\r
- {\r
- return GetObjectSet (GetObjectReader (type, queryString, relatedSpan));\r
- }\r
-\r
- private ObjectSet GetObjectSet (ObjectReader reader)\r
- {\r
- ObjectSet result = new ObjectSet ();\r
- foreach (object o in reader)\r
- result.Add (o);\r
- reader.Close ();\r
- return result;\r
- }\r
-\r
- public void MarkForDeletion (object obj) \r
- {\r
- MarkForDeletion (new object[] {obj});\r
- }\r
-\r
- [MonoTODO]\r
- public void MarkForDeletion (ICollection objs) {}\r
-\r
- public void PersistChanges (object obj) \r
- {\r
- PersistChanges (new object[] {obj}, new PersistenceOptions ());\r
- }\r
-\r
- public void PersistChanges (object obj, PersistenceOptions options) \r
- {\r
- PersistChanges (new object[] {obj}, options);\r
- }\r
-\r
- public void PersistChanges (ICollection objs) \r
- {\r
- PersistChanges (objs, new PersistenceOptions ());\r
- }\r
-\r
- public void PersistChanges (ICollection objs, PersistenceOptions options) \r
- {\r
- ObjectEngine.PersistChanges (map, sources, context, objs, options);\r
- }\r
-\r
- public void Resync (object obj, Depth depth) \r
- {\r
- Resync (new object[] {obj}, depth);\r
- }\r
-\r
- public void Resync (ICollection objs, Depth depth) \r
- {\r
- ObjectEngine.Resync (map, sources, context, objs, depth);\r
- }\r
-\r
- public void StartTracking (object obj, InitialState state) \r
- {\r
- StartTracking (new object[] {obj}, state);\r
- }\r
- \r
- [MonoTODO]\r
- public void StartTracking (ICollection objs, InitialState state) \r
- {\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ObjectState.cs - The modification state of a persitent object\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum ObjectState\r
- {\r
- Unknown,\r
- Unchanged,\r
- Inserted,\r
- Updated,\r
- Deleted\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.OneToManyRelationship.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class OneToManyRelationship : ObjectKeyManager \r
- {\r
-\r
-\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.OneToOneRelationship.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public class OneToOneRelationship : ObjectKeyManager \r
- {\r
- #region Fields\r
-\r
- ObjectKey foreignKey;\r
-\r
- #endregion // Fields\r
-\r
- #region Properties\r
-\r
- public ObjectKey ForeignKey {\r
- get { return foreignKey; }\r
- set { foreignKey = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.PersistenceError\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public class PersistenceError \r
- {\r
- #region Fields\r
-\r
- object errorObject;\r
- PersistenceErrorType errorType;\r
- Exception innerException;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- internal PersistenceError (object errorObject, PersistenceErrorType errorType, Exception innerException)\r
- : base ()\r
- {\r
- this.errorObject = errorObject;\r
- this.errorType = errorType;\r
- this.innerException = innerException;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public object ErrorObject {\r
- get { return errorObject; }\r
- }\r
-\r
- public PersistenceErrorType ErrorType {\r
- get { return errorType; }\r
- }\r
-\r
- public Exception InnerException {\r
- get { return innerException; }\r
- \r
- }\r
- \r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.PersistenceErrorBehavior.cs - The behaviour to follow when a persistence error occurs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum PersistenceErrorBehavior\r
- {\r
- ThrowAtFirstError,\r
- ThrowAfterCompletion\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.PersistenceErrorType.cs - The type of persistence error\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum PersistenceErrorType\r
- {\r
- Inserting,\r
- Deleting,\r
- Updating,\r
- Unknown\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.PersistenceException\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public class PersistenceException : ObjectException\r
- {\r
- #region Fields\r
-\r
- ArrayList errors;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public PersistenceException (SerializationInfo info, StreamingContext context)\r
- : base (info, context)\r
- {\r
- this.errors = new ArrayList ();\r
- }\r
-\r
- [MonoTODO]\r
- public PersistenceException ()\r
- : base ("A PersistenceException has occurred.")\r
- {\r
- this.errors = new ArrayList ();\r
- }\r
-\r
- [MonoTODO]\r
- public PersistenceException (PersistenceError[] errors, string s)\r
- : base (s)\r
- {\r
- this.errors = new ArrayList (errors);\r
- }\r
-\r
- [MonoTODO]\r
- public PersistenceException (PersistenceError[] errors, string s, Exception innerException)\r
- : base (s, innerException)\r
- {\r
- this.errors = new ArrayList (errors);\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public ArrayList Errors {\r
- get { return errors; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion Methods\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.PersistenceOptions.cs \r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003-2004\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces {\r
- public class PersistenceOptions\r
- {\r
- #region Fields\r
-\r
- Depth depth;\r
- PersistenceErrorBehavior errorBehavior;\r
- static readonly PersistenceOptions DefaultPersistenceOptions = new PersistenceOptions ();\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public PersistenceOptions (Depth depth, PersistenceErrorBehavior errorBehavior)\r
- {\r
- this.depth = depth;\r
- this.errorBehavior = errorBehavior;\r
- }\r
-\r
- public PersistenceOptions (PersistenceErrorBehavior errorBehavior)\r
- : this (Depth.ObjectGraph, errorBehavior)\r
- {\r
- }\r
-\r
- public PersistenceOptions (Depth depth)\r
- : this (depth, PersistenceErrorBehavior.ThrowAtFirstError)\r
- {\r
- }\r
-\r
- public PersistenceOptions ()\r
- : this (Depth.ObjectGraph, PersistenceErrorBehavior.ThrowAtFirstError)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public static PersistenceOptions Default {\r
- get { return DefaultPersistenceOptions; }\r
- }\r
-\r
- public Depth Depth {\r
- get { return depth; }\r
- }\r
- \r
- public PersistenceErrorBehavior ErrorBehavior {\r
- get { return errorBehavior; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.UpdateErrorType.cs - The type of an update error\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public enum UpdateErrorType\r
- {\r
- Inserting,\r
- Deleting,\r
- Updating,\r
- Unknown\r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ValueRecord.cs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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.
-//
-#if NET_2_0\r
-\r
-using System.Collections;\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- [MonoTODO]\r
- public class ValueRecord : IEnumerable\r
- {\r
-\r
- [MonoTODO]\r
- public Type ObjectType { \r
- get { return null; }\r
- }\r
- \r
- [MonoTODO]\r
- public object this[string propertyName] { \r
- get { return null; } \r
- set {}\r
- } \r
- \r
- [MonoTODO]\r
- public IEnumerator GetEnumerator () \r
- {\r
- throw new NotImplementedException ();\r
- }\r
- \r
- [MonoTODO]\r
- public override int GetHashCode () \r
- {\r
- return 0; \r
- }\r
- \r
- [MonoTODO]\r
- public override bool Equals (object value) \r
- {\r
- return false; \r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ValueRecordMergeEventArgs.cs : The argument passed when a ValueRecord's merge event occurs\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public class ValueRecordMergeEventArgs\r
- {\r
- private ValueRecord currentRecord; //The current value record\r
- private ValueRecord originalRecord; //The original value record\r
- private ValueRecord persistentRecord; //The persistent value record\r
- \r
- \r
- //Simple constructors are ideal to code on Monday afternoons\r
- public ValueRecordMergeEventArgs (ValueRecord currentRecord,\r
- ValueRecord originalRecord, ValueRecord persistentRecord)\r
- {\r
- this.currentRecord = currentRecord; \r
- this.originalRecord = originalRecord;\r
- this.persistentRecord = persistentRecord;\r
- }\r
-\r
-\r
- //Properties\r
- public ValueRecord CurrentValueRecord { \r
- get{ return currentRecord; }\r
- } \r
-\r
- public ValueRecord OriginalValueRecord { \r
- get{ return originalRecord; }\r
- } \r
-\r
- public ValueRecord PersistentValueRecord { \r
- get{ return persistentRecord; }\r
- } \r
- }\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.ValueRecordMergeEventHandler.cs : The delegate for handling ValueRecord's merge events\r
-//\r
-// Author:\r
-// Mark Easton (mark.easton@blinksoftware.co.uk)\r
-//\r
-// (C) BLiNK Software Ltd. http://www.blinksoftware.co.uk\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
-#if NET_2_0\r
-\r
-namespace System.Data.ObjectSpaces\r
-{\r
- public delegate void ValueRecordMergeEventHandler (object sender, ValueRecordMergeEventArgs e);\r
-}\r
-\r
-#endif
\ No newline at end of file
+++ /dev/null
-System.Data.ObjectSpaces/CommonObjectContextTests.cs
-System.Data.ObjectSpaces.Query/ObjectExpressionTests.cs
+++ /dev/null
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- internal class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
+++ /dev/null
-2003-11-27 Tim Coleman <tim@timcoleman.com>
- * System.Data.ObjectSpaces.Query/ObjectExpressionTests.cs:
- * SupportFiles/osd.xml:
- * SupportFiles/rsd.xml:
- New classes added for test
-
-2003-11-26 Tim Coleman <tim@timcoleman.com>
- * ChangeLog run_test.sh
- * System.Data.ObjectSpaces/CommonObjectContextTests.cs:
- New classes added for test
+++ /dev/null
-<osd:ExtendedObjectSchema Name="DataTypesOSD" xmlns:osd="http://schemas.microsoft.com/data/2002/09/20/persistenceschema">
- <osd:Classes>
- <osd:Class Name="Customer">
- <osd:Member Name="Id" Key="true" />
- <osd:Member Name="Company" />
- <osd:Member Name="Name" />
- <osd:Member Name="Phone" />
- </osd:Class>
- </osd:Classes>
-</osd:ExtendedObjectSchema>
-
+++ /dev/null
-<rsd:Database Name="Northwind" Owner="sa" xmlns:rsd="http://schemas.microsoft.com/data/2002/09/28/rsd">
- <r:Schema Name="dbo" xmlns:r="http://schemas.microsoft.com/data/2002/09/28/rsd">
- <rsd:Tables>
- <rsd:Table Name="Customers">
- <rsd:Columns>
- <rsd:Column Name="CustomerID" SqlType="nchar" Precision="5" />
- <rsd:Column Name="CompanyName" SqlType="nvarchar" Precision="40" />
- <rsd:Column AllowDbNull="true" Name="ContactName" SqlType="nvarchar" Precision="30" />
- <rsd:Column AllowDbNull="true" Name="Phone" SqlType="nvarchar" Precision="24" />
- </rsd:Columns>
- <rsd:Constraints>
- <rsd:PrimaryKey Name="PK_Customers">
- <rsd:ColumnRef Name="CustomerID" />
- </rsd:PrimaryKey>
- </rsd:Constraints>
- </rsd:Table>
- </rsd:Tables>
- </r:Schema>
-</rsd:Database>
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.Query.ObjectExpressionTests.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\r
-//\r
-\r
-#if NET_2_0\r
-\r
-using System;\r
-using System.Data.ObjectSpaces;\r
-using System.Data.ObjectSpaces.Query;\r
-using System.Data.ObjectSpaces.Schema;\r
-using NUnit.Framework;\r
-\r
-namespace MonoTests.System.Data.ObjectSpaces.Query\r
-{\r
- [TestFixture]\r
- public class ObjectExpressionTests : Assertion\r
- {\r
- ObjectExpression objectExpression;\r
- Expression expression;\r
- ObjectSchema objectSchema;\r
-\r
- [SetUp]\r
- public void GetReady ()\r
- {\r
- expression = new Parameter (1);\r
- objectSchema = new ObjectSchema ();\r
- objectExpression = new ObjectExpression (expression, objectSchema);\r
- }\r
-\r
- [Test]\r
- public void Expression\r
- {\r
- AssertEquals ("#A01", expression, ObjectExpression.Expression);\r
- }\r
-\r
- [Test]\r
- public void Expression ()\r
- {\r
- AssertEquals ("#A01", objectSchema, ObjectExpression.ObjectSchema);\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-//\r
-// System.Data.ObjectSpaces.CommonObjectContextTests.cs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\r
-//\r
-\r
-#if NET_2_0\r
-\r
-using System;\r
-using System.Data.ObjectSpaces;\r
-using System.Data.ObjectSpaces.Schema;\r
-using NUnit.Framework;\r
-\r
-namespace MonoTests.System.Data.ObjectSpaces\r
-{\r
- [TestFixture]\r
- public class CommonObjectContextTests : Assertion\r
- {\r
- CommonObjectContext context;\r
-\r
- [SetUp]\r
- public void GetReady ()\r
- {\r
- ObjectSchema schema = new ObjectSchema ();\r
- context = new CommonObjectContext (schema);\r
- }\r
-\r
- [Test]\r
- public void Add1 ()\r
- {\r
- try {\r
- context.Add (null);\r
- Fail ("Expected a ContextException to be thrown.");\r
- } catch (ContextException) {}\r
-\r
- try {\r
- context.Add ("add1");\r
- Fail ("Expected a NullReferenceException to be thrown.");\r
- } catch (NullReferenceException) {}\r
- }\r
-\r
- [Test]\r
- public void Add2 ()\r
- {\r
- try {\r
- context.Add (null, ObjectState.Unknown);\r
- Fail ("Expected a ContextException to be thrown.");\r
- } catch (ContextException) {}\r
-\r
- try {\r
- context.Add ("add2", (ObjectState) (-1));\r
- Fail ("Expected a NullReferenceException to be thrown.");\r
- } catch (NullReferenceException) {}\r
-\r
- try {\r
- context.Add ("add2", ObjectState.Unknown);\r
- Fail ("Expected a ContextException to be thrown.");\r
- } catch (ContextException) {}\r
-\r
- context.Add ("add2", ObjectState.Inserted);\r
- }\r
-\r
- [Test]\r
- public void Delete ()\r
- {\r
- try {\r
- context.Delete (null);\r
- Fail ("Expected an ArgumentNullException to be thrown.");\r
- } catch (ArgumentNullException) {}\r
- }\r
- }\r
-}\r
-\r
-#endif\r
+++ /dev/null
-#!/bin/sh
-
-if [ $# -eq 0 ]; then
- echo "You should give a list of test names such as: "
- echo "$0 System.IO.FileTest System.Text.StringBuilderTest"
- echo "or"
- echo "$0 System.AllTests"
- echo "or"
- echo "$0 all"
- echo "and so on..."
- exit 1
-fi
-
-topdir=../../..
-NUNITCONSOLE=$topdir/class/lib/nunit-console.exe
-MONO_PATH=$topdir/nunit20:$topdir/class/lib:.
-
-for i in $@; do
- if [ "$i" = "all" ]; then
- fixture=""
- else
- fixture="/fixture:MonoTests.${i}"
- fi
- MONO_PATH=$MONO_PATH \
- mono --debug ${NUNITCONSOLE} System.Data.ObjectSpaces_test.dll $fixture
-done
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2003 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-/* TODO COMPLETE INFORMATION
-
-#if (NET_1_0)
- [assembly: AssemblyVersion ("1.0.3300.0")]
-#endif
-#if (NET_1_1)
- [assembly: AssemblyVersion ("1.0.5000.0")]
-#endif
-
-[assembly: AssemblyTitle ("")]
-[assembly: AssemblyDescription ("")]
-
-[assembly: CLSCompliant (true)]
-[assembly: AssemblyFileVersion ("0.0.0.1")]
-
-[assembly: ComVisible (false)]
-
-*/
-#if (NET_2_0)
- [assembly: AssemblyVersion ("2.0.3600.0")]
-#endif
-
-[assembly: AssemblyDelaySign (true)]
-[assembly: AssemblyKeyFile("../ecma.pub")]
-
+++ /dev/null
-2004-08-20 Atsushi Enomoto <atsushi@ximian.com>
-
- * AssemblyInfo.cs : updated version to match with ms.net.
-
-2004-04-28 Sebastien Pouliot <sebastien@ximian.com>
-
- * AssemblyInfo.cs: Added
- * ChangeLog: Added
- * Locale.cs: Added
- * TODOAttribute.cs: Added
\ No newline at end of file
+++ /dev/null
-//
-// Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2001 - 2003 Ximian, Inc (http://www.ximian.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-internal sealed class Locale {
-
- private Locale ()
- {
- }
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
-}
+++ /dev/null
-2004-07-23 Atsushi Enomoto <atsushi@ximian.com>
-
- * System.Data.SqlXml.dll.sources : Removed UpdateEventArgs.cs,
- XmlAdapter.cs, XmlUpdateEventArgs.cs, SqlQueryOptions.cs,
- SqlQueryPlan.cs, XmlMapping.cs and XmlMappingDictionary.cs.
-
-2004-05-22 Atsushi Enomoto <atsushi@ximian.com>
-
- * System.Data.SqlXml.dll.sources : updated .net 2.0 classes.
-
-2004-04-28 Sebastien Pouliot <sebastien@ximian.com>
-
- * System.Data.SqlXml.dll.sources: Added Assembly/AssemblyInfo.cs
- and Locale.cs to the build.
-
-2003-12-29 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlXml.dll.sources:
- Remove XmlDataSourceResolver as it is broken.
- * System.Data.Mapping/DataSource.cs:
- Fix property name
- * System.Xml.Query/XmlViewSchemaDictionary.cs:
- Remove "private" from some properties
-
-2003-12-15 Atsushi Enomoto <atsushi@ximian.com>
-
- * System.Data.SqlXml.dll.sources: Added System.Xml classes.
- * Makefile : added reference to System.dll
-
-2003-12-14 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlXml.dll.sources:
- Remove some files from System.Xml.Query that
- were in the wrong assembly.
-
-2003-11-25 Tim Coleman <tim@timcoleman.com>
- * Makefile:
- * System.Data.Mapping/*.cs:
- * System.Data.SqlXml/*.cs:
- * System.Data.SqlXml.dll.sources:
- * System.Xml.Query/*.cs:
- * TODOAttribute.cs:
- Create initial stubs for System.Data.SqlXml
+++ /dev/null
-thisdir = class/System.Data.SqlXml
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = System.Data.SqlXml.dll
-LIB_MCS_FLAGS = /r:$(corlib),System.dll,System.Data.dll,System.Xml.dll
-NO_TEST = yes
-
-EXTRA_DISTFILES =
-
-include ../../build/library.make
+++ /dev/null
-//\r
-// System.Data.Mapping.Condition\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class Condition\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Field LeftField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingConditionOperator Operator { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Variable OwnerVariable { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string RightConstant { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Field RightField { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingArgumentType RightOperandType { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingParameter RightParameter { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.ConditionCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class ConditionCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Condition this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (Condition dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (Condition[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.DataSource\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class DataSource \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public MappingDirection Direction { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Name { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema OwnerMappingSchema { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public RelationshipCollection Relationships { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainSchema Schema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string SourceUri {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingDataSourceType Type {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public VariableCollection Variables {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public bool WriteInline {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.DataSourceCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Collections;\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class DataSourceCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public DataSource this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- [MonoTODO]\r
- public DataSource this [string name] {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (DataSource dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (DataSource[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.Field\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class Field \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public IDomainField DomainField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Name { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Variable OwnerVariable { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.FieldCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class FieldCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Field this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (Field dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (Field[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.FieldJoin\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class FieldJoin\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Field FromField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string FromFieldName { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Relationship OwnerRelationship { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Field ToField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string ToFieldName { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.FieldJoinCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class FieldJoinCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public FieldJoin this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (FieldJoin dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (FieldJoin[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.FieldMap\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class FieldMap \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public string NullValue {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Map OwnerMap {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string SourceConstant {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Field SourceField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingParameter SourceParameter {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingArgumentType SourceType {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string TargetConstant {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainField TargetDomainField {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingParameter TargetParameter {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingArgumentType TargetType {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public bool UseForConcurrency {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingAccess UseNull {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.FieldMapCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class FieldMapCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public FieldMap this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (FieldMap dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (FieldMap[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainConstraint\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public interface IDomainConstraint\r
- {\r
- #region Properties\r
-\r
- bool CascadeDelete { get; }\r
- IDomainSchema DomainSchema { get; }\r
- IDomainFieldJoinCollection FieldJoins { get; }\r
- IDomainStructure FromDomainStructure { get; }\r
- string Name { get; }\r
- IDomainStructure ToDomainStructure { get; }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainField\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public interface IDomainField\r
- {\r
- #region Properties\r
-\r
- IDomainStructure DomainStructure { get; }\r
- string Name { get; }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainFieldJoin\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public interface IDomainFieldJoin\r
- {\r
- #region Properties\r
-\r
- IDomainField FromDomainField { get; } \r
- IDomainField ToDomainField { get; } \r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainFieldJoinCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping { \r
- public interface IDomainFieldJoinCollection\r
- {\r
- #region Properties\r
-\r
- IDomainFieldJoin this [int index] { get; }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- bool Contains (IDomainFieldJoin fieldJoin);\r
- void CopyTo (IDomainFieldJoin[] fieldJoins, int index);\r
- int IndexOf (IDomainFieldJoin fieldJoin);\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainSchema\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.IO;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-\r
-namespace System.Data.Mapping {\r
- public interface IDomainSchema\r
- {\r
- #region Properties\r
-\r
- MappingDataSourceType DomainType { get; }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- IDomainConstraint GetDomainConstraint (string name, IXmlNamespaceResolver namespaces);\r
- IDomainStructure GetDomainStructure (string select, IXmlNamespaceResolver namespaces);\r
- void Read (string url, ValidationEventHandler validationEventHandler);\r
- void Read (string url);\r
- void Read (XmlReader reader, ValidationEventHandler validationEventHandler);\r
- void Read (XmlReader reader);\r
- void ReadExtensions (XmlReader reader, ValidationEventHandler validationEventHandler);\r
- void ReadExtensions (XmlReader reader);\r
- void Write (string url, IXmlNamespaceResolver namespaceResolver);\r
- void Write (string url);\r
- void Write (XmlWriter writer, IXmlNamespaceResolver namespaceResolver);\r
- void Write (XmlWriter writer);\r
- void Write (Stream stream, IXmlNamespaceResolver namespaceResolver);\r
- void Write (Stream stream);\r
- void Write (TextWriter writer, IXmlNamespaceResolver namespaceResolver);\r
- void Write (TextWriter writer);\r
- void WriteExtensions (XmlWriter writer, IXmlNamespaceResolver namespaceResolver);\r
- void WriteExtensions (XmlWriter writer);\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.IDomainStructure\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Xml;\r
-\r
-namespace System.Data.Mapping {\r
- public interface IDomainStructure\r
- {\r
- #region Properties\r
-\r
- IDomainSchema DomainSchema { get; }\r
- string Select { get; }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- IDomainField GetDomainField (string fieldName, IXmlNamespaceResolver namespaces);\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.Map\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class Map \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public MappingAccess Access { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Field ContentsMap { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public FieldMapCollection FieldMaps { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Field OverflowMap {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema OwnerMappingSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Variable SourceVariable {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string TargetSelect {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainStructure TargetStructure {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MapCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class MapCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Map this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (Map dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (Map[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingAccess\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public enum MappingAccess \r
- {\r
- Read,\r
- ReadWrite,\r
- Write\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingArgumentType\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public enum MappingArgumentType \r
- {\r
- NotRequired,\r
- Field,\r
- DomainField,\r
- Constant,\r
- MappingParameter\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingConditionOperator\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public enum MappingConditionOperator \r
- {\r
- LessThen,\r
- GreaterThen,\r
- LessThenOrEqual,\r
- GreaterThenOrEqual,\r
- Equal,\r
- NotEqual,\r
- Like,\r
- NotLike,\r
- IsNull,\r
- IsNotNull\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingDataSourceType\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public enum MappingDataSourceType \r
- {\r
- SQLServer,\r
- Xml,\r
- Object\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingDirection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.Mapping {\r
- public enum MappingDirection \r
- {\r
- Source,\r
- Target\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingParameter\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Xml.Schema;\r
-\r
-namespace System.Data.Mapping {\r
- public class MappingParameter \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public XmlSchemaBuiltInType DataType {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Default { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Name { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string NullValue { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema OwnerMappingSchema { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingParameterCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class MappingParameterCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public MappingParameter this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (MappingParameter dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (MappingParameter[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.MappingSchema\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.IO;\r
-using System.Xml;\r
-using System.Xml.Schema;\r
-\r
-namespace System.Data.Mapping {\r
- public class MappingSchema\r
- {\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public MappingSchema ()\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema (string url, ValidationEventHandler validationEventHandler)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema (string url)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema (XmlReader reader, ValidationEventHandler validationEventHandler)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public MappingSchema (XmlReader reader)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public DataSourceCollection DataSources {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MappingParameterCollection MappingParameters {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public MapCollection Maps {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public RelationshipMapCollection RelationshipMaps {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string SourceUri {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public Relationship Find (string fromVariableName, string toVariableName)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public RelationshipCollection Find (string variableName)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public string GetXml ()\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (string url, ValidationEventHandler validationEventHandler) \r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (string url) \r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (XmlReader reader, ValidationEventHandler validationEventHandler)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Read (XmlReader reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (string url, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (string url)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (XmlWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (XmlWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (Stream stream, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (Stream stream)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (TextWriter writer, IXmlNamespaceResolver namespaceResolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Write (TextWriter writer)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.Relationship\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class Relationship \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public bool CascadeDelete {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string ConstraintName { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainConstraint DomainConstraint { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public FieldJoinCollection FieldJoins { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Variable FromVariable { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Name { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public RelationshipCollection NestedRelationships { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public DataSource OwnerDataSource { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Variable ToVariable { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.RelationshipCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class RelationshipCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Relationship this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (Relationship dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (Relationship[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.RelationshipMap\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class RelationshipMap\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public MappingSchema OwnerMappingSchema {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public Relationship SourceRelationship {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainConstraint TargetConstraint { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string TargetConstraintName { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.RelationshipMapCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class RelationshipMapCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public RelationshipMap this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (RelationshipMap dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (RelationshipMap[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.Variable\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Data.Mapping {\r
- public class Variable \r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public ConditionCollection Conditions {\r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public IDomainStructure DomainStructure { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public FieldCollection Fields { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Name { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public DataSource OwnerDataSource { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- [MonoTODO]\r
- public string Select { \r
- get { throw new NotImplementedException (); }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.Mapping.VariableCollection\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-using System.Collections;\r
-\r
-namespace System.Data.Mapping {\r
- public class VariableCollection : ReadOnlyCollectionBase\r
- {\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public Variable this [int index] {\r
- get { throw new NotImplementedException (); }\r
- }\r
- \r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public bool Contains (Variable dataSource)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void CopyTo (Variable[] array, int index)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-TODOAttribute.cs
-Assembly/AssemblyInfo.cs
-Assembly/Locale.cs
-System.Data.SqlXml/DBObject.cs
-System.Data.SqlXml/DBObjectException.cs
-System.Data.SqlXml/RowFilledEventArgs.cs
-System.Data.SqlXml/RowFillingEventArgs.cs
-System.Data.SqlXml/XmlBulkLoad.cs
-System.Data.SqlXml/XmlBulkLoadException.cs
-System.Data.SqlXml/XmlRowsetAdapter.cs
-System.Data.SqlXml/XmlRowsetAdapterException.cs
-System.Data.SqlXml/FillStatus.cs
-System.Xml.Query/XQueryCommand.cs
-System.Data.Mapping/ConditionCollection.cs
-System.Data.Mapping/Condition.cs
-System.Data.Mapping/DataSourceCollection.cs
-System.Data.Mapping/DataSource.cs
-System.Data.Mapping/FieldCollection.cs
-System.Data.Mapping/Field.cs
-System.Data.Mapping/FieldJoinCollection.cs
-System.Data.Mapping/FieldJoin.cs
-System.Data.Mapping/FieldMapCollection.cs
-System.Data.Mapping/FieldMap.cs
-System.Data.Mapping/IDomainConstraint.cs
-System.Data.Mapping/IDomainField.cs
-System.Data.Mapping/IDomainFieldJoinCollection.cs
-System.Data.Mapping/IDomainFieldJoin.cs
-System.Data.Mapping/IDomainSchema.cs
-System.Data.Mapping/IDomainStructure.cs
-System.Data.Mapping/MapCollection.cs
-System.Data.Mapping/Map.cs
-System.Data.Mapping/MappingAccess.cs
-System.Data.Mapping/MappingArgumentType.cs
-System.Data.Mapping/MappingConditionOperator.cs
-System.Data.Mapping/MappingDataSourceType.cs
-System.Data.Mapping/MappingDirection.cs
-System.Data.Mapping/MappingParameterCollection.cs
-System.Data.Mapping/MappingParameter.cs
-System.Data.Mapping/MappingSchema.cs
-System.Data.Mapping/RelationshipCollection.cs
-System.Data.Mapping/Relationship.cs
-System.Data.Mapping/RelationshipMapCollection.cs
-System.Data.Mapping/RelationshipMap.cs
-System.Data.Mapping/VariableCollection.cs
-System.Data.Mapping/Variable.cs
+++ /dev/null
-2004-07-23 Atsushi Enomoto <atsushi@novell.com>
-
- * started ChangeLog.
- * DBObject.cs : XmlQueryArgumentList is now XmlArgumentList.
-
+++ /dev/null
-//\r
-// System.Data.SqlXml.DBObject\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data;\r
-using System.IO;\r
-using System.Xml.Query;\r
-\r
-namespace System.Data.SqlXml {\r
- public class DBObject\r
- {\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public DBObject ()\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- [MonoTODO]\r
- public string Path {\r
- get { throw new NotImplementedException(); }\r
- set { throw new NotImplementedException(); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public void Retrieve (Stream stream, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Retrieve (Stream stream, XmlArgumentList argumentList, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public IDataReader Retrieve (IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public IDataReader Retrieve (XmlArgumentList argumentList, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Update (Stream insertStream, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Update (Stream insertStream, XmlArgumentList argumentList, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Update (byte[] inputBytes, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Update (byte[] inputBytes, XmlArgumentList argumentList, IDbConnection connection)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.DBObjectException\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.SqlXml {\r
- public class DBObjectException : Exception\r
- {\r
- #region Constructors\r
-\r
- public DBObjectException (SerializationInfo info, StreamingContext context)\r
- : base (info, context)\r
- {\r
- }\r
-\r
- public DBObjectException ()\r
- : base ("A Database Object Exception has occurred.")\r
- {\r
- }\r
-\r
- public DBObjectException (string res)\r
- : base (res)\r
- {\r
- }\r
-\r
- public DBObjectException (string resource, Exception exception)\r
- : base (resource, exception)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public override string Message {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.FillStatus\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Data.SqlXml {\r
- public enum FillStatus\r
- {\r
- Continue,\r
- ErrorsOccurred,\r
- SkipCurrentRow\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.RowFilledEventArgs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-\r
-namespace System.Data.SqlXml {\r
- public class RowFilledEventArgs : EventArgs\r
- {\r
- #region Fields\r
-\r
- Exception errors;\r
- DataRow row;\r
- FillStatus status;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public RowFilledEventArgs (DataRow row)\r
- {\r
- this.row = row;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public Exception Errors {\r
- get { return errors; }\r
- set { errors = value; }\r
- }\r
-\r
- public DataRow Row {\r
- get { return row; }\r
- }\r
-\r
- public FillStatus Status {\r
- get { return status; }\r
- set { status = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.RowFillingEventArgs\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-\r
-namespace System.Data.SqlXml {\r
- public class RowFillingEventArgs : EventArgs\r
- {\r
- #region Fields\r
-\r
- Exception errors;\r
- DataRow row;\r
- FillStatus status;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public RowFillingEventArgs (DataRow row)\r
- {\r
- this.row = row;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public Exception Errors {\r
- get { return errors; }\r
- set { errors = value; }\r
- }\r
-\r
- public DataRow Row {\r
- get { return row; }\r
- }\r
-\r
- public FillStatus Status {\r
- get { return status; }\r
- set { status = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.XmlBulkLoad\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data;\r
-using System.Data.Mapping;\r
-\r
-namespace System.Data.SqlXml {\r
- public class XmlBulkLoad\r
- {\r
- #region Fields\r
-\r
- bool checkConstraints;\r
- int clientBufferSize;\r
- string errorLogFile;\r
- bool forceTableLock;\r
- bool keepIdentity;\r
- bool keepNulls;\r
- MappingSchema mapping;\r
- int serverTransactionSize;\r
-\r
- #endregion // Fields\r
- \r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public XmlBulkLoad ()\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public bool CheckConstraints {\r
- get { return checkConstraints; }\r
- set { checkConstraints = value; }\r
- }\r
-\r
- public int ClientBufferSize {\r
- get { return clientBufferSize; }\r
- }\r
-\r
- public string ErrorLogFile {\r
- get { return errorLogFile; }\r
- set { errorLogFile = value; }\r
- }\r
-\r
- public bool ForceTableLock {\r
- get { return forceTableLock; }\r
- set { forceTableLock = value; }\r
- }\r
-\r
- public bool KeepIdentity {\r
- get { return keepIdentity; }\r
- set { keepIdentity = value; }\r
- }\r
-\r
- public bool KeepNulls {\r
- get { return keepNulls; }\r
- set { keepNulls = value; }\r
- }\r
-\r
- public MappingSchema Mapping {\r
- get { return mapping; }\r
- set { mapping = value; }\r
- }\r
-\r
- public int ServerTransactionSize {\r
- get { return serverTransactionSize; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public void Execute (string xmlFileName, IDbConnection connection)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- [MonoTODO]\r
- public void SetBufferingSizes (int clientBufferSize, int serverTransactionSize)\r
- {\r
- this.clientBufferSize = clientBufferSize;\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.XmlBulkLoadException\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.SqlXml {\r
- public class XmlBulkLoadException : Exception\r
- {\r
- #region Constructors\r
-\r
- public XmlBulkLoadException (SerializationInfo info, StreamingContext context)\r
- : base (info, context)\r
- {\r
- }\r
-\r
- public XmlBulkLoadException ()\r
- : base ("An XML Bulk Load Exception has occurred.")\r
- {\r
- }\r
-\r
- public XmlBulkLoadException (string res)\r
- : base (res)\r
- {\r
- }\r
-\r
- public XmlBulkLoadException (string resource, Exception exception)\r
- : base (resource, exception)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public override string Message {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.XmlRowsetAdapter\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.Mapping;\r
-using System.Xml;\r
-\r
-namespace System.Data.SqlXml {\r
- public class XmlRowsetAdapter\r
- {\r
- #region Fields\r
-\r
- MappingSchema mapping;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public XmlRowsetAdapter ()\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public MappingSchema Mapping {\r
- get { return mapping; }\r
- set { mapping = value; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public void Fill (DataSet dataSet, string filename)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Fill (DataSet dataSet, string filename, XmlResolver resolver)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void Fill (DataSet dataSet, XmlReader reader)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public void FillSchema (DataSet dataSet)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public virtual void OnRowFilled (RowFilledEventArgs e)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- [MonoTODO]\r
- public virtual void OnRowFilling (RowFillingEventArgs e)\r
- {\r
- throw new NotImplementedException ();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Data.SqlXml.XmlRowsetAdapterException\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System;\r
-using System.Runtime.Serialization;\r
-\r
-namespace System.Data.SqlXml {\r
- public class XmlRowsetAdapterException : Exception\r
- {\r
- #region Constructors\r
-\r
- public XmlRowsetAdapterException (SerializationInfo info, StreamingContext context)\r
- : base (info, context)\r
- {\r
- }\r
-\r
- public XmlRowsetAdapterException ()\r
- : base ("An XML Rowset Adapter Exception has occurred.")\r
- {\r
- }\r
-\r
- public XmlRowsetAdapterException (string res)\r
- : base (res)\r
- {\r
- }\r
-\r
- public XmlRowsetAdapterException (string resource, Exception exception)\r
- : base (resource, exception)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
- \r
- [MonoTODO]\r
- public override string Message {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- [MonoTODO]\r
- public override void GetObjectData (SerializationInfo info, StreamingContext context)\r
- {\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-2004-09-08 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : Use XmlWriter.Create() instead of XmlTextWriter.
- It affects on XML declaration output.
-
-2004-09-01 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : Forgot to commit. sys.xml internal class now
- requires this instance for message delegating (not complete though).
-
-2004-08-25 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : Reverted. "context item is nothing" should be
- differentiate from "context item is document".
-
-2004-08-20 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : use new XPathDocument() for empty contextdocument.
-
-2004-08-20 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : Now it delegates all implementation logic to
- Mono.Xml.XQuery.XQueryCommandImpl class (now Execute() is also
- invoked.)
-
-2004-07-23 Atsushi Enomoto <atsushi@ximian.com>
-
- * XQueryCommand.cs : Implemented a bit (added nonexposed xquery
- parser call).
-
-2004-05-22 Atsushi Enomoto <atsushi@ximian.com>
-
- * Added ChangeLog.
- * XQueryProcessor.cs,
- XmlViewSchema.cs,
- XmlViewSchemaDictionary.cs : removed old classes.
- * XQueryCommand.cs,
- XmlMapping.cs,
- XmlMappingDictionary.cs : added new clases.
+++ /dev/null
-//\r
-// System.Xml.Query.SqlQueryOptions\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-using System.Data.SqlXml;\r
-\r
-namespace System.Xml.Query {\r
- public class SqlQueryOptions\r
- {\r
- #region Fields\r
-\r
- SqlQueryPlan sqlQueryPlan;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- [MonoTODO]\r
- public SqlQueryOptions ()\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public SqlQueryPlan SqlQueryPlan {\r
- get { return sqlQueryPlan; }\r
- set { sqlQueryPlan = value; }\r
- }\r
-\r
- #endregion // Properties\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Xml.Query.SqlQueryPlan\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\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
-#if NET_2_0\r
-\r
-namespace System.Xml.Query {\r
- public enum SqlQueryPlan\r
- {\r
- Serialized,\r
- Mars,\r
- UnionAll\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//\r
-// System.Xml.Query.XQueryCommand\r
-//\r
-// Author:\r
-// Tim Coleman (tim@timcoleman.com)\r
-// Atsushi Enomoto (atsushi@ximian.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2003\r
-// Copyright (C) Novell Inc., 2004\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
-#if NET_2_0\r
-\r
-using System.Data;\r
-using System.Data.SqlXml;\r
-using System.IO;\r
-using System.Reflection;\r
-using System.Security.Policy;\r
-using System.Xml;\r
-using System.Xml.XPath;\r
-\r
-namespace System.Xml.Query \r
-{\r
- public class XQueryCommand\r
- {\r
- // They are obtained via reflection\r
- static Type implType;\r
- static MethodInfo compileMethod;\r
- static MethodInfo executeMethod;\r
-\r
- static XQueryCommand ()\r
- {\r
- implType = typeof (XPathNavigator).Assembly.GetType ("Mono.Xml.XPath2.XQueryCommandImpl");\r
- compileMethod = implType.GetMethod ("Compile");\r
- executeMethod = implType.GetMethod ("Execute");\r
- if (compileMethod == null)\r
- throw new InvalidOperationException ("Should not happen: XQueryCommandImpl.Compile() was not found.");\r
- if (executeMethod == null)\r
- throw new InvalidOperationException ("Should not happen: XQueryCommandImpl.Execute() was not found.");\r
- }\r
-\r
- #region Constructor\r
-\r
- [MonoTODO]\r
- public XQueryCommand ()\r
- {\r
- impl = Activator.CreateInstance (implType);\r
- }\r
-\r
- #endregion // Constructor\r
-\r
- object impl;\r
-\r
- #region Event\r
-\r
- public event QueryEventHandler OnMessageEvent;\r
-\r
- #endregion\r
-\r
- #region Methods\r
-\r
- // Compile\r
-\r
- [MonoTODO ("Null Evidence allowed?")]\r
- public void Compile (string query)\r
- {\r
- Compile (query, null);\r
- }\r
-\r
- public void Compile (string query, Evidence evidence)\r
- {\r
- Compile (new StringReader (query), evidence);\r
- }\r
-\r
- [MonoTODO ("Null Evidence allowed?")]\r
- public void Compile (TextReader query)\r
- {\r
- Compile (query, null);\r
- }\r
-\r
- [MonoTODO]\r
- public void Compile (TextReader query, Evidence evidence)\r
- {\r
- compileMethod.Invoke (impl, new object [] {query, evidence, this});\r
- }\r
-\r
- // Execute\r
-\r
- [MonoTODO ("Null args allowed?")]\r
- public void Execute (\r
- IXPathNavigable contextDocument,\r
- XmlWriter results)\r
- {\r
- Execute (contextDocument, null, null, results);\r
- }\r
-\r
- [MonoTODO ("Output StartDocument?")]\r
- public void Execute (\r
- XmlResolver dataSources, \r
- TextWriter results)\r
- {\r
- XmlWriter w = XmlWriter.Create (results);\r
- Execute (dataSources, null, w);\r
- }\r
-\r
- [MonoTODO ("Null args allowed?")]\r
- public void Execute (\r
- XmlResolver dataSources, \r
- XmlWriter results)\r
- {\r
- Execute (new XPathDocument (), dataSources, null, results);\r
- }\r
-\r
- [MonoTODO ("Null args allowed?")]\r
- public void Execute (\r
- IXPathNavigable contextDocument,\r
- XmlArgumentList args,\r
- XmlWriter results)\r
- {\r
- Execute (contextDocument, null, args, results);\r
- }\r
-\r
- [MonoTODO ("Null args allowed?")]\r
- public void Execute (\r
- IXPathNavigable contextDocument,\r
- XmlResolver resolver,\r
- XmlWriter results)\r
- {\r
- Execute (contextDocument, resolver, null, results);\r
- }\r
-\r
- [MonoTODO("Indentation?;write StartDocument?;Null args allowed?")]\r
- public void Execute (\r
- string contextDocumentUri,\r
- XmlResolver dataSources,\r
- Stream results)\r
- {\r
- Execute (contextDocumentUri, dataSources, null, results);\r
- }\r
-\r
- [MonoTODO("Indentation?;write StartDocument?;Null args allowed?")]\r
- public void Execute (\r
- string contextDocumentUri, \r
- XmlResolver dataSources, \r
- TextWriter results)\r
- {\r
- Execute (contextDocumentUri, dataSources, null, results);\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- string contextDocumentUri, \r
- XmlResolver dataSources, \r
- XmlWriter results)\r
- {\r
- Execute (new XPathDocument (XmlReader.Create (contextDocumentUri)), dataSources, results);\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- XmlResolver dataSources, \r
- XmlArgumentList args,\r
- XmlWriter results)\r
- {\r
- Execute ((XPathNavigator) null, dataSources, args, results);\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- IXPathNavigable contextDocument, \r
- XmlResolver dataSources,\r
- XmlArgumentList args,\r
- XmlWriter results)\r
- {\r
- Execute (contextDocument != null ? contextDocument.CreateNavigator () : null, dataSources, args, results);\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- string contextDocumentUri, \r
- XmlResolver dataSources,\r
- XmlArgumentList args,\r
- Stream results)\r
- {\r
- Execute (new XPathDocument (XmlReader.Create (contextDocumentUri)), dataSources, args, XmlWriter.Create (results));\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- string contextDocumentUri, \r
- XmlResolver dataSources,\r
- XmlArgumentList args,\r
- TextWriter results)\r
- {\r
- Execute (new XPathDocument (XmlReader.Create (contextDocumentUri)), dataSources, args, XmlWriter.Create (results));\r
- }\r
-\r
- [MonoTODO]\r
- public void Execute (\r
- string contextDocumentUri, \r
- XmlResolver dataSources,\r
- XmlArgumentList args,\r
- XmlWriter results)\r
- {\r
- Execute (new XPathDocument (XmlReader.Create (contextDocumentUri)), dataSources, args, results);\r
- }\r
-\r
- private void Execute (XPathNavigator context, XmlResolver ds, XmlArgumentList args, XmlWriter output)\r
- {\r
- executeMethod.Invoke (impl, new object [] {context, ds, args, output});\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
-\r
-#endif // NET_2_0\r
+++ /dev/null
-//
-// System.Xml.Query.XmlMapping
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2004 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.
-//
-
-#if NET_2_0
-
-namespace System.Xml.Query
-{
- public sealed class XmlMapping
- {
- private ArrayList dataSourceNames;
- private XmlExpression expression;
- private XmlSchema resultsSchema;
-
- [MonoTODO]
- public XmlMapping (string mappingUrl)
- {
- using (XmlReader xr = new XmlTextReader (mappingUrl)) {
- Initialize (xr);
- }
- }
-
- [MonoTODO]
- public XmlMapping (XmlReader reader)
- {
- Initialize (reader);
- }
-
- private void Initialize (XmlReader reader)
- {
- dataSourceNames = new ArrayList ();
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Should return clone list?")]
- public ArrayList DataSourceNames {
- get { return dataSourceNames; }
- }
-
- public XmlExpression Expression {
- get { return expression; }
- }
-
- public XmlSchema ResultsSchema {
- get { return resultsSchema; }
- }
- }
-}
-
-#endif // NET_2_0
+++ /dev/null
-//
-// System.Xml.Query.XmlMappingDictionary
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2004 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.
-//
-
-#if NET_2_0
-
-namespace System.Xml.Query
-{
- public sealed class XmlMappingDictionary
- : IDictionary, ICollection, IEnumerable, IXmlCompilerInclude
- {
- private Hashtable mappings;
-
- public XmlMappingDictionary ()
- {
- mappings = new Hashtable ();
- }
-
- public event QueryEventHandler OnProcessingEvent;
-
- [MonoTODO ("Check name conflicts")]
- public XmlMapping Add (string name, string mappingUrl)
- {
- using (XmlReader xr = new XmlTextReader (mappingUrl)) {
- return Add (name, xr);
- }
- }
-
- [MonoTODO ("Check name conflicts")]
- public XmlMapping Add (string name, XmlReader reader)
- {
- XmlMapping map = mapppings [name] as XmlMapping;
- if (map != null) {
- map = new XmlMapping (reader);
- mappings [name] = map;
- }
- return map;
- }
-
- [MonoTODO ("Check name conflicts")]
- public void Add (string name, XmlMapping mapping)
- {
- mappings.Add (name, mapping);
- }
-
- // Why virtual method inside sealed class :-?
- public virtual void Clear ()
- {
- mappings.Clear ();
- }
-
- public bool Contains (string name)
- {
- return mappings.Contains (name);
- }
-
- public virtual IDictionaryEnumerator GetEnumerator ()
- {
- return mappings.GetEnumerator ();
- }
-
- public void Remove (string name)
- {
- mappings.Remove (name);
- }
-
- public virtual int Count {
- get { return mappings.Count; }
- }
-
- public XmlMapping this [string name] {
- get { return mappings [name] as XmlMapping; }
- set { mappings [name] = value; }
- }
-
- void ICollections.CopyTo (Array array, int index)
- {
- mappings.CopyTo (array, index);
- }
-
- [MonoTODO]
- bool ICollection.IsSynchronized {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- object ICollection.SyncRoot {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO ("What if invalid type value?")]
- void IDictionary.Add (object key, object value)
- {
- if (value is string)
- Add ((string) key, (string) value);
- else if (value is XmlReader)
- Add ((string) key, (XmlReader) value);
- else
- Add ((string) key, (XmlMapping) value);
- }
-
- bool IDictionary.Contains (object key)
- {
- return Containts ((string) key);
- }
-
- bool IDictionary IsFixedSize {
- get { return false; }
- }
-
- bool IDictionary.IsReadOnly {
- get { return false; }
- }
-
- object IDictionary.this [object key] {
- get { return this [(string) key]; }
- set { this [(string) key] = (XmlMapping) value; }
- }
-
- ICollection IDictionary.Keys {
- get { return mappings.Keys; }
- }
-
- ICollection IDictionary.Values {
- get { return mappings.Values; }
- }
-
- void IDictionary.Remove (object key)
- {
- mappings.Remove ((string) key);
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- [MonoTODO]
- XmlExpression IXmlCompilerInclude.ResolveContextDocument ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- XmlExpression IXmlCompilerInclude.ResolveContextFunction (
- XmlQualifiedName funcName, object [] funcParams)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- XmlExpression IXmlCompilerInclude.ResolveContextDocument (
- XmlQualifiedName varName)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
-#endif // NET_2_0
+++ /dev/null
-2003-12-19 Tim Coleman <tim@timcoleman.com>
- * XmlDataSourceResolver:
- Missing semicolon broke build.
-
-2003-12-15 Atsushi Enomoto <atsushi@novell.com>
- * UpdateEventHandler.cs,
- XmlAdapter.cs,
- XmlDataSourceResolve.cs,
- XmlUpdateEventArgs.cs : Initial checkin.
+++ /dev/null
-//
-// UpdateEventHandler.cs
-//
-// Author:
-// Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-//
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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
-namespace System.Xml
-{
- public delegate void UpdateEventHandler (object sender, XmlUpdateEventArgs e);
-}
-
-#endif
+++ /dev/null
-//
-// XmlAdapter.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2003 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.
-//
-#if NET_2_0
-using System;
-using System.Collections;
-
-
-namespace System.Xml
-{
- public class XmlAdapter
- {
- public XmlAdapter ()
- {
- throw new NotImplementedException ();
- }
-
- public XmlAdapter (XmlResolver dataSource)
- {
- throw new NotImplementedException ();
- }
-
- public event UpdateEventHandler OnUpdateError;
-
- public void Fill (XPathDocument2 doc, XmlCommand query)
- {
- throw new NotImplementedException ();
- }
-
- public void Fill (XPathDocument2 doc, XmlCommand query, XmlQueryArgumentList argumentList)
- {
- throw new NotImplementedException ();
- }
-
- public void Update (IEnumerable changes, MappingSchema mappingSchema)
- {
- throw new NotImplementedException ();
- }
-
- public void Update (XPathChangeNavigator navigator, MappingSchema mappingSchema)
- {
- throw new NotImplementedException ();
- }
-
- public void Update (XPathDocument2 doc, MappingSchema mappingSchema)
- {
- throw new NotImplementedException ();
- }
-
- public bool AcceptChangesDuringFill {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- public bool AcceptChangesDuringUpdate {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- public bool ContinueUpdateOnError {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- public XmlResolver DataSources {
- set { throw new NotImplementedException (); }
- }
- }
-
-}
-
-
-#endif
+++ /dev/null
-//
-// XmlDataSourceResolver.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C)2003 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.
-//
-#if NET_2_0
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.SqlXml;
-using System.Net;
-
-namespace System.Xml
-{
- public class XmlDataSourceResolver : XmlResolver
- {
- XmlNameTable nameTable;
- Hashtable table;
-
- public XmlDataSourceResolver ()
- : this (new NameTable ())
- {
- }
-
- public XmlDataSourceResolver (XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
- table = new Hashtable ();
- }
-
- public virtual int Count {
- get { return table.Count; }
- }
-
- public ICredentials Credentials {
- set { throw new NotImplementedException (); }
- }
-
- public virtual object this [string query] {
- get { return table [new Uri (query, true, true)]; }
- }
-
- public virtual void Add (string name, IDbConnection dbConnection)
- {
- table.Add (new Uri (name), dbConnection);
- }
-
- public virtual void Add (string name, IDbTransaction dbTransaction)
- {
- table.Add (new Uri (name), dbTransaction);
- }
-
- public virtual void Add (string name, string sourceUri)
- {
- table.Add (new Uri (name), sourceUri);
- }
-
- public virtual void Add (string name, XmlReader documentReader)
- {
- table.Add (new Uri (name), documentReader);
- }
-
- public virtual void Add (string name, XPathNavigator2 document)
- {
- table.Add (new Uri (name), document);
- }
-
- public virtual void Clear ()
- {
- table.Clear ();
- }
-
- public virtual bool Contains (string name)
- {
- return table.ContainsKey (new Uri (name, true, true));
- }
-
- public override object GetEntity (Uri absoluteUri,
- string role,
- Type ofObjectToReturn)
- {
- if (absoluteUri == null)
- throw new ArgumentNullException ("absoluteUri");
-
- if (ofObjectToReturn == null)
- throw new ArgumentNullException ("ofObjectToReturn");
-
- object o = table [absoluteUri];
- if (o == null)
- return null;
-
- Type type = o.GetType ();
- if (type == ofObjectToReturn)
- return o;
- else if (type.IsSubClassOf (ofObjectToReturn))
- return o;
-
- switch (ofObjectToReturn.FullName) {
- case "System.Data.IDbConnection":
- throw new NotImplementedException ();
- case "System.Xml.XPathNavigator2":
- return GetXPathNavigator (o);
- case "System.Array": // array of IXPathNavigable
- throw new NotImplementedException ();
- default:
- throw new NotSupportedException ();
- }
- }
-
- private XPathNavigator2 GetXPathNavigator (object o)
- {
- if (o is string)
- return new XPathDocument2 (new XmlTextReader (o as string)).CreateNavigator ();
- else if (o is XmlReader)
- return new XPathDocument2 (o as XmlReader).CreateNavigator ();
- else
- throw new NotImplementedException ();
- }
-
- public IDictionaryEnumerator GetEnumerator ()
- {
- return table.GetEnumerator ();
- }
-
- public void Remove (string name)
- {
- table.Remove (new Uri (name, true, true));
- }
-
- public override Uri ResolveUri (Uri baseUri, string relativeUri)
- {
- // XmlDataSourceResolver has no concept of base URIs.
-
- // Note that this constructor uses new .NET 1.2 feature.
- return new Uri (relativeUri, true, true)
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// XmlUpdateEventArgs.cs
-//
-// Author:
-// Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-#if NET_2_0
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public abstract class XmlUpdateEventArgs
- {
-
- public XmlUpdateEventArgs ()
- {
- }
-
- public abstract IEnumerable ErrorItems { get; }
-
- public abstract bool Executed { get; }
-
- public abstract Exception InnerException { get; }
- }
-}
-#endif
+++ /dev/null
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Data.SqlXml {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- internal class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
+2005-06-09 Sureshkumar T <tsureshkumar@novell.com>
+
+ * OdbcDataReader.cs: GetValue (): return decimal in case of odbc
+ type Numeric. Move the temp buffer logic inside.
+
+ * OdbcTypeConverter.cs: map SQL_TYPE.NUMERIC to SQL_C_TYPE.CHAR by
+ now, since PgSql driver seems not to accept NUMERIC c type. Other
+ database anyway, provides NUMERIC datatype as DECIMAL.
+
2005-05-31 Sureshkumar T <tsureshkumar@novell.com>
* OdbcParameter.cs: setBuffer (): for numeric type, the buffer
// mk:@MSITStore:C:\program%20files\Microsoft%20Data%20Access%20SDK\Docs\odbc.chm::/htm/odbcc_data_types.htm
switch (col.OdbcType)
{
+ case OdbcType.Numeric:
case OdbcType.Decimal:
bufsize=50;
- buffer=new byte[bufsize]; // According to sqlext.h, use SQL_CHAR for decima.
- // 2005 03 10 : this now works with unixodbc with numeric c type.
+ buffer=new byte[bufsize]; // According to sqlext.h, use SQL_CHAR for decimal.
ret=libodbc.SQLGetData(hstmt, ColIndex, col.SqlCType, buffer, bufsize, ref outsize);
- byte[] temp = new byte[outsize];
- for (int i=0;i<outsize;i++)
- temp[i]=buffer[i];
-
- if (outsize!=-1)
+ if (outsize!=-1) {
+ byte[] temp = new byte[outsize];
+ for (int i=0;i<outsize;i++)
+ temp[i]=buffer[i];
DataValue=Decimal.Parse(System.Text.Encoding.Default.GetString(temp));
+ }
break;
case OdbcType.TinyInt:
short short_data=0;
OdbcTypeMap.Add (new TypeMap (OdbcType.Int, SQL_C_TYPE.LONG, SQL_TYPE.INTEGER ));
OdbcTypeMap.Add (new TypeMap (OdbcType.NChar, SQL_C_TYPE.WCHAR, SQL_TYPE.WCHAR ));
OdbcTypeMap.Add (new TypeMap (OdbcType.NText, SQL_C_TYPE.WCHAR, SQL_TYPE.WLONGVARCHAR));
- OdbcTypeMap.Add (new TypeMap (OdbcType.Numeric, SQL_C_TYPE.NUMERIC, SQL_TYPE.NUMERIC ));
+ // Currently, NUMERIC types works only with NUMERIC SQL Type to CHAR C Type mapping (pgsql). Other databases return
+ // SQL_TYPE.DECIMAL in place of numeric types.
+ OdbcTypeMap.Add (new TypeMap (OdbcType.Numeric, SQL_C_TYPE.CHAR, SQL_TYPE.NUMERIC ));
OdbcTypeMap.Add (new TypeMap (OdbcType.NVarChar, SQL_C_TYPE.WCHAR, SQL_TYPE.WVARCHAR ));
OdbcTypeMap.Add (new TypeMap (OdbcType.Real, SQL_C_TYPE.FLOAT, SQL_TYPE.REAL ));
OdbcTypeMap.Add (new TypeMap (OdbcType.SmallDateTime, SQL_C_TYPE.TIMESTAMP, SQL_TYPE.TIMESTAMP , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType)));
+2005-06-13 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataRowCollection.cs: Find (keys, version): Added an overload to
+ find keys matching given DataViewRowState filter. Used in
+ DataSet.Merge and DataTable.LoadDataRow.
+
+ * DataTable.cs: LoadDataRow (values, LoadOption): Use
+ DataRowCollection.Find (object [], DataViewRowState) overload.
+
+ * DataRow.cs:
+ - CopyValuesToRow: Create target "records" out of loop. Records
+ should be created once, not for each column. Dispose Unused target
+ records.
+
+ * MergeManager.cs:
+ - MergeRow: Find rows with matching original records. If not,
+ select with current values.
+ - MergeRow: While adding new row, use NewNotInitializedRow.
+
+ * ForeignKeyConstraint.cs: IsConstraintViolated: should not check
+ if EnforceConstraints is false.
+
+2005-06-10 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataRow.cs: CopyValuesToRow: if orginal == current, don't create
+ a new current record.
+
+ * DataSet.cs: GetChanges :Temporarily disable EnforceConstraints.
+
+ * MergeManager.cs: Merge: Temporarily disable
+ EnforceConstraints. Patch from george.barbarosie@gmail.com (George
+ Barbarosie).
+
+2005-06-09 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * DataView.cs: fixes GetListName
+
2005-06-02 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaConstants.cs,
using System.Globalization;
using System.Xml;
-using System.Data.Common;
-
namespace System.Data {
/// <summary>
/// Represents a row of data in a DataTable.
if (row == this)
throw new ArgumentException("'row' is the same as this object");
+ // create target records if missing.
+ if (HasVersion(DataRowVersion.Original)) {
+ if (row.Original < 0)
+ row.Original = row.Table.RecordCache.NewRecord();
+ else if (row.Original == row.Current) {
+ row.Original = row.Table.RecordCache.NewRecord();
+ row.Table.RecordCache.CopyRecord (row.Table, row.Current, row.Original);
+ }
+ } else {
+ if (row.Original > 0) {
+ if (row.Original != row.Current)
+ row.Table.RecordCache.DisposeRecord(row.Original);
+ row.Original = -1;
+ }
+ }
+
+ if (HasVersion(DataRowVersion.Current)) {
+ if (Current == Original) {
+ if (row.Current >= 0)
+ row.Table.RecordCache.DisposeRecord(row.Current);
+ row.Current = row.Original;
+ }else {
+ if (row.Current < 0)
+ row.Current = row.Table.RecordCache.NewRecord();
+ }
+ } else {
+ if (row.Current > 0) {
+ row.Table.RecordCache.DisposeRecord(row.Current);
+ row.Current = -1;
+ }
+ }
+
+ if (HasVersion(DataRowVersion.Proposed)) {
+ if (row.Proposed < 0)
+ row.Proposed = row.Table.RecordCache.NewRecord();
+ } else {
+ if (row.Proposed > 0) {
+ row.Table.RecordCache.DisposeRecord(row.Proposed);
+ row.Proposed = -1;
+ }
+ }
+
+ // copy source record values to target records
foreach(DataColumn column in Table.Columns) {
DataColumn targetColumn = row.Table.Columns[column.ColumnName];
//if a column with the same name exists in both rows copy the values
if(targetColumn != null) {
- int index = targetColumn.Ordinal;
if (HasVersion(DataRowVersion.Original)) {
- if (row.Original < 0) {
- row.Original = row.Table.RecordCache.NewRecord();
- }
object val = column[Original];
row.CheckValue(val, targetColumn);
targetColumn[row.Original] = val;
}
- else {
- if (row.Original > 0) {
- row.Table.RecordCache.DisposeRecord(row.Original);
- row.Original = -1;
- }
- }
- if (HasVersion(DataRowVersion.Current)) {
- if (row.Current < 0) {
- row.Current = row.Table.RecordCache.NewRecord();
- }
+ if (HasVersion(DataRowVersion.Current)
+ && Current != Original) {
object val = column[Current];
row.CheckValue(val, targetColumn);
targetColumn[row.Current] = val;
}
- else {
- if (row.Current > 0) {
- row.Table.RecordCache.DisposeRecord(row.Current);
- row.Current = -1;
- }
- }
if (HasVersion(DataRowVersion.Proposed)) {
- if (row.Proposed < 0) {
- row.Proposed = row.Table.RecordCache.NewRecord();
- }
object val = column[row.Proposed];
row.CheckValue(val, targetColumn);
targetColumn[row.Proposed] = val;
}
- else {
- if (row.Proposed > 0) {
- row.Table.RecordCache.DisposeRecord(row.Proposed);
- row.Proposed = -1;
- }
- }
}
}
if (HasErrors) {
return (record != -1) ? table.RecordCache[record] : null;
}
+ /// <summary>
+ /// Gets the row containing the specified primary key values by searching the rows
+ /// filtered by the state.
+ /// </summary>
+ internal DataRow Find (object [] keys, DataViewRowState rowStateFilter)
+ {
+ if (table.PrimaryKey.Length == 0)
+ throw new MissingPrimaryKeyException ("Table doesn't have a primary key.");
+
+ if (keys == null)
+ throw new ArgumentException ("Expecting " + table.PrimaryKey.Length +" value(s) for the key being indexed, but received 0 value(s).");
+
+ Index index = table.FindIndex (table.PrimaryKey, null, rowStateFilter, null);
+ if (index == null)
+ index = new Index (new Key (table, table.PrimaryKey, null, rowStateFilter, null));
+
+ int record = index.Find(keys);
+ return (record != -1) ? table.RecordCache[record] : null;
+ }
+
internal DataRow Find(int index)
{
DataColumn[] primaryKey = table.PrimaryKey;
return null;\r
\r
DataSet copySet = Clone ();\r
+ bool prev = copySet.EnforceConstraints;\r
+ copySet.EnforceConstraints = false;\r
+\r
Hashtable addedRows = new Hashtable ();\r
\r
- IEnumerator tableEnumerator = Tables.GetEnumerator ();\r
- DataTable origTable;\r
- DataTable copyTable;\r
- while (tableEnumerator.MoveNext ()) {\r
- origTable = (DataTable)tableEnumerator.Current;\r
- copyTable = copySet.Tables[origTable.TableName];\r
- \r
- // Look for relations that have this table as child\r
- IEnumerator relations = origTable.ParentRelations.GetEnumerator ();\r
-\r
- IEnumerator rowEnumerator = origTable.Rows.GetEnumerator ();\r
- while (rowEnumerator.MoveNext ()) {\r
- DataRow row = (DataRow)rowEnumerator.Current;\r
- \r
- if (row.IsRowChanged (rowStates))\r
- AddChangedRow (addedRows, copySet, copyTable, relations, row);\r
+ for (int i = 0; i < Tables.Count; i++) {\r
+ DataTable origTable = Tables [i];\r
+ DataTable copyTable = copySet.Tables[origTable.TableName];\r
+ for (int j = 0; j < origTable.Rows.Count; j++) {\r
+ DataRow row = origTable.Rows [j];\r
+ if (!row.IsRowChanged (rowStates)\r
+ || addedRows.Contains (row))\r
+ continue;\r
+ AddChangedRow (addedRows, copyTable, row);\r
}\r
}\r
+ copySet.EnforceConstraints = prev;\r
return copySet;\r
}\r
\r
- void AddChangedRow (Hashtable addedRows, DataSet copySet, DataTable copyTable, IEnumerator relations, DataRow row)\r
+ private void AddChangedRow (Hashtable addedRows, DataTable copyTable, DataRow row)\r
{\r
if (addedRows.ContainsKey (row)) return;\r
- \r
- relations.Reset ();\r
- while (relations.MoveNext ()) {\r
- DataRow parentRow = row.GetParentRow ((DataRelation) relations.Current);\r
- if (parentRow == null || addedRows.ContainsKey (parentRow)) continue;\r
- DataTable parentCopyTable = copySet.Tables [parentRow.Table.TableName];\r
- AddChangedRow (addedRows, copySet, parentCopyTable, parentRow.Table.ParentRelations.GetEnumerator (), parentRow);\r
+\r
+ foreach (DataRelation relation in row.Table.ParentRelations) {\r
+ DataRow parent = row.GetParentRow (relation);\r
+ if (parent == null)\r
+ continue;\r
+ // add the parent row\r
+ DataTable parentCopyTable = copyTable.DataSet.Tables [parent.Table.TableName];\r
+ AddChangedRow (addedRows, parentCopyTable, parent);\r
}\r
- \r
- DataRow newRow = copyTable.NewRow ();\r
- copyTable.Rows.Add (newRow);\r
- row.CopyValuesToRow (newRow); \r
+\r
+ // add the current row\r
+ DataRow newRow = copyTable.NewNotInitializedRow();\r
+ copyTable.Rows.AddInternal(newRow);\r
+ row.CopyValuesToRow (newRow);\r
newRow.XmlRowID = row.XmlRowID;\r
- addedRows.Add (row,row);\r
+ addedRows.Add (row, row);\r
}\r
\r
#if NET_2_0\r
\r
// Find Data DataRow\r
if (this.PrimaryKey.Length > 0) {\r
- Index index = FindIndex (PrimaryKey,null,DataViewRowState.OriginalRows,null);\r
- if (index == null)\r
- index = new Index (new Key(this, PrimaryKey,null,DataViewRowState.OriginalRows,null));\r
-\r
object [] keys = new object [PrimaryKey.Length];\r
for (int i=0; i < PrimaryKey.Length; i++)\r
keys [i] = values [PrimaryKey [i].Ordinal];\r
\r
- int existingRecord = index.Find(keys);\r
- if (existingRecord >= 0)\r
- row = RecordCache[existingRecord];\r
- else { \r
- existingRecord = _primaryKeyConstraint.Index.Find(keys);\r
- if (existingRecord >= 0)\r
- row = RecordCache[existingRecord];\r
- }\r
+ row = Rows.Find(keys, DataViewRowState.OriginalRows);\r
+ if (row == null)\r
+ row = Rows.Find (keys);\r
}\r
\r
// If not found, add new row\r
return new PropertyDescriptorCollection (descriptors);\r
}\r
\r
- [MonoTODO]\r
+ \r
string ITypedList.GetListName (PropertyDescriptor[] listAccessors) \r
{\r
+ if (dataTable != null) { \r
+ return dataTable.TableName;\r
+ }\r
return "";\r
}\r
\r
protected override bool IsConstraintViolated()
{
- if (Table.DataSet == null || RelatedTable.DataSet == null) return false; //
+ if (Table.DataSet == null || RelatedTable.DataSet == null)
+ return false;
+
+ if (!Table.DataSet.EnforceConstraints)
+ return false;
bool hasErrors = false;
foreach (DataRow row in Table.Rows) {
if(sourceSet == null)
throw new ArgumentNullException("sourceSet");
+ bool prevEC = targetSet.EnforceConstraints;
+ targetSet.EnforceConstraints = false;
foreach (DataTable t in sourceSet.Tables)
MergeManager.Merge(targetSet, t, preserveChanges, missingSchemaAction);
AdjustSchema(targetSet,sourceSet,missingSchemaAction);
-
+ targetSet.EnforceConstraints = prevEC;
}
internal static void Merge(DataSet targetSet, DataTable sourceTable, bool preserveChanges, MissingSchemaAction missingSchemaAction)
}
// find the row in the target table.
- targetRow = targetTable.Rows.Find(keyValues);
+ targetRow = targetTable.Rows.Find(keyValues, DataViewRowState.OriginalRows);
+ if (targetRow == null)
+ targetRow = targetTable.Rows.Find(keyValues);
}
// row doesn't exist in target table, or there are no primary keys.
// create new row and copy values from source row to the new row.
if (targetRow == null)
{
- targetRow = targetTable.NewRow();
- targetRow.Proposed = -1;
- row.CopyValuesToRow(targetRow);
- targetTable.Rows.Add(targetRow);
+ DataRow newRow = targetTable.NewNotInitializedRow();
+ row.CopyValuesToRow(newRow);
+ targetTable.Rows.AddInternal (newRow);
}
// row exists in target table, and presere changes is false -
// change the values of the target row to the values of the source row.
+2005-06-10 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataSetReadXmlSchemaTest.cs : TestSampleFileImportSimple() is not
+ working and it takes so much time (downloading), so just disable it.
+
2005-06-02 Atsushi Enomoto <atsushi@ximian.com>
* DataSetReadXmlSchemaTest.cs : testcase for bug #75121.
}\r
\r
[Test]\r
+ // FIXME: we can 1) use different schema to import and/or 2)\r
+ // fix xml bug(?) thingy.\r
+ [Category ("NotWorking")]\r
public void TestSampleFileImportSimple ()\r
{\r
DataSet ds = new DataSet ();\r
- ds.ReadXmlSchema ("Test/System.Data/schemas/test010.xsd");\r
+ XmlTextReader xtr = null;
+ try {
+ xtr = new XmlTextReader ("Test/System.Data/schemas/test010.xsd");
+ xtr.XmlResolver = null;
+ ds.ReadXmlSchema (xtr);\r
+ } finally {
+ if (xtr != null)
+ xtr.Close ();
+ }
AssertDataSet ("010", ds, "NewDataSet", 1, 0);\r
\r
DataTable dt = ds.Tables [0];\r
+2005-06-13 Peter Bartok <pbartok@novell.com>
+
+ * Icon.cs(ToBitmap): If the icon is not 32bits, create the bitmap
+ through an intermediary step, which turns it into a 32bit version.
+ Fixes #75254
+
+2005-06-13 Kornél Pál <kornelpal@hotmail.com>
+
+ * ComIStreamMarshaler.cs: Dispose releases managed objects as well,
+ removed some unnecessary code
+ * ComIStreamWrapper.cs: Reworked Seek method to proper support of
+ positions beyond the size of stream
+
+2005-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Font.cs: fix platform checks.
+
+2005-06-08 Jordi Mas i Hernandez <jordi@ximian.com>
+
+ * Rectangle.cs:
+ - Fixes is empty method IsEmpty logic
+ - Fixes Contains method logic
+ - Fixes IntersectsWith logic
+
+ * RectangleF.cs:
+ - Fixes is empty method IsEmpty logic
+ - Fixes Contains method logic
+ - Fixes IntersectsWith logic
+
2005-05-28 Kornél Pál <kornelpal@hotmail.com>
* ComIStreamMarshaler.cs: GC.SuppressFinalize(this) is not called in
// Copyright (C) 2005 Kornél Pál
//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
private static readonly IntPtr comVtable;
private static readonly VtableDestructor vtableDestructor;
- private readonly IStream managedInterface;
- private readonly IntPtr comInterface;
+ private IStream managedInterface;
+ private IntPtr comInterface;
// Keeps the object alive when it has no managed references
- private readonly GCHandle gcHandle;
+ private GCHandle gcHandle;
private int refCount = 1;
static ManagedToNativeWrapper()
Marshal.FreeHGlobal(comInterface);
gcHandle.Free();
if (disposing)
+ {
+ comInterface = IntPtr.Zero;
+ managedInterface = null;
GC.SuppressFinalize(this);
+ }
}
internal static IStream GetUnderlyingInterface(IntPtr comInterface, bool outParam)
private static int Clone(IntPtr @this, out IntPtr ppstm)
{
+ ppstm = IntPtr.Zero;
#if MAP_EX_TO_HR
try
{
#endif
IStream newInterface;
- ppstm = IntPtr.Zero;
GetObject(@this).managedInterface.Clone(out newInterface);
ppstm = ManagedToNativeWrapper.GetInterface(newInterface);
return S_OK;
}
catch (Exception e)
{
- ppstm = IntPtr.Zero;
return GetHRForException(e);
}
#endif
// Managed Runtime Callable Wrapper implementation
private sealed class NativeToManagedWrapper : IStream
{
- private readonly IntPtr comInterface;
- private readonly IStreamVtbl managedVtable;
+ private IntPtr comInterface;
+ private IStreamVtbl managedVtable;
private NativeToManagedWrapper(IntPtr comInterface, bool outParam)
{
{
managedVtable.Release(comInterface);
if (disposing)
+ {
+ comInterface = IntPtr.Zero;
+ managedVtable = null;
GC.SuppressFinalize(this);
+ }
}
internal static IntPtr GetUnderlyingInterface(IStream managedInterface)
// Copyright (C) 2005 Kornél Pál
//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
public void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition)
{
- long newPosition = -1;
+ long newPosition;
if (baseStream.CanWrite)
{
- long length = baseStream.Length;
- long curPos;
-
- if ((curPos = position) == -1)
- curPos = baseStream.Position;
-
switch ((SeekOrigin)dwOrigin)
{
case SeekOrigin.Begin:
- if (dlibMove > length)
- newPosition = dlibMove;
+ newPosition = dlibMove;
break;
case SeekOrigin.Current:
- if (curPos + dlibMove > length)
- newPosition = curPos + dlibMove;
+ if ((newPosition = position) == -1)
+ newPosition = baseStream.Position;
+ newPosition += dlibMove;
break;
case SeekOrigin.End:
- if (dlibMove > 0)
- newPosition = length + dlibMove;
+ newPosition = baseStream.Length + dlibMove;
break;
+ default:
+ throw new ExternalException(null, STG_E_INVALIDFUNCTION);
}
- }
- if (newPosition == -1)
+ if (newPosition > baseStream.Length)
+ position = newPosition;
+ else
+ {
+ baseStream.Position = newPosition;
+ position = -1;
+ }
+ }
+ else
{
- newPosition = baseStream.Seek(dlibMove, (SeekOrigin)dwOrigin);
+ try
+ {
+ newPosition = baseStream.Seek(dlibMove, (SeekOrigin)dwOrigin);
+ }
+ catch (ArgumentException)
+ {
+ throw new ExternalException(null, STG_E_INVALIDFUNCTION);
+ }
position = -1;
}
- else
- position = newPosition;
if (plibNewPosition != IntPtr.Zero)
Marshal.WriteInt64(plibNewPosition, newPosition);
return(result);
}
- if ((int) osInfo.Platform == 128) {
+ if ((int) osInfo.Platform == 128 || (int) osInfo.Platform == 4) {
// If we're on Unix we use our private gdiplus API to avoid Wine
// dependencies in S.D
return IntPtr.Zero;
}
- if ((int) osInfo.Platform == 128) {
+ if ((int) osInfo.Platform == 128 || (int) osInfo.Platform == 4) {
return fontObject;
} else {
LOGFONTA lf = new LOGFONTA ();
writer.Flush ();
// create bitmap from stream and return
- bmp = new Bitmap (stream);
+ if (colCount > 0) {
+ Bitmap new_bmp;
+
+ new_bmp = new Bitmap(stream);
+ bmp = new Bitmap(new_bmp, bih.biWidth, bih.biHeight/2);
+ new_bmp.Dispose();
+ } else {
+ bmp = new Bitmap(stream);
+ }
// This hack is so ugly, it's embarassing.
// But icons are small, so it should be ok for now
///
/// <remarks>
/// Indicates if the width or height are zero. Read only.
- /// </remarks>
- // LAMESPEC: Documentation says "This property returns true if
- // the Width, Height, X, and Y properties of this RectangleF all
- // have values of zero; otherwise, false.". Reality returns TRUE if
- // width or height are equal 0
+ /// </remarks>
[Browsable (false)]
public bool IsEmpty {
get {
- return ((width == 0) || (height == 0));
+ return ((x == 0) && (y == 0) && (width == 0) && (height == 0));
}
}
public bool Contains (int x, int y)
{
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
+ return ((x >= Left) && (x < Right) &&
+ (y >= Top) && (y < Bottom));
}
/// <summary>
public bool IntersectsWith (Rectangle r)
{
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
+ return !((Left >= r.Right) || (Right <= r.Left) ||
+ (Top >= r.Bottom) || (Bottom <= r.Top));
}
/// <summary>
/// <remarks>
/// Indicates if the width or height are zero. Read only.
/// </remarks>
- //
- // LAMESPEC: Documentation says "This property returns true if
- // the Width, Height, X, and Y properties of this RectangleF all
- // have values of zero; otherwise, false.". Reality returns TRUE if
- // width or height are equal 0
-
+ //
[Browsable (false)]
public bool IsEmpty {
get {
- return ((width == 0) || (height == 0));
+ return ((x == 0) && (y == 0) && (width == 0) && (height == 0));
}
}
public bool Contains (float x, float y)
{
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
+ return ((x >= Left) && (x < Right) &&
+ (y >= Top) && (y < Bottom));
}
/// <summary>
public bool IntersectsWith (RectangleF r)
{
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
+ return !((Left >= r.Right) || (Right <= r.Left) ||
+ (Top >= r.Bottom) || (Bottom <= r.Top));
}
/// <summary>
System.Drawing/TestPoint.cs
System.Drawing/TestPointConverter.cs
System.Drawing/TestPointF.cs
+System.Drawing/TestRectangle.cs
System.Drawing/TestRectangleConverter.cs
+System.Drawing/TestRectangleF.cs
System.Drawing/TestSize.cs
System.Drawing/TestSizeConverter.cs
System.Drawing/TestSizeF.cs
--- /dev/null
+// Tests for System.Drawing.Rectangle.cs
+
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Author: Jordi Mas i Hernandez <jordi@ximian.com>
+//
+
+using NUnit.Framework;
+using System;
+using System.Drawing;
+
+namespace MonoTests.System.Drawing
+{
+
+ [TestFixture]
+ public class TestRectangle : Assertion
+ {
+ Rectangle rect_0;
+ Rectangle rect_1;
+ Rectangle rect_2;
+ Rectangle rect_3;
+ Rectangle rect_4;
+ Rectangle rect_5;
+
+ [TearDown]
+ public void Clean () {}
+
+ [SetUp]
+ public void GetReady ()
+ {
+ rect_0 = new Rectangle (10, 10, 40, 40);
+ rect_1 = new Rectangle (5, 5, 5, 5);
+ rect_2 = Rectangle.Empty;
+ rect_3 = new Rectangle (25, 25, 0, 0);
+ rect_4 = new Rectangle (25, 252, 10, 20);
+ rect_5 = new Rectangle (40, 40, 50, 50);
+ }
+
+ [Test]
+ public void Contains ()
+ {
+ AssertEquals (rect_0.Contains (5, 5), false);
+ AssertEquals (rect_0.Contains (12, 12), true);
+ AssertEquals (rect_0.Contains (10, 10), true);
+ AssertEquals (rect_0.Contains (10, 50), false);
+ AssertEquals (rect_0.Contains (50, 10), false);
+ }
+
+ [Test]
+ public void Empty ()
+ {
+ AssertEquals (rect_2.X, 0);
+ AssertEquals (rect_2.Y, 0);
+ AssertEquals (rect_2.Width, 0);
+ AssertEquals (rect_2.Height, 0);
+ }
+
+ [Test]
+ public void IsEmpty ()
+ {
+ AssertEquals (rect_0.IsEmpty, false);
+ AssertEquals (rect_2.IsEmpty, true);
+ AssertEquals (rect_3.IsEmpty, false);
+ }
+
+ [Test]
+ public void Contents ()
+ {
+ AssertEquals (rect_4.X, 25);
+ AssertEquals (rect_4.Y, 252);
+ AssertEquals (rect_4.Width, 10);
+ AssertEquals (rect_4.Height, 20);
+ AssertEquals (rect_4.Size, new Size (10, 20));
+ AssertEquals (rect_4.Right, rect_4.X + rect_4.Width);
+ AssertEquals (rect_4.Left, rect_4.X);
+ AssertEquals (rect_4.Bottom, rect_4.Y + rect_4.Height);
+ AssertEquals (rect_4.Top, rect_4.Y);
+ }
+
+ [Test]
+ public void IntersectsWith ()
+ {
+ AssertEquals (rect_0.IntersectsWith (rect_1), false);
+ AssertEquals (rect_0.IntersectsWith (rect_2), false);
+ AssertEquals (rect_0.IntersectsWith (rect_5), true);
+ AssertEquals (rect_5.IntersectsWith (rect_0), true);
+ AssertEquals (rect_0.IntersectsWith (rect_4), false);
+ }
+
+ }
+}
+
--- /dev/null
+// Tests for System.Drawing.RectangleF.cs
+
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Author: Jordi Mas i Hernandez <jordi@ximian.com>
+//
+
+using NUnit.Framework;
+using System;
+using System.Drawing;
+
+namespace MonoTests.System.Drawing
+{
+
+ [TestFixture]
+ public class TestRectangleF : Assertion
+ {
+ RectangleF rect_0;
+ RectangleF rect_1;
+ RectangleF rect_2;
+ RectangleF rect_3;
+ RectangleF rect_4;
+ RectangleF rect_5;
+
+ [TearDown]
+ public void Clean () {}
+
+ [SetUp]
+ public void GetReady ()
+ {
+ rect_0 = new RectangleF (10, 10, 40, 40);
+ rect_1 = new RectangleF (5, 5, 5, 5);
+ rect_2 = RectangleF.Empty;
+ rect_3 = new RectangleF (25, 25, 0, 0);
+ rect_4 = new RectangleF (25, 252, 10, 20);
+ rect_5 = new RectangleF (40, 40, 50, 50);
+ }
+
+ [Test]
+ public void Contains ()
+ {
+ AssertEquals (rect_0.Contains (5, 5), false);
+ AssertEquals (rect_0.Contains (12, 12), true);
+ AssertEquals (rect_0.Contains (10, 10), true);
+ AssertEquals (rect_0.Contains (10, 50), false);
+ AssertEquals (rect_0.Contains (50, 10), false);
+ }
+
+ [Test]
+ public void Empty ()
+ {
+ AssertEquals (rect_2.X, 0);
+ AssertEquals (rect_2.Y, 0);
+ AssertEquals (rect_2.Width, 0);
+ AssertEquals (rect_2.Height, 0);
+ }
+
+ [Test]
+ public void IsEmpty ()
+ {
+ AssertEquals (rect_0.IsEmpty, false);
+ AssertEquals (rect_2.IsEmpty, true);
+ AssertEquals (rect_3.IsEmpty, false);
+ }
+
+ [Test]
+ public void Contents ()
+ {
+ AssertEquals (rect_4.X, 25);
+ AssertEquals (rect_4.Y, 252);
+ AssertEquals (rect_4.Width, 10);
+ AssertEquals (rect_4.Height, 20);
+ AssertEquals (rect_4.Size, new SizeF (10, 20));
+ AssertEquals (rect_4.Right, rect_4.X + rect_4.Width);
+ AssertEquals (rect_4.Left, rect_4.X);
+ AssertEquals (rect_4.Bottom, rect_4.Y + rect_4.Height);
+ AssertEquals (rect_4.Top, rect_4.Y);
+ }
+
+ [Test]
+ public void IntersectsWith ()
+ {
+ AssertEquals (rect_0.IntersectsWith (rect_1), false);
+ AssertEquals (rect_0.IntersectsWith (rect_2), false);
+ AssertEquals (rect_0.IntersectsWith (rect_5), true);
+ AssertEquals (rect_5.IntersectsWith (rect_0), true);
+ AssertEquals (rect_0.IntersectsWith (rect_4), false);
+ }
+
+ }
+}
+
fi\r
\r
export MSNet=Yes\r
-cp ../../System.Drawing_test.dll .\r
+cp ../../System.Drawing_test_default.dll .\r
topdir=../../../..\r
-NUNITCONSOLE=$topdir/class/lib/nunit-console.exe\r
+NUNITCONSOLE=$topdir/class/lib/default/nunit-console.exe\r
MONO_PATH=$topdir/nunit20:$topdir/class/lib:.\r
\r
for i in $@; do\r
fixture="/fixture:MonoTests.${i}"\r
fi\r
MONO_PATH=$MONO_PATH \\r
- ${NUNITCONSOLE} System.Drawing_test.dll $fixture\r
+ ${NUNITCONSOLE} System.Drawing_test_default.dll $fixture\r
done\r
\r
\r
+2005-05-10 Lluis Sanchez Gual <lluis@novell.com>
+
+ * SoapTypeMapper.cs: Serialize floats and doubles using the correct
+ precision. Patch by Roei Erez that fixes bug #75196.
+
2005-05-09 Lluis Sanchez Gual <lluis@novell.com>
* SoapReader.cs:
return ((decimal) value).ToString (CultureInfo.InvariantCulture);
}
else if (value is double) {
- return ((double) value).ToString (CultureInfo.InvariantCulture);
+ return ((double) value).ToString ("G17", CultureInfo.InvariantCulture);
}
else if (value is float) {
- return ((float) value).ToString (CultureInfo.InvariantCulture);
+ return ((float) value).ToString ("G9", CultureInfo.InvariantCulture);
}
else if (value is TimeSpan) {
return SoapDuration.ToString ((TimeSpan)value);
+2005-06-06 Kornél Pál <kornelpal@hotmail.com>
+
+ * WebServicesConfigurationSectionHandler.cs: Added support for HttpPostLocalhost and HttpSoap12
+
2005-06-05 Konstantin Triger <kostat@mainsoft.com>
* WebServicesConfigurationSectionHandler.cs: moving static fields to AppDomain in Java builds
HttpPost = 1 << 1,
HttpGet = 1 << 2,
Documentation = 1 << 3,
- All = 0x0F
+#if NET_1_1
+ HttpSoap12 = 1 << 4,
+ HttpPostLocalhost = 1 << 5,
+#endif
+ All = 0xFF
}
class WSConfig
{
WSProtocol proto;
error = null;
+
+#if ONLY_1_1
+ switch (protoName) {
+ case "HttpSoap1.2":
+ protoName = "HttpSoap12";
+ break;
+ case "HttpSoap12":
+ protoName = null;
+ break;
+ }
+#endif
try {
proto = (WSProtocol) Enum.Parse (typeof (WSProtocol), protoName);
} catch {
+2005-06-06 Kornél Pál <kornelpal@hotmail.com>
+
+ * ServiceDescriptionReflector.cs: Added support for HttpPostLocalhost and HttpSoap12
+
2005-06-05 Konstantin Triger <kostat@mainsoft.com>
* ServiceDescriptionSerializerBase.cs: Perform correct name encoding
if (WSConfig.IsSupported (WSProtocol.HttpGet))\r
new HttpGetProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);\r
\r
+#if NET_1_1\r
+ if (WSConfig.IsSupported (WSProtocol.HttpPost) || WSConfig.IsSupported (WSProtocol.HttpPostLocalhost))\r
+#else\r
if (WSConfig.IsSupported (WSProtocol.HttpPost))\r
+#endif\r
new HttpPostProtocolReflector ().Reflect (this, type, url, schemaExporter, soapSchemaExporter);\r
\r
int i=0;\r
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpSoapWebServiceHandler.cs: use the HttpResponse.BufferOutput
+ instead of our own MemoryStream when buffering is enabled. Flush the
+ response instead of closing it, as that allows for Content-Length to
+ be sent from HttpResponse and helps reusing connections.
+
+2005-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * WebServiceHelper.cs: don't even try to read the response if its length
+ is known to be 0.
+
+ * SoapHttpClientProtocol.cs: for successful responses on methods that
+ are not one-way, don't return immediately if the content length is 0 so
+ that the check for Content-Type takes place.
+
+2005-06-07 Kornél Pál <kornelpal@hotmail.com>
+
+ * WebServiceHandlerFactory.cs: Throw InvalidOperationException instead of
+ returning DummyHttpHandler when the request format is not supported.
+
+2005-06-06 Kornél Pál <kornelpal@hotmail.com>
+
+ * WebServiceHandlerFactory.cs: Added support for HttpPostLocalhost and HttpSoap12
+
2005-06-05 Konstantin Triger <kostat@mainsoft.com>
* SoapHttpClientProtocol.cs: Close WebResponse to free resources
response.ContentType = "text/xml; charset=utf-8";
if (message.Exception != null) response.StatusCode = 500;
- long contentLength = 0;
- Stream outStream = null;
- MemoryStream bufferStream = null;
Stream responseStream = response.OutputStream;
+ Stream outStream = responseStream;
bool bufferResponse = (methodInfo == null || methodInfo.MethodAttribute.BufferResponse);
-
- if (bufferResponse)
- {
- bufferStream = new MemoryStream ();
- outStream = bufferStream;
- }
- else
- outStream = responseStream;
+ response.BufferOutput = bufferResponse;
try
{
SoapExtension.ExecuteProcessMessage (_extensionChainHighPrio, message, true);
}
- if (bufferStream != null) contentLength = bufferStream.Length;
- xtw.Close ();
+ xtw.Flush ();
}
catch (Exception ex)
{
responseStream.Close ();
return;
}
-
- try
- {
- if (bufferResponse)
- responseStream.Write (bufferStream.GetBuffer(), 0, (int) contentLength);
- }
- catch {}
-
- responseStream.Close ();
}
void SerializeFault (HttpContext context, SoapServerMessage requestMessage, Exception ex)
msg = String.Format (msg, (int) code, code);\r
throw new WebException (msg, null, WebExceptionStatus.ProtocolError, http_response);\r
}\r
- if (response.ContentLength == 0 && (code == HttpStatusCode.Accepted || code == HttpStatusCode.OK)) {\r
+ if (message.OneWay && response.ContentLength == 0 && (code == HttpStatusCode.Accepted || code == HttpStatusCode.OK)) {\r
return new object[0];\r
}\r
}\r
//
using System.IO;
+using System.Net;
using System.Web.Services;
using System.Web.Services.Configuration;
using System.Web.SessionState;
namespace System.Web.Services.Protocols
{
- class DummyHttpHandler : IHttpHandler
- {
- bool IHttpHandler.IsReusable {
- get { return false; }
- }
-
- void IHttpHandler.ProcessRequest (HttpContext context)
- {
- // Do nothing
- }
- }
-
class SessionWrapperHandler : IHttpHandler, IRequiresSessionState
{
IHttpHandler handler;
Type type = WebServiceParser.GetCompiledType (filePath, context);
WSProtocol protocol = GuessProtocol (context, verb);
+ bool supported = false;
IHttpHandler handler = null;
- if (!WSConfig.IsSupported (protocol))
- return new DummyHttpHandler ();
+ supported = WSConfig.IsSupported (protocol);
+ if (!supported) {
+ switch (protocol) {
+ case WSProtocol.HttpSoap:
+ supported = WSConfig.IsSupported (WSProtocol.HttpSoap12);
+ break;
+ case WSProtocol.HttpPost:
+ if (WSConfig.IsSupported (WSProtocol.HttpPostLocalhost)) {
+ string localAddr = context.Request.ServerVariables ["LOCAL_ADDR"];
+
+ supported = localAddr != null &&
+ (localAddr == context.Request.ServerVariables ["REMOTE_ADDR"] ||
+ IPAddress.IsLoopback (IPAddress.Parse (localAddr)));
+ }
+ break;
+ }
+ }
+ if (!supported)
+ throw new InvalidOperationException ("Unsupported request format.");
switch (protocol) {
case WSProtocol.HttpSoap:
StringBuilder sb = new StringBuilder ();
sb.Append (message);
- sb.Append ("\r\nResponse error message:\r\n--\r\n");
+ if (response.ContentLength > 0) {
+ sb.Append ("\r\nResponse error message:\r\n--\r\n");
- try {
- StreamReader resp = new StreamReader (response.GetResponseStream (), enc);
- sb.Append (resp.ReadToEnd ());
- } catch (Exception) {
+ try {
+ StreamReader resp = new StreamReader (response.GetResponseStream (), enc);
+ sb.Append (resp.ReadToEnd ());
+ } catch (Exception) {
+ }
}
throw new InvalidOperationException (sb.ToString ());
+2005-06-08 Konstantin Triger <kostat@mainsoft.com>
+
+ * WebMethodAttribute.cs: Added TARGET_J2EE ifdef to remove the EnterpiseServices dependency, which are not supported yet under this target
+
2004-08-25 Lluis Sanchez Gual <lluis@novell.com>
* WebService.cs: Get the HttpContext from the HttpContext.Current, do not
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
+#if !TARGET_J2EE
using System.EnterpriseServices;\r
+#endif
\r
namespace System.Web.Services {\r
+
+#if TARGET_J2EE
+ public enum TransactionOption {Disabled , NotSupported , Required , RequiresNew , Supported }
+#endif
+
[AttributeUsage(AttributeTargets.Method, Inherited = true)]\r
public sealed class WebMethodAttribute : Attribute {\r
\r
+2005-06-10 Lluis Sanchez Gual <lluis@novell.com>
+
+ * services.xml: Disable some tests on external services
+ since they are very unreliable.
+
2005-02-07 Lluis Sanchez Gual <lluis@novell.com>
* client/localhost/TestBinding4Test.cs: Fix build.
<?xml version="1.0" encoding="utf-8"?>
-<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+<services xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<service>
<wsdl>http://upload.eraserver.net/circle24/autoloan.asmx?wsdl</wsdl>
<name>autoloanTest</name>
<protocols>
<protocol>Soap</protocol>
</protocols>
- <clientTest>true</clientTest>
+ <clientTest>false</clientTest>
</service>
<service>
<wsdl>http://www.barnaland.is/dev/sms.asmx?WSDL</wsdl>
<protocols>
<protocol>Soap</protocol>
</protocols>
- <clientTest>true</clientTest>
+ <clientTest>false</clientTest>
</service>
<service>
<wsdl>http://www.indobiz.com/OptionPricing.asmx?WSDL</wsdl>
<protocols>
<protocol>Soap</protocol>
</protocols>
- <clientTest>true</clientTest>
+ <clientTest>false</clientTest>
</service>
<service>
<wsdl>http://www.xmethods.net/wsdl/query.wsdl</wsdl>
<protocols>
<protocol>Soap</protocol>
</protocols>
- <clientTest>true</clientTest>
+ <clientTest>false</clientTest>
</service>
<service>
<wsdl>http://ws2.serviceobjects.net/pt/PackTrack.asmx?WSDL</wsdl>
<protocols>
<protocol>Soap</protocol>
</protocols>
- <clientTest>true</clientTest>
+ <clientTest>false</clientTest>
</service>
<service>
<wsdl>http://www.oakleaf.ws/cfrsearchws/cfrsearchws.asmx?wsdl</wsdl>
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Consts.cs: updated revision for Microsoft.VSDesigner.
+
2005-03-11 Lluis Sanchez Gual <lluis@novell.com>
* AssemblyInfo.cs: Registered GridView.js script.
public const string AssemblySystem_Design = "System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
public const string AssemblySystem_Drawing_Design = "System.Drawing.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
- public const string AssemblyMicrosoft_VSDesigner = "Microsoft.VSDesigner, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
+ public const string AssemblyMicrosoft_VSDesigner = "Microsoft.VSDesigner, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
#endif
-}
\ No newline at end of file
+}
+2005-06-10 Lluis Sanchez Gual <lluis@novell.com>
+
+ * System.Web.dll.sources: New files:
+ System.Web.Security/MembershipValidatePasswordEventHandler.cs
+ System.Web.Security/ValidatePasswordEventArgs.cs
+
2005-05-26 Lluis Sanchez Gual <lluis@novell.com>
* System.Web.dll.sources: Added new files:
+2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Directive.cs: Register the MasterType directive.
+ * PageCompiler.cs: If a MasterType is specified, add a type specific
+ Master property. All this fixes bug #75192.
+
+2005-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TemplateControlCompiler.cs: when mapping an attribute name to a field
+ or property name, there's no need to try with every property and field,
+ but just the one found when searching by name (no case). There was one
+ call to ProcessPropertiesAndFields per property or field until found,
+ now only one if the property/field is found, none otherwise.
+
+2005-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TemplateControlCompiler.cs: allow more than 2 levels when looking for
+ properties of fields for an attribute like "Prop1-Prop2-Prop3". Fixes
+ bug #75234.
+
2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* BaseCompiler.cs: when the OutputAssembly is null, we can still have
static string [] application_atts = { "description", "inherits", "codebehind" };
+#if NET_2_0
+ static string [] mastertype_atts = { "virtualpath", "typename" };
+#endif
+
static Directive ()
{
InitHash ();
directivesHash.Add ("APPLICATION", valid_attributes);
#if NET_2_0
+ valid_attributes = new Hashtable (provider, comparer);
+ foreach (string att in mastertype_atts) valid_attributes.Add (att, null);
+ directivesHash.Add ("MASTERTYPE", valid_attributes);
+
valid_attributes = new Hashtable (provider, comparer);
foreach (string att in control_atts) valid_attributes.Add (att, null);
directivesHash.Add ("MASTER", valid_attributes);
{
base.CreateMethods ();
+#if NET_2_0
+ if (pageParser.MasterType != null) {
+ CodeMemberProperty mprop = new CodeMemberProperty ();
+ mprop.Name = "Master";
+ mprop.Type = new CodeTypeReference (pageParser.MasterType);
+ mprop.Attributes = MemberAttributes.Public | MemberAttributes.New;
+ CodeExpression prop = new CodePropertyReferenceExpression (new CodeBaseReferenceExpression (), "Master");
+ prop = new CodeCastExpression (pageParser.MasterType, prop);
+ mprop.GetStatements.Add (new CodeMethodReturnStatement (prop));
+ mainClass.Members.Add (mprop);
+ }
+#endif
+
CreateGetTypeHashCode ();
}
}
}
#endif
-
- bool ProcessPropertiesAndFields (ControlBuilder builder, MemberInfo member, string id, string attValue)
+
+ static bool InvariantCompare (string a, string b)
{
- int hyphen = id.IndexOf ('-');
+ return (0 == String.Compare (a, b, false, CultureInfo.InvariantCulture));
+ }
+
+ static bool InvariantCompareNoCase (string a, string b)
+ {
+ return (0 == String.Compare (a, b, true, CultureInfo.InvariantCulture));
+ }
+
+ static MemberInfo GetFieldOrProperty (Type type, string name)
+ {
+ try {
+ return type.GetProperty (name, noCaseFlags);
+ } catch {}
+ try {
+ return type.GetField (name, noCaseFlags);
+ } catch {}
+
+ return null;
+ }
+
+ bool ProcessPropertiesAndFields (ControlBuilder builder, MemberInfo member, string id,
+ string attValue, string prefix)
+ {
+ int hyphen = id.IndexOf ('-');
bool isPropertyInfo = (member is PropertyInfo);
- bool is_processed = false;
bool isDataBound = IsDataBound (attValue);
Type type;
type = ((FieldInfo) member).FieldType;
}
- if (0 == String.Compare (member.Name, id, true)){
+ if (InvariantCompareNoCase (member.Name, id)) {
#if NET_2_0
if (isDataBound) RegisterBindingInfo (builder, member.Name, ref attValue);
#endif
string prop_field = id.Replace ("-", ".");
string [] parts = prop_field.Split (new char [] {'.'});
- if (parts.Length != 2 || 0 != String.Compare (member.Name, parts [0], true))
+ int length = parts.Length;
+ if (length < 2 || !InvariantCompare (member.Name, parts [0]))
return false;
- PropertyInfo [] subprops = type.GetProperties ();
- foreach (PropertyInfo subprop in subprops) {
- if (0 != String.Compare (subprop.Name, parts [1], true))
- continue;
-
- if (subprop.CanWrite == false)
+ if (length > 2) {
+ MemberInfo sub_member = GetFieldOrProperty (type, parts [1]);
+ if (sub_member == null)
return false;
- bool is_bool = subprop.PropertyType == typeof (bool);
- if (!is_bool && attValue == null)
- return false; // Font-Size -> Font-Size="" as html
+ string new_prefix = prefix + parts [0] + ".";
+ string new_id = id.Substring (hyphen + 1);
+ return ProcessPropertiesAndFields (builder, sub_member, new_id, attValue, new_prefix);
+ }
- string value;
- if (attValue == null && is_bool)
- value = "true"; // Font-Bold <=> Font-Bold="true"
- else
- value = attValue;
+ MemberInfo subpf = GetFieldOrProperty (type, parts [1]);
+ if (!(subpf is PropertyInfo))
+ return false;
+
+ PropertyInfo subprop = (PropertyInfo) subpf;
+ if (subprop.CanWrite == false)
+ return false;
+ bool is_bool = (subprop.PropertyType == typeof (bool));
+ if (!is_bool && attValue == null)
+ return false; // Font-Size -> Font-Size="" as html
+
+ string val = attValue;
+ if (attValue == null && is_bool)
+ val = "true"; // Font-Bold <=> Font-Bold="true"
#if NET_2_0
- if (isDataBound) RegisterBindingInfo (builder, member.Name + "." + subprop.Name, ref attValue);
+ if (isDataBound) RegisterBindingInfo (builder, prefix + member.Name + "." + subprop.Name, ref attValue);
#endif
- AddCodeForPropertyOrField (builder, subprop.PropertyType,
- member.Name + "." + subprop.Name,
- value, subprop, isDataBound);
- is_processed = true;
- }
+ AddCodeForPropertyOrField (builder, subprop.PropertyType,
+ prefix + member.Name + "." + subprop.Name,
+ val, subprop, isDataBound);
- return is_processed;
+ return true;
}
void AddEventAssign (CodeMemberMethod method, string name, Type type, string value)
return;
EventInfo [] ev_info = null;
- PropertyInfo [] prop_info = null;
- FieldInfo [] field_info = null;
bool is_processed = false;
Type type = builder.ControlType;
- foreach (string id in atts.Keys){
- if (0 == String.Compare (id, "runat", true))
+ foreach (string id in atts.Keys) {
+ if (InvariantCompareNoCase (id, "runat"))
continue;
is_processed = false;
string id_as_event = id.Substring (2);
foreach (EventInfo ev in ev_info){
- if (0 == String.Compare (ev.Name, id_as_event, true)){
+ if (InvariantCompareNoCase (ev.Name, id_as_event)){
AddEventAssign (builder.method,
ev.Name,
ev.EventHandlerType,
continue;
}
- if (prop_info == null)
- prop_info = type.GetProperties ();
-
- foreach (PropertyInfo prop in prop_info) {
- is_processed = ProcessPropertiesAndFields (builder, prop, id, attvalue);
- if (is_processed)
- break;
- }
-
- if (is_processed)
- continue;
-
- if (field_info == null)
- field_info = type.GetFields ();
-
- foreach (FieldInfo field in field_info){
- is_processed = ProcessPropertiesAndFields (builder, field, id, attvalue);
+ int hyphen = id.IndexOf ('-');
+ string alt_id = id;
+ if (hyphen != -1)
+ alt_id = id.Substring (0, hyphen);
+
+ MemberInfo fop = GetFieldOrProperty (type, alt_id);
+ if (fop != null) {
+ is_processed = ProcessPropertiesAndFields (builder, fop, id, attvalue, null);
if (is_processed)
- break;
+ continue;
}
if (is_processed)
return new CodePrimitiveExpression (str);
if (type == typeof (bool)) {
- if (str == null || str == "" || 0 == String.Compare (str, "true", true))
+ if (str == null || str == "" || InvariantCompareNoCase (str, "true"))
return new CodePrimitiveExpression (true);
- else if (0 == String.Compare (str, "false", true))
+ else if (InvariantCompareNoCase (str, "false"))
return new CodePrimitiveExpression (false);
else
throw new ParseException (currentLocation,
+2005-06-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * GlobalizationConfigurationHandler.cs: when an attribute is not
+ provided, don't assing Encoding.Default to it, as we might override
+ parent's settings.
+
2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* CompilationConfiguration.cs: throw if we cannot load the type given
ThrowException ("No child nodes allowed here.", section);
string attvalue = AttValue ("requestEncoding", section, true);
- if (attvalue == null)
- config.RequestEncoding = Encoding.Default;
- else
+ if (attvalue != null)
config.RequestEncoding = GetEncoding (section, "requestEncoding", attvalue);
attvalue = AttValue ("responseEncoding", section, true);
- if (attvalue == null)
- config.ResponseEncoding = Encoding.Default;
- else
+ if (attvalue != null)
config.ResponseEncoding = GetEncoding (section, "responseEncoding", attvalue);
attvalue = AttValue ("fileEncoding", section, true);
- if (attvalue == null)
- config.FileEncoding = Encoding.Default;
- else
+ if (attvalue != null)
config.FileEncoding = GetEncoding (section, "fileEncoding", attvalue);
attvalue = AttValue ("culture", section, true);
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * IISAPIRuntime.cs: GUID changed.
+
2004-08-03 Atsushi Enomoto <atsushi@ximian.com>
* IApplicationHost.cs : missing namespace import.
namespace System.Web.Hosting
{
- [Guid ("c4918956-485b-3503-bd10-9083e3f6b66c")]
+ //[Guid ("c4918956-485b-3503-bd10-9083e3f6b66c")] -> 1.1 pre service pack
+ [Guid ("08A2C56F-7C16-41C1-A8BE-432917A1A2D1")]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface IISAPIRuntime
{
+++ /dev/null
-//
-// System.Web.Security.AccessMembershipProvider
-//
-// Authors:
-// Ben Maurer (bmaurer@users.sourceforge.net)
-// Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-namespace System.Web.Security {
- public class AccessMembershipProvider : MembershipProvider {
-
- [MonoTODO]
- public override bool ChangePassword (string username, string oldPwd, string newPwd)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool DeleteUser (string username, bool deleteAllRelatedData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual string GeneratePassword ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int GetNumberOfUsersOnline ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string GetPassword (string username, string answer)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override MembershipUser GetUser (string username, bool userIsOnline)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string GetUserNameByEmail (string email)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void Initialize (string name, NameValueCollection config)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ResetPassword (string username, string answer)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void UpdateUser (MembershipUser user)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool ValidateUser (string username, string password)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ApplicationName {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public virtual string Description {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override bool EnablePasswordReset {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override bool EnablePasswordRetrieval {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public virtual MembershipPasswordFormat PasswordFormat {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override bool RequiresQuestionAndAnswer {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public virtual bool RequiresUniqueEmail {
- get { throw new NotImplementedException (); }
- }
- }
-}
-#endif
-
+++ /dev/null
-//
-// System.Web.Security.AccessRoleProvider
-//
-// Authors:
-// Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-namespace System.Web.Security {
- public class AccessRoleProvider: RoleProvider {
-
- [MonoTODO]
- public override void AddUsersToRoles (string [] usernames, string [] rolenames)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void CreateRole (string rolename)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void DeleteRole (string rolename, bool throwOnPopulatedRole)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FindUsersInRole (string roleName, string usernameToMatch)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string [] GetAllRoles ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string [] GetRolesForUser (string username)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string [] GetUsersInRole (string rolename)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void Initialize (string name, NameValueCollection config)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsUserInRole (string username, string rolename)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool RoleExists (string rolename)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ApplicationName {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public virtual string Description {
- get { throw new NotImplementedException (); }
- }
- }
-}
-#endif
-
}
[MonoTODO]
- public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
+ public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public override MembershipUser GetUser (object providerUserKey, bool userIsOnline)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override string GetUserNameByEmail (string email)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public override bool UnlockUser (string userName)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override string ApplicationName {
get { throw new NotImplementedException (); }
}
[MonoTODO]
- public virtual MembershipPasswordFormat PasswordFormat {
+ public override MembershipPasswordFormat PasswordFormat {
get { throw new NotImplementedException (); }
}
}
[MonoTODO]
- public virtual bool RequiresUniqueEmail {
+ public override bool RequiresUniqueEmail {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MaxInvalidPasswordAttempts {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MinRequiredNonAlphanumericCharacters {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MinRequiredPasswordLength {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int PasswordAttemptWindow {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override string PasswordStrengthRegularExpression {
get { throw new NotImplementedException (); }
}
}
+2005-06-10 Lluis Sanchez Gual <lluis@novell.com>
+
+ * MembershipUserCollection.cs:
+ * MembershipPasswordException.cs:
+ * RoleProviderCollection.cs:
+ * ActiveDirectoryMembershipProvider.cs:
+ * SqlMembershipProvider.cs:
+ * MembershipProvider.cs:
+ * SqlRoleProvider.cs:
+ * Membership.cs:
+ * MembershipUser.cs:
+ * MembershipProviderCollection.cs:
+ * Roles.cs:.
+ * RoleProvider.cs: Track api changes in ASP.NET 2.0. Implemented
+ some missing methods.
+
+ * AccessRoleProvider.cs:
+ * AccessMembershipProvider.cs: Removed.
+
+ * MembershipCreateUserException.cs:
+ * MembershipValidatePasswordEventHandler.cs:
+ * ValidatePasswordEventArgs.cs: Implemented.
+
2005-05-21 Sebastien Pouliot <sebastien@ximian.com>
* FormsAuthentication.cs: Hash the UTF8 representation of the password
* MembershipCreateStatus.cs:
* CookieProtection.cs: minor modifications.
-2004-06-12 Pedro MartÃnez Juliá <yoros@wanadoo.es>
+2004-06-12 Pedro Martnez Juli <yoros@wanadoo.es>
* FormsAuthentication.cs: Undo last change.
-2004-06-12 Pedro MartÃnez Juliá <yoros@wanadoo.es>
+2004-06-12 Pedro Martnez Juli <yoros@wanadoo.es>
* FormsAuthentication.cs: go to loginUrl from web.config settings
before try with the default ones.
//
// Authors:
// Ben Maurer (bmaurer@users.sourceforge.net)
+// Lluis Sanchez Gual (lluis@novell.com)
//
// (C) 2003 Ben Maurer
+// (C) 2005 Novell, inc.
//
//
using System.Collections.Specialized;
using System.Text;
-namespace System.Web.Security {
- public sealed class Membership {
-
- private Membership () {}
+namespace System.Web.Security
+{
+ public abstract class Membership
+ {
+ private Membership ()
+ {
+ }
public static MembershipUser CreateUser (string username, string password)
{
public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
{
- return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, out status);
+ return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, null, out status);
+ }
+
+ public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
+ {
+ return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, providerUserKey, out status);
}
public static bool DeleteUser (string username)
}
[MonoTODO]
- public static string GeneratePassword (int length)
+ public static string GeneratePassword (int length, int numberOfNonAlphanumericCharacters)
{
throw new NotImplementedException ();
}
return Provider.GetUser (username, userIsOnline);
}
+ public static MembershipUser GetUser (object providerUserKey)
+ {
+ return GetUser (providerUserKey, false);
+ }
+
+ public static MembershipUser GetUser (object providerUserKey, bool userIsOnline)
+ {
+ return Provider.GetUser (providerUserKey, userIsOnline);
+ }
+
public static string GetUserNameByEmail (string email)
{
return Provider.GetUserNameByEmail (email);
return Provider.ValidateUser (username, password);
}
+ public static MembershipUserCollection FindUsersByEmail (string emailToMatch)
+ {
+ int totalRecords;
+ return Provider.FindUsersByEmail (emailToMatch, 0, int.MaxValue, out totalRecords);
+ }
+
+ public static MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
+ {
+ return Provider.FindUsersByEmail (emailToMatch, pageIndex, pageSize, out totalRecords);
+ }
+
+ public static MembershipUserCollection FindUsersByName (string nameToMatch)
+ {
+ int totalRecords;
+ return Provider.FindUsersByName (nameToMatch, 0, int.MaxValue, out totalRecords);
+ }
+
+ public static MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ {
+ return Provider.FindUsersByName (nameToMatch, pageIndex, pageSize, out totalRecords);
+ }
+
+
+
public static string ApplicationName {
get { return Provider.ApplicationName; }
set { Provider.ApplicationName = value; }
get { return Provider.RequiresQuestionAndAnswer; }
}
+ public static int MaxInvalidPasswordAttempts {
+ get { return Provider.MaxInvalidPasswordAttempts; }
+ }
+
+ public static int MinRequiredNonAlphanumericCharacters {
+ get { return Provider.MinRequiredNonAlphanumericCharacters; }
+ }
+
+ public static int MinRequiredPasswordLength {
+ get { return Provider.MinRequiredPasswordLength; }
+ }
+
+ public static int PasswordAttemptWindow {
+ get { return Provider.PasswordAttemptWindow; }
+ }
+
+ public static string PasswordStrengthRegularExpression {
+ get { return Provider.PasswordStrengthRegularExpression; }
+ }
+
[MonoTODO]
public static MembershipProvider Provider {
get { throw new NotImplementedException (); }
public static int UserIsOnlineTimeWindow {
get { throw new NotImplementedException (); }
}
+
+ public event MembershipValidatePasswordEventHandler ValidatingPassword {
+ add { Provider.ValidatingPassword += value; }
+ remove { Provider.ValidatingPassword -= value; }
+ }
}
}
#endif
//
#if NET_2_0
-namespace System.Web.Security {
- [MonoTODO ("make strings for the messages")]
- public class MembershipCreateUserException : HttpException {
+using System;
+using System.Runtime.Serialization;
+
+namespace System.Web.Security
+{
+ [Serializable]
+ public class MembershipCreateUserException : Exception
+ {
+ MembershipCreateStatus statusCode;
+
+ public MembershipCreateUserException ()
+ {
+ }
+
+ public MembershipCreateUserException (string message): base (message)
+ {
+ }
+
+ public MembershipCreateUserException (string message, Exception innerException): base (message, innerException)
+ {
+ }
+
+ public MembershipCreateUserException (SerializationInfo info, StreamingContext context): base (info, context)
+ {
+ info.AddValue ("statusCode", statusCode);
+ }
+
public MembershipCreateUserException (MembershipCreateStatus statusCode) : base (statusCode.ToString ())
{
this.statusCode = statusCode;
}
- MembershipCreateStatus statusCode;
+ public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
+ {
+ base.GetObjectData (info, ctx);
+ statusCode = (MembershipCreateStatus) info.GetValue ("statusCode", typeof(MembershipCreateStatus));
+ }
+
public MembershipCreateStatus StatusCode {
get { return statusCode; }
}
//
#if NET_2_0
-namespace System.Web.Security {
- public class MembershipPasswordException : HttpException {
+
+using System;
+using System.Runtime.Serialization;
+
+namespace System.Web.Security
+{
+ [Serializable]
+ public class MembershipPasswordException : Exception
+ {
public MembershipPasswordException () : base () {}
public MembershipPasswordException (string message) : base (message) {}
public MembershipPasswordException (string message, Exception innerException) : base (message, innerException) {}
+
+ public MembershipPasswordException (SerializationInfo info, StreamingContext context): base (info, context)
+ {
+ }
}
}
#endif
public abstract bool ChangePassword (string name, string oldPwd, string newPwd);
public abstract bool ChangePasswordQuestionAndAnswer (string name, string password, string newPwdQuestion, string newPwdAnswer);
- public abstract MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status);
+ public abstract MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
public abstract bool DeleteUser (string name, bool deleteAllRelatedData);
public abstract MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords);
public abstract MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords);
public abstract int GetNumberOfUsersOnline ();
public abstract string GetPassword (string name, string answer);
public abstract MembershipUser GetUser (string name, bool userIsOnline);
+ public abstract MembershipUser GetUser (object providerUserKey, bool userIsOnline);
public abstract string GetUserNameByEmail (string email);
public abstract string ResetPassword (string name, string answer);
public abstract void UpdateUser (MembershipUser user);
public abstract bool ValidateUser (string name, string password);
+ public abstract bool UnlockUser (string userName);
+
public abstract string ApplicationName { get; set; }
public abstract bool EnablePasswordReset { get; }
public abstract bool EnablePasswordRetrieval { get; }
public abstract bool RequiresQuestionAndAnswer { get; }
+ public abstract int MaxInvalidPasswordAttempts { get; }
+ public abstract int MinRequiredNonAlphanumericCharacters { get; }
+ public abstract int MinRequiredPasswordLength { get; }
+ public abstract int PasswordAttemptWindow { get; }
+ public abstract MembershipPasswordFormat PasswordFormat { get; }
+ public abstract string PasswordStrengthRegularExpression { get; }
+ public abstract bool RequiresUniqueEmail { get; }
+
+ protected virtual void OnValidatingPassword (ValidatePasswordEventArgs args)
+ {
+ if (ValidatingPassword != null)
+ ValidatingPassword (this, args);
+ }
+
+ public event MembershipValidatePasswordEventHandler ValidatingPassword;
}
}
#endif
using System.Configuration.Provider;
namespace System.Web.Security {
- public class MembershipProviderCollection : ProviderCollection {
+ public sealed class MembershipProviderCollection : ProviderCollection
+ {
public override void Add (ProviderBase provider)
{
if (provider is MembershipProvider)
throw new HttpException ();
}
+ public void CopyTo (MembershipProvider[] array, int index)
+ {
+ base.CopyTo (array, index);
+ }
+
public new MembershipProvider this [string name] {
get { return (MembershipProvider) base [name]; }
}
//
#if NET_2_0
-namespace System.Web.Security {
- public class MembershipUser {
+namespace System.Web.Security
+{
+ [Serializable]
+ public class MembershipUser
+ {
+ string providerName;
+ string name;
+ object providerUserKey;
+ string email;
+ string passwordQuestion;
+ string comment;
+ bool isApproved;
+ bool isLockedOut;
+ DateTime creationDate;
+ DateTime lastLoginDate;
+ DateTime lastActivityDate;
+ DateTime lastPasswordChangedDate;
+ DateTime lastLockoutDate;
+
protected MembershipUser ()
{
}
- public MembershipUser (MembershipProvider provider, string name, string email,
- string passwordQuestion, string comment, bool isApproved,
+ public MembershipUser (string providerName, string name, object providerUserKey, string email,
+ string passwordQuestion, string comment, bool isApproved, bool isLockedOut,
DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate,
- DateTime lastPasswordChangedDate)
+ DateTime lastPasswordChangedDate, DateTime lastLockoutDate)
{
- this.provider = provider;
+ this.providerName = providerName;
this.name = name;
+ this.providerUserKey = providerUserKey;
this.email = email;
this.passwordQuestion = passwordQuestion;
this.comment = comment;
this.isApproved = isApproved;
+ this.isLockedOut = isLockedOut;
this.creationDate = creationDate;
this.lastLoginDate = lastLoginDate;
this.lastActivityDate = lastActivityDate;
this.lastPasswordChangedDate = lastPasswordChangedDate;
+ this.lastLockoutDate = lastLockoutDate;
}
public virtual bool ChangePassword (string oldPassword, string newPassword)
{
- bool success = Provider.ChangePassword (Username, oldPassword, newPassword);
+ bool success = Provider.ChangePassword (UserName, oldPassword, newPassword);
if (success)
- LastPasswordChangedDate = DateTime.Now;
+ lastPasswordChangedDate = DateTime.Now;
return success;
}
public virtual bool ChangePasswordQuestionAndAnswer (string password, string newPasswordQuestion, string newPasswordAnswer)
{
- bool success = Provider.ChangePasswordQuestionAndAnswer (Username, password, newPasswordQuestion, newPasswordAnswer);
+ bool success = Provider.ChangePasswordQuestionAndAnswer (UserName, password, newPasswordQuestion, newPasswordAnswer);
if (success)
passwordQuestion = newPasswordQuestion;
public virtual string GetPassword (string answer)
{
- return Provider.GetPassword (Username, answer);
+ return Provider.GetPassword (UserName, answer);
}
public virtual string ResetPassword ()
public virtual string ResetPassword (string answer)
{
- string newPass = Provider.ResetPassword (Username, answer);
+ string newPass = Provider.ResetPassword (UserName, answer);
if (newPass != null)
- LastPasswordChangedDate = DateTime.Now;
+ lastPasswordChangedDate = DateTime.Now;
return newPass;
}
public virtual DateTime CreationDate {
get { return creationDate; }
- set { creationDate = value; }
}
public virtual string Email {
set { isApproved = value; }
}
- [MonoTODO]
+ public virtual bool IsLockedOut {
+ get { return isLockedOut; }
+ }
+
public bool IsOnline {
- get { throw new NotImplementedException (); }
+ get {
+ return LastActivityDate > DateTime.Now - TimeSpan.FromMinutes (Membership.UserIsOnlineTimeWindow);
+ }
}
public virtual DateTime LastActivityDate {
public virtual DateTime LastPasswordChangedDate {
get { return lastPasswordChangedDate; }
- set { lastPasswordChangedDate = value; }
+ }
+
+ public virtual DateTime LastLockoutDate {
+ get { return lastLockoutDate; }
}
public virtual string PasswordQuestion {
get { return passwordQuestion; }
}
- public virtual MembershipProvider Provider {
- get { return provider; }
+ public virtual string ProviderName {
+ get { return providerName; }
}
- public virtual string Username {
+ public virtual string UserName {
get { return name; }
}
- MembershipProvider provider;
- string name;
- string email;
- string passwordQuestion;
- string comment;
- bool isApproved;
- DateTime creationDate;
- DateTime lastLoginDate;
- DateTime lastActivityDate;
- DateTime lastPasswordChangedDate;
+ public virtual object ProviderUserKey {
+ get { return providerUserKey; }
+ }
+
+ public override string ToString ()
+ {
+ return UserName;
+ }
+
+ public virtual bool UnlockUser ()
+ {
+ if (Provider.UnlockUser (UserName)) {
+ isLockedOut = false;
+ return true;
+ }
+ return false;
+ }
+
+ MembershipProvider Provider {
+ get {
+ MembershipProvider p = Membership.Providers [ProviderName];
+ if (p == null) throw new InvalidOperationException ("Membership provider '" + ProviderName + "' not found.");
+ return p;
+ }
+ }
}
}
#endif
#if NET_2_0
using System.Collections;
using System.Web.UI;
+using System;
-namespace System.Web.Security {
- public class MembershipUserCollection : ICloneable, ICollection {
+namespace System.Web.Security
+{
+ [Serializable]
+ public class MembershipUserCollection : ICollection
+ {
public MembershipUserCollection ()
{
}
public void Add (MembershipUser user)
{
CheckNotReadOnly ();
- store.Add (user.Username, user);
+ store.Add (user.UserName, user);
}
public void Clear ()
store.Clear ();
}
- public object Clone ()
+ void ICollection.CopyTo (Array array, int index)
{
- MembershipUserCollection clone = new MembershipUserCollection ();
- foreach (MembershipUser u in this)
- clone.Add (u);
- return clone;
+ store.CopyTo (array, index);
}
- public void CopyTo (Array array, int index)
+ public void CopyTo (MembershipUser[] array, int index)
{
store.CopyTo (array, index);
}
--- /dev/null
+//
+// System.Web.Security.MembershipValidatePasswordEventHandler
+//
+// Authors:
+// Lluis Sanchez Gual (lluis@novell.com)
+//
+// (C) 2005 Novell, inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System.Web.Security
+{
+ public delegate void MembershipValidatePasswordEventHandler (object sender, ValidatePasswordEventArgs e);
+}
+
+#endif
public abstract void AddUsersToRoles (string [] usernames, string [] rolenames);
public abstract void CreateRole (string rolename);
- public abstract void DeleteRole (string rolename, bool throwOnPopulatedRole);
- public abstract void FindUsersInRole (string roleName, string usernameToMatch);
+ public abstract bool DeleteRole (string rolename, bool throwOnPopulatedRole);
+ public abstract string [] FindUsersInRole (string roleName, string usernameToMatch);
public abstract string [] GetAllRoles ();
public abstract string [] GetRolesForUser (string username);
public abstract string [] GetUsersInRole (string rolename);
#if NET_2_0
using System.Configuration.Provider;
-namespace System.Web.Security {
- public class RoleProviderCollection : ProviderCollection {
+namespace System.Web.Security
+{
+ public sealed class RoleProviderCollection : ProviderCollection
+ {
public override void Add (ProviderBase provider)
{
if (provider is RoleProvider)
public new RoleProvider this [string name] {
get { return (RoleProvider) base [name]; }
}
+
+ public void CopyTo (RoleProvider[] array, int index)
+ {
+ base.CopyTo (array, index);
+ }
}
}
#endif
using System.Collections.Specialized;
using System.Text;
-namespace System.Web.Security {
- public sealed class Roles {
-
- [MonoTODO]
+namespace System.Web.Security
+{
+ public sealed class Roles
+ {
public static void AddUsersToRole (string [] usernames, string rolename)
{
- throw new NotImplementedException ();
+ Provider.AddUsersToRoles (usernames, new string[] {rolename});
}
- [MonoTODO]
public static void AddUsersToRoles (string [] usernames, string [] rolenames)
{
- throw new NotImplementedException ();
+ Provider.AddUsersToRoles (usernames, rolenames);
}
- [MonoTODO]
public static void AddUserToRole (string username, string rolename)
{
- throw new NotImplementedException ();
+ Provider.AddUsersToRoles (new string[] {username}, new string[] {rolename});
}
- [MonoTODO]
public static void AddUserToRoles (string username, string [] rolenames)
{
- throw new NotImplementedException ();
+ Provider.AddUsersToRoles (new string[] {username}, rolenames);
}
- [MonoTODO]
public static void CreateRole (string rolename)
{
- throw new NotImplementedException ();
+ Provider.CreateRole (rolename);
}
[MonoTODO]
throw new NotImplementedException ();
}
- [MonoTODO]
- public static void DeleteRole (string rolename)
+ public static bool DeleteRole (string rolename)
{
- throw new NotImplementedException ();
+ return Provider.DeleteRole (rolename, true);
+ }
+
+ public static bool DeleteRole (string rolename, bool throwOnPopulatedRole)
+ {
+ return Provider.DeleteRole (rolename, throwOnPopulatedRole);
}
- [MonoTODO]
public static string [] GetAllRoles ()
{
- throw new NotImplementedException ();
+ return Provider.GetAllRoles ();
}
- [MonoTODO]
public static string [] GetRolesForUser ()
{
- throw new NotImplementedException ();
+ return Provider.GetRolesForUser (CurrentUser);
+ }
+
+ static string CurrentUser {
+ get {
+ if (HttpContext.Current != null && HttpContext.Current.User != null)
+ return HttpContext.Current.User.Identity.Name;
+ else
+ return System.Threading.Thread.CurrentPrincipal.Identity.Name;
+ }
}
- [MonoTODO]
public static string [] GetRolesForUser (string username)
{
- throw new NotImplementedException ();
+ return Provider.GetRolesForUser (username);
}
- [MonoTODO]
public static string [] GetUsersInRole (string rolename)
{
- throw new NotImplementedException ();
+ return Provider.GetUsersInRole (rolename);
}
- [MonoTODO]
public static bool IsUserInRole (string rolename)
{
- throw new NotImplementedException ();
+ return Provider.IsUserInRole (CurrentUser, rolename);
}
- [MonoTODO]
public static bool IsUserInRole (string username, string rolename)
{
- throw new NotImplementedException ();
+ return Provider.IsUserInRole (username, rolename);
}
- [MonoTODO]
public static void RemoveUserFromRole (string username, string rolename)
{
- throw new NotImplementedException ();
+ Provider.RemoveUsersFromRoles (new string[] {username}, new string[] {rolename});
}
- [MonoTODO]
public static void RemoveUserFromRoles (string username, string [] rolenames)
{
- throw new NotImplementedException ();
+ Provider.RemoveUsersFromRoles (new string[] {username}, rolenames);
}
- [MonoTODO]
public static void RemoveUsersFromRole (string [] usernames, string rolename)
{
- throw new NotImplementedException ();
+ Provider.RemoveUsersFromRoles (usernames, new string[] {rolename});
}
- [MonoTODO]
public static void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
{
- throw new NotImplementedException ();
+ Provider.RemoveUsersFromRoles (usernames, rolenames);
}
- [MonoTODO]
public static bool RoleExists (string rolename)
{
- throw new NotImplementedException ();
+ return Provider.RoleExists (rolename);
+ }
+
+ public static string[] FinsUsersInRole (string rolename, string usernameToMatch)
+ {
+ return Provider.FindUsersInRole (rolename, usernameToMatch);
}
- [MonoTODO]
public static string ApplicationName {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return Provider.ApplicationName; }
+ set { Provider.ApplicationName = value; }
}
[MonoTODO]
}
[MonoTODO]
- public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
+ public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public override MembershipUser GetUser (object providerUserKey, bool userIsOnline)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override string GetUserNameByEmail (string email)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public override bool UnlockUser (string userName)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override string ApplicationName {
get { throw new NotImplementedException (); }
}
[MonoTODO]
- public virtual MembershipPasswordFormat PasswordFormat {
+ public override MembershipPasswordFormat PasswordFormat {
get { throw new NotImplementedException (); }
}
}
[MonoTODO]
- public virtual bool RequiresUniqueEmail {
+ public override bool RequiresUniqueEmail {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MaxInvalidPasswordAttempts {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MinRequiredNonAlphanumericCharacters {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int MinRequiredPasswordLength {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override int PasswordAttemptWindow {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override string PasswordStrengthRegularExpression {
get { throw new NotImplementedException (); }
}
}
}
[MonoTODO]
- public override void DeleteRole (string rolename, bool throwOnPopulatedRole)
+ public override bool DeleteRole (string rolename, bool throwOnPopulatedRole)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public override void FindUsersInRole (string roleName, string usernameToMatch)
+ public override string[] FindUsersInRole (string roleName, string usernameToMatch)
{
throw new NotImplementedException ();
}
--- /dev/null
+//
+// System.Web.Security.ValidatePasswordEventArgs
+//
+// Authors:
+// Lluis Sanchez Gual (lluis@novell.com)
+//
+// (C) 2005 Novell, inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+
+namespace System.Web.Security
+{
+ public sealed class ValidatePasswordEventArgs: EventArgs
+ {
+ bool cancel;
+ Exception exception;
+ bool isNewUser;
+ string userName;
+ string password;
+
+ public ValidatePasswordEventArgs (string userName, string password, bool isNewUser)
+ {
+ this.isNewUser = isNewUser;
+ this.userName = userName;
+ this.password = password;
+ }
+
+ public bool Cancel {
+ get { return cancel; }
+ set { cancel = value; }
+ }
+
+ public Exception FailureInformation {
+ get { return exception; }
+ set { exception = value; }
+ }
+
+ public bool IsNewUser {
+ get { return isNewUser; }
+ }
+
+ public string UserName {
+ get { return userName; }
+ }
+
+ public string Password {
+ get { return password; }
+ }
+ }
+}
+
+#endif
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HtmlTableCell.cs:
+ * HtmlControl.cs: updates for 1.1 SP1.
+
2005-05-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HtmlInputFile.cs: fixed typo in the setter for MaxLength. Closes bug
namespace System.Web.UI.HtmlControls{\r
\r
[ToolboxItem(false)]
- [Designer ("System.Web.UI.Design.HtmlIntrinsicControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]\r
+ [Designer ("System.Web.UI.Design.HtmlIntrinsicControlDesigner, " + Consts.AssemblySystem_Design,
+ "System.ComponentModel.Design.IDesigner")]
public abstract class HtmlControl : Control, IAttributeAccessor\r
{\r
internal string _tagName;\r
}\r
}\r
\r
- [DefaultValue("")]\r
+ [DefaultValue(false)]\r
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]\r
[WebCategory("Behavior")]\r
public bool Disabled\r
using System.Globalization;\r
\r
namespace System.Web.UI.HtmlControls{\r
- [ConstructorNeedsTag]\r
+ [ConstructorNeedsTag (true)]\r
public class HtmlTableCell : HtmlContainerControl {\r
public HtmlTableCell(): base("td"){}\r
\r
}
#if NET_2_0
- AdType adType;
-
- [DefaultValueAttribute ("Banner")]
- [WebCategoryAttribute ("Behavior")]
- [WebSysDescriptionAttribute ("Advertisement of specific type is created by specified value")]
- public AdType AdType {
- get { return adType; }
- set { adType = value; }
- }
-
string alternateTextField;
[DefaultValueAttribute ("AlternateText")]
+++ /dev/null
-//
-// System.Web.UI.WebControls.AdType.cs
-//
-// Authors:
-// Sanjay Gupta (gsanjay@novell.com)
-//
-// 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.
-//
-
-#if NET_2_0
-namespace System.Web.UI.WebControls {
- public enum AdType {
- Banner = 0,
- Popup = 1,
- Popunder = 2
- }
-}
-#endif
-
FirstName = 7,
Gender = 8,
HomeCity = 9,
- HomeCountry = 10,
+ HomeCountryRegion = 10,
HomeFax = 11,
HomePhone = 12,
HomeState = 13,
Office = 21,
Pager = 22,
BusinessCity = 23,
- BusinessCountry = 24,
+ BusinessCountryRegion = 24,
BusinessFax = 25,
BusinessPhone = 26,
BusinessState = 27,
{
RequiresDataBinding = false;
PerformSelect ();
- base.DataBind ();
- OnDataBound (EventArgs.Empty);
}
protected virtual void EnsureDataBound ()
+2005-06-10 Lluis Sanchez Gual <lluis@novell.com>
+
+ * AdType.cs:
+ * ImageFieldMode.cs:
+ * DynamicImageParameterMode.cs:
+ * TableViewMode.cs: Removed.
+
+ * SortDirection.cs:
+ * AdRotator.cs:
+ * TableRowSection.cs:
+ * AutoCompleteType.cs:
+ * DayNameFormat.cs: Track changes in 2.0 api.
+
+ * StringArrayConverter.cs: This class is 2.0 only.
+
+2005-06-06 Lluis Sanchez Gual <lluis@novell.com>
+
+ * GridView.cs:
+ * FormView.cs:
+ * DetailsView.cs: Bind the control after creating all child
+ controls.
+ * DataBoundControl.cs: Call OnDataBinding and OnDataBound in
+ the correct methods.
+ * BaseDataBoundControl.cs: Don't call DataBind nor OnDataBound
+ in this class. This is done in DataBoundControl. All this fixes
+ bug #75076.
+
2005-05-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ListItemCollection.cs: Patch from Curtis (eto@shaw.ca) that fixes
protected virtual void PerformDataBinding (IEnumerable data)
{
- OnDataBinding (EventArgs.Empty);
}
protected override void ValidateDataSource (object dataSource)
protected override void PerformSelect ()
{
+ OnDataBinding (EventArgs.Empty);
DataSourceView view = GetData ();
if (view != null)
view.Select (SelectArguments, new DataSourceViewSelectCallback (OnSelect));
void OnSelect (IEnumerable data)
{
PerformDataBinding (data);
+ OnDataBound (EventArgs.Empty);
}
protected virtual DataSourceSelectArguments CreateDataSourceSelectArguments ()
public enum DayNameFormat\r
{\r
Full,\r
- Short,\r
+ Short,
FirstLetter,\r
- FirstTwoLetters\r
+ FirstTwoLetters
+#if NET_2_0\r
+ , Shortest
+#endif\r
}\r
}\r
table.Rows.Add (footerRow);
}
+ if (dataBinding)
+ DataBind (false);
+
return dataSource.DataSourceCount;
}
+++ /dev/null
-//
-// System.Web.UI.WebControls.DynamicImageParameterMode.cs
-//
-// Author: Sanjay Gupta (gsanjay@novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-#if NET_2_0
-namespace System.Web.UI.WebControls {
- public enum DynamicImageParameterMode {
- ImageGenerationStorage = 0,
- QueryString = 1
- }
-}
-#endif
table.Rows.Add (footerRow);
}
+ if (dataBinding)
+ DataBind (false);
+
return dataSource.DataSourceCount;
}
rows = new GridViewRowCollection (list);
keys = new DataKeyArray (keyList);
+ if (dataBinding)
+ DataBind (false);
+
return dataSource.DataSourceCount;
}
+++ /dev/null
-//
-// System.Web.UI.WebControls.ImageFieldMode.cs
-//
-// Author: Sanjay Gupta (gsanjay@novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-#if NET_2_0
-namespace System.Web.UI.WebControls {
- public enum ImageFieldMode {
- ImageData = 0,
- ImageUrl = 1
- }
-}
-#endif
//
#if NET_2_0
-namespace System.Web.UI.WebControls {
- public enum SortDirection {
- Ascending = 1,
- Descending = 2
+namespace System.Web.UI.WebControls
+{
+ public enum SortDirection
+ {
+ Ascending = 0,
+ Descending = 1
}
}
#endif
// 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
+
+#if NET_2_0
\r
using System;\r
using System.Globalization;\r
}\r
}\r
}\r
+
+#endif
-//
+//
// System.Web.UI.WebControls.TableRowSection.cs
//
// Author: Sanjay Gupta (gsanjay@novell.com)
namespace System.Web.UI.WebControls {
[SerializableAttribute]
public enum TableRowSection {
- TableBody = 0,
- TableHeader = 1,
- TableFooter = 2
+ TableHeader = 0,
+ TableBody = 1,
+ TableFooter = 2
}
}
#endif
+++ /dev/null
-//
-// System.Web.UI.WebControls.TableViewMode.cs
-//
-// Author: Sanjay Gupta (gsanjay@novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-#if NET_2_0
-namespace System.Web.UI.WebControls {
- public enum TableViewMode {
- Summary = 0,
- Details = 1
- }
-}
-#endif
+2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
+
+ * MasterPage.cs: Clear the default content of placeholders before
+ adding the page content. Fixes bug #75193.
+
+2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
+
+ * PageParser.cs: Added MasterType property. Get the type from the
+ MasterType directive.
+ * MasterPageParser.cs: Added GetCompiledMasterType method.
+
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * UserControl.cs:
+ * Page.cs:
+ * Control.cs: updates for 1.1 SP1
+
+2005-06-06 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Control.cs: Added new DataBind() overload for 2.0. The old
+ method calls this new overload.
+
2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TemplateParser.cs: ignore empty assembly.Location for in-memory
{
[DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
[ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
- [Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+ [Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner,
"System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
}\r
}\r
\r
- public virtual void DataBind() //DIT\r
- {
- #if NET_2_0
- bool foundDataItem = false;
-
- if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
- object o = DataBinder.GetDataItem (this, out foundDataItem);
- if (foundDataItem)
- Page.PushDataItemContext (o);
- }
-
- try {
- #endif
-
- OnDataBinding (EventArgs.Empty);
- DataBindChildren();
-
+ public virtual void DataBind() //DIT\r
+ {
#if NET_2_0
- } finally {
- if (foundDataItem)
- Page.PopDataItemContext ();
- }
+ DataBind (true);
+ #else
+ OnDataBinding (EventArgs.Empty);
+ DataBindChildren();
#endif
- }
-
+ }
+
#if NET_2_0
protected virtual
#endif
return null;
}
+ protected virtual void DataBind (bool raiseOnDataBinding)
+ {
+ bool foundDataItem = false;
+
+ if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
+ object o = DataBinder.GetDataItem (this, out foundDataItem);
+ if (foundDataItem)
+ Page.PushDataItemContext (o);
+ }
+
+ try {
+
+ if (raiseOnDataBinding)
+ OnDataBinding (EventArgs.Empty);
+ DataBindChildren();
+
+ } finally {
+ if (foundDataItem)
+ Page.PopDataItemContext ();
+ }
+ }
+
+
#endif\r
}\r
}\r
{
foreach (ContentPlaceHolder place in placeholders) {
ITemplate template = templates [place.ID] as ITemplate;
- if (template != null)
+ if (template != null) {
+ place.Controls.Clear ();
template.InstantiateIn (place);
+ }
}
}
}
return (MasterPage) mpp.GetCompiledInstance ();
}
+ public static Type GetCompiledMasterType (string virtualPath, string inputFile, HttpContext context)
+ {
+ MasterPageParser mpp = new MasterPageParser (virtualPath, inputFile, context);
+ return mpp.CompileIntoType ();
+ }
+
internal override Type DefaultBaseType {
get { return typeof (MasterPage); }
}
#endif
[DefaultEvent ("Load"), DesignerCategory ("ASPXCodeBehind")]
[ToolboxItem (false)]
-[Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+[Designer ("Microsoft.VSDesigner.WebForms.WebFormDesigner, " + Consts.AssemblyMicrosoft_VSDesigner, typeof (IRootDesigner))]
public class Page : TemplateControl, IHttpHandler
{
private bool _viewState = true;
#if NET_2_0
string masterPage;
+ Type masterType;
#endif
public PageParser ()
#if NET_2_0
masterPage = GetString (atts, "MasterPageFile", null);
+
+ // Make sure the page exists
+ MasterPageParser.GetCompiledMasterType (masterPage, HttpContext.Current.Request.MapPath (masterPage), HttpContext.Current);
#endif
// Ignored by now
GetString (atts, "EnableViewStateMac", null);
base.ProcessMainAttributes (atts);
}
+#if NET_2_0
+ internal override void AddDirective (string directive, Hashtable atts)
+ {
+ if (String.Compare ("MasterType", directive, true) == 0) {
+ string type = GetString (atts, "TypeName", null);
+ if (type != null) {
+ masterType = LoadType (type);
+ if (masterType == null)
+ ThrowParseException ("Could not load type '" + type + "'.");
+ } else {
+ string path = GetString (atts, "VirtualPath", null);
+ if (path != null)
+ masterType = MasterPageParser.GetCompiledMasterType (path, HttpContext.Current.Request.MapPath (path), HttpContext.Current);
+ else
+ ThrowParseException ("The MasterType directive must have either a TypeName or a VirtualPath attribute.");
+ }
+ AddAssembly (masterType.Assembly, true);
+ }
+ else
+ base.AddDirective (directive, atts);
+ }
+#endif
+
static string SuggestCulture (string culture)
{
string retval = null;
internal string MasterPageFile {
get { return masterPage; }
}
+
+ internal Type MasterType {
+ get { return masterType; }
+ }
#endif
}
}
namespace System.Web.UI {
- [AttributeUsage (AttributeTargets.Assembly)]
+ [AttributeUsage (AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class TagPrefixAttribute : Attribute
{
string namespaceName;
[DefaultEvent ("Load"), DesignerCategory ("ASPXCodeBehind")]
[ToolboxItem (false), ParseChildren (true)]
[Designer ("System.Web.UI.Design.UserControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
- [Designer ("Microsoft.VSDesigner.WebForms.WebFormDesigner, " + Consts.AssemblyMicrosoft_VSDesigner, typeof (IRootDesigner))]
[RootDesignerSerializer ("Microsoft.VSDesigner.WebForms.RootCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design, true)]
public class UserControl : TemplateControl, IAttributeAccessor, IUserControlDesignerAccessor
{
System.Web.Management/WebEventFormatter.cs
System.Web.Profile/ProfileAuthenticationOption.cs
System.Web.Security/ActiveDirectoryMembershipProvider.cs
-System.Web.Security/AccessMembershipProvider.cs
-System.Web.Security/AccessRoleProvider.cs
System.Web.Security/AnonymousIdentificationEventArgs.cs
System.Web.Security/AnonymousIdentificationEventHandler.cs
System.Web.Security/AnonymousIdentificationModule.cs
System.Web.Security/FormsAuthenticationTicket.cs
System.Web.Security/FormsIdentity.cs
System.Web.Security/MembershipProvider.cs
+System.Web.Security/MembershipValidatePasswordEventHandler.cs
System.Web.Security/RoleProvider.cs
System.Web.Security/Membership.cs
System.Web.Security/MembershipCreateStatus.cs
System.Web.Security/SqlMembershipProvider.cs
System.Web.Security/SqlRoleProvider.cs
System.Web.Security/UrlAuthorizationModule.cs
+System.Web.Security/ValidatePasswordEventArgs.cs
System.Web.Security/WindowsAuthenticationEventArgs.cs
System.Web.Security/WindowsAuthenticationEventHandler.cs
System.Web.Security/WindowsAuthenticationModule.cs
System.Web.UI.WebControls/AdCreatedEventArgs.cs
System.Web.UI.WebControls/AdCreatedEventHandler.cs
System.Web.UI.WebControls/AdRotator.cs
-System.Web.UI.WebControls/AdType.cs
System.Web.UI.WebControls/AssociatedControlConverter.cs
System.Web.UI.WebControls/AuthenticateEventArgs.cs
System.Web.UI.WebControls/AuthenticateEventHandler.cs
System.Web.UI.WebControls/DetailsViewUpdateEventArgs.cs
System.Web.UI.WebControls/DetailsViewUpdateEventHandler.cs
System.Web.UI.WebControls/DropDownList.cs
-System.Web.UI.WebControls/DynamicImageParameterMode.cs
System.Web.UI.WebControls/EditCommandColumn.cs
System.Web.UI.WebControls/FirstDayOfWeek.cs
System.Web.UI.WebControls/FontInfo.cs
System.Web.UI.WebControls/ImageAlign.cs
System.Web.UI.WebControls/ImageButton.cs
System.Web.UI.WebControls/ImageField.cs
-System.Web.UI.WebControls/ImageFieldMode.cs
System.Web.UI.WebControls/ImageMap.cs
System.Web.UI.WebControls/ImageMapEventArgs.cs
System.Web.UI.WebControls/ImageMapEventHandler.cs
System.Web.UI.WebControls/TableRowCollection.cs
System.Web.UI.WebControls/TableRowSection.cs
System.Web.UI.WebControls/TableStyle.cs
-System.Web.UI.WebControls/TableViewMode.cs
System.Web.UI.WebControls/TargetConverter.cs
System.Web.UI.WebControls/TemplateColumn.cs
System.Web.UI.WebControls/TemplateField.cs
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpRequest.cs: avoid one intermediate buffer when reading the request
+ body and fail for over limit content length when the content type is
+ not handled as form or multipart data.
+
+2005-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpResponse.cs: fix the check in Close() so that CloseConnection is
+ called even if there has been no final Flush. Fixes bug #75176.
+
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpParseException.cs:
+ * HttpResponse.cs:
+ * HttpApplication.cs: updates for 1.1 service pack.
+
+2005-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpUtility.cs: fix InvalidCastException.
+
2005-06-05 Kornél Pál <kornelpal@hotmail.com>
* HttpWriter.cs: Fixed: _OutputFilter.Close () was called twice.
namespace System.Web
{
- [ToolboxItem(true)]
+ [ToolboxItem(false)]
public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable
{
#if NET_2_0\r
[Serializable]\r
#endif\r
- public class HttpParseException : HttpException {\r
+ public sealed class HttpParseException : HttpException {\r
\r
int line;\r
string virtualPath;\r
}\r
#endif\r
\r
- [MonoTODO]\r
public string FileName {\r
get { return virtualPath; }\r
}\r
_oFormData = new HttpValueCollection (data, true, enc);
return;
}
+
if (!ContentType.StartsWith ("multipart/form-data")) {
if (contentType.Length > 0)
Console.WriteLine ("Content-Type -> {0} not supported", contentType);
+
+ GetRawContent (); // at least, read the data and check length validity
_oFormData = new HttpValueCollection ();
return;
}
int length = ContentLength;
HttpRuntimeConfig cfg = (HttpRuntimeConfig) _oContext.GetConfig ("system.web/httpRuntime");
int maxRequestLength = cfg.MaxRequestLength * 1024;
- if (ContentLength > maxRequestLength)
+ if (length > maxRequestLength) {
throw new HttpException (400, "Maximum request length exceeded.");
+ }
if (_WorkerRequest.IsEntireEntityBodyIsPreloaded () || length <= _arrRawContent.Length)
return _arrRawContent;
- byte [] arrBuffer = new byte [Math.Min (16384, length)];
- MemoryStream ms = new MemoryStream (arrBuffer.Length);
- ms.Write (_arrRawContent, 0, _arrRawContent.Length);
+ byte [] result = new byte [length];
+ int offset = _arrRawContent.Length;
+ Buffer.BlockCopy (_arrRawContent, 0, result, 0, offset);
+
int read = 0;
+ byte [] arrBuffer = new byte [Math.Min (16384, length)];
int bufLength = arrBuffer.Length;
- for (int loaded = _arrRawContent.Length; loaded < length; loaded += read) {
- if (length - loaded < bufLength)
- bufLength = length - loaded;
+ for (; offset < length; offset += read) {
+ if (length - offset < bufLength)
+ bufLength = length - offset;
read = _WorkerRequest.ReadEntityBody (arrBuffer, bufLength);
if (read == 0 ||read == -1 )
break;
- if (ContentLength > maxRequestLength || ms.Length + read > maxRequestLength)
+ if (length > maxRequestLength || offset + read > maxRequestLength)
throw new HttpException (400, "Maximum request length exceeded.");
- ms.Write (arrBuffer, 0, read);
+ Buffer.BlockCopy (arrBuffer, 0, result, offset, read);
}
- byte [] msBuffer = ms.GetBuffer ();
- if (msBuffer.Length == length)
- _arrRawContent = msBuffer;
- else
- _arrRawContent = ms.ToArray ();
+ if (offset < length)
+ throw new HttpException (400, "Data length is shorter than Content-Length.");
+ _arrRawContent = result;
if (userFilter != null) {
requestFilter.Set (_arrRawContent, 0, _arrRawContent.Length);
int userLength = Convert.ToInt32 (userFilter.Length - userFilter.Position);
public void Close ()
{
- if (closed && !_bClientDisconnected) {
+ if (!closed && !_bClientDisconnected) {
_WorkerRequest.CloseConnection ();
_bClientDisconnected = true;
+ closed = true;
}
}
Cookies.Add (cookie);
}
+#if NET_1_1
+ // LAMESPEC: added in a service pack for 1.1 and available in 2.0 beta
+ [MonoTODO]
+ public void TransmitFile (string filename)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
private void WriteFromStream (Stream stream, long offset, long length, long bufsize)
{
if (offset < 0 || length <= 0)
if (c == ';') {
string key = entity.ToString ();
if (key.Length > 1 && Entities.ContainsKey (key.Substring (1, key.Length - 2)))
- key = (string) Entities [key.Substring (1, key.Length - 2)];
+ key = Entities [key.Substring (1, key.Length - 2)].ToString ();
output.Append (key);
state = 0;
+2005-06-06 Atsushi Enomoto <atsushi@ximian.com>
+
+ * HtmlEmitter.cs : Boolean attribute values should be omitted, but
+ only for related elements.
+
2005-05-07 Atsushi Enomoto <atsushi@ximian.com>
* MSXslScriptManager.cs : it should ignore compiler warnings. This
}
string attribute = localName.ToUpper (CultureInfo.InvariantCulture);
- switch (attribute) {
- case "OPTION":
- case "CHECKED":
- case "SELECTED":
+ string element = ((string) elementNameStack.Peek ()).ToLower (CultureInfo.InvariantCulture);
+
+ if (attribute == "SELECTED" && element == "option"
+ || attribute == "CHECKED" && element == "input")
return;
- }
+
writer.Write ("=\"");
openAttribute = true;
// URI attribute should be escaped.
- string element = ((string) elementNameStack.Peek ()).ToLower (CultureInfo.InvariantCulture);
string attrName = null;
string [] attrNames = null;
switch (element) {
+2005-06-11 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaCollection.cs, XmlSchemaCollectionEnumerator.cs :
+ GetEnumerator() was not in sync with the internal change to
+ XmlSchemaSet. Fixed bug #75126. Patch by Crestez Leonard.
+
+2005-06-07 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaValidationFlags.cs : it is NET_2_0.
+
2005-05-23 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaInference.cs : For each resulting schema, it has to emit
public XmlSchemaCollectionEnumerator GetEnumerator ()
{
- return new XmlSchemaCollectionEnumerator (this);
+ // The actual collection is schemaSet.Schemas()
+ return new XmlSchemaCollectionEnumerator(schemaSet.Schemas());
}
// interface Methods
// Author: Dwivedi, Ajay kumar\r
// Adwiv@Yahoo.com\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
/// </summary>\r
public sealed class XmlSchemaCollectionEnumerator : IEnumerator\r
{\r
- private IDictionaryEnumerator xenum;\r
- IEnumerable tmp;\r
- internal XmlSchemaCollectionEnumerator(XmlSchemaCollection col)\r
+ private IEnumerator xenum;\r
+\r
+ internal XmlSchemaCollectionEnumerator(ICollection col)\r
{\r
- tmp = (IEnumerable) col;\r
- xenum = (IDictionaryEnumerator) tmp.GetEnumerator ();\r
+ xenum = col.GetEnumerator ();\r
}\r
+\r
// Properties\r
public XmlSchema Current { \r
get {\r
- return (XmlSchema) xenum.Value; \r
+ return (XmlSchema) xenum.Current; \r
}\r
}\r
// Methods\r
}\r
object IEnumerator.Current\r
{\r
- get { return xenum.Value; }\r
+ get { return xenum.Current; }\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.
//
+#if NET_2_0
using System;\r
-\r
+
namespace System.Xml.Schema\r
{
[Flags]\r
IgnoreIdentityConstraints = 8
}\r
}\r
+#endif
+2005-06-07 Lluis Sanchez Gual <lluis@novell.com>
+
+ * SerializationCodeGenerator.cs: When reading members by order,
+ call a MoveToContext after each member read. In the fixup method
+ don't cast returned values if it is reading an object array.
+
+ * XmlSchemaImporter.cs: In ImportDerivedTypeMapping, if the type
+ being imported is a primitive type, create a wrapper class that
+ inherits from the provided one. This fixes bug #68809.
+
+ * XmlSerializationReader.cs: Properly report unreferenced objects.
+ Created an overload of ReadTypedPrimitive that reports elements of
+ unknown type. Implemented Referenced().
+
2005-05-30 Lluis Sanchez Gual <lluis@novell.com>
* XmlReflectionImporter.cs: Don't ignore type namespaces explicitely
if (_typeMap is XmlTypeMapping)
{
XmlTypeMapping typeMap = (XmlTypeMapping) _typeMap;
-// Console.WriteLine ("> " + typeMap.TypeName);
if (_format == SerializationFormat.Literal)
{
if (typeMap.TypeData.SchemaType == SchemaTypes.XmlNode)
throw new Exception ("Not supported for XmlNode types");
-// Console.WriteLine ("This should be string:" + typeMap.ElementName.GetType());
WriteLineInd ("if (Reader.LocalName != " + GetLiteral (typeMap.ElementName) + " || Reader.NamespaceURI != " + GetLiteral (typeMap.Namespace) + ")");
WriteLine ("throw CreateUnknownNodeException();");
Unindent ();
if (!readByOrder)
WriteLineUni ("}");
+ else
+ WriteLine ("Reader.MoveToContent();");
first = false;
}
foreach (XmlTypeMapMember member in members)
{
WriteLineInd ("if (ids[" + member.Index + "] != null)");
- GenerateSetMemberValue (member, "source", GetCast (member.TypeData, "GetTarget(ids[" + member.Index + "])"), isList);
+ string val = "GetTarget(ids[" + member.Index + "])";
+ if (!isList) val = GetCast (member.TypeData, val);
+ GenerateSetMemberValue (member, "source", val, isList);
Unindent ();
}
}
}\r
else\r
{\r
- if (!LocateElement (name, out qname, out stype) || stype == null)
- return null;\r
+ if (!LocateElement (name, out qname, out stype))
+ return null;
}\r
- \r
+\r
XmlTypeMapping map = GetRegisteredTypeMapping (qname);\r
if (map != null)\r
{\r
return map;\r
}\r
\r
- map = CreateTypeMapping (qname, SchemaTypes.Class, name);\r
- map.Documentation = GetDocumentation (stype);\r
- RegisterMapFixup (map, qname, (XmlSchemaComplexType)stype);\r
+ map = CreateTypeMapping (qname, SchemaTypes.Class, name);
+ if (stype != null) {\r
+ map.Documentation = GetDocumentation (stype);
+ RegisterMapFixup (map, qname, (XmlSchemaComplexType)stype);
+ } else {
+ ClassMap cmap = new ClassMap ();
+ CodeIdentifiers classIds = new CodeIdentifiers ();
+ map.ObjectMap = cmap;
+ AddTextMember (qname, cmap, classIds);\r
+ }\r
\r
BuildPendingMaps ();\r
SetMapBaseType (map, baseType);\r
Hashtable delayedListFixups;
XmlSerializer eventSource;
int delayedFixupId = 0;
+ Hashtable referencedObjects;
string w3SchemaNS;
string w3InstanceNS;
protected object GetTarget (string id)
{
if (targets == null) return null;
- return targets [id];
+ object ob = targets [id];
+ if (ob != null) {
+ if (referencedObjects == null) referencedObjects = new Hashtable ();
+ referencedObjects [ob] = ob;
+ }
+ return ob;
}
bool TargetReady (string id)
{
WriteCallbackInfo info = GetCallbackInfo (qname);
if (info == null)
- ob = ReadTypedPrimitive (qname);
+ ob = ReadTypedPrimitive (qname, id != null);
else
ob = info.Callback();
}
AddTarget (id, ob);
return ob;
}
-
+
bool ReadList (out object resultList)
{
string arrayTypeAttr = Reader.GetAttribute (arrayType, soapNS);
foreach (Fixup fixup in fixups)
fixup.Callback (fixup);
}
+
+ if (targets != null) {
+ foreach (DictionaryEntry e in targets) {
+ if (e.Value != null && (referencedObjects == null || !referencedObjects.Contains (e.Value)))
+ UnreferencedObject ((string)e.Key, e.Value);
+ }
+ }
}
protected object ReadReferencingElement (out string fixupReference)
{
WriteCallbackInfo info = GetCallbackInfo (qname);
if (info == null)
- return ReadTypedPrimitive (qname);
+ return ReadTypedPrimitive (qname, true);
else
return info.Callback();
}
}
protected object ReadTypedPrimitive (XmlQualifiedName qname)
+ {
+ return ReadTypedPrimitive (qname, false);
+ }
+
+ object ReadTypedPrimitive (XmlQualifiedName qname, bool reportUnknown)
{
if (qname == null) qname = GetXsiType ();
+
TypeData typeData = TypeTranslator.FindPrimitiveTypeData (qname.Name);
if (typeData == null || typeData.SchemaType != SchemaTypes.Primitive)
{
// Put everything into a node array
XmlNode node = Document.ReadNode (reader);
+
+ if (reportUnknown)
+ OnUnknownNode (node, null);
if (node.ChildNodes.Count == 0 && node.Attributes.Count == 0)
return new Object ();
return doc;
}
- [MonoTODO ("Implement")]
protected void Referenced (object o)
{
+ if (o != null) {
+ if (referencedObjects == null) referencedObjects = new Hashtable ();
+ referencedObjects [o] = o;
+ }
}
protected Array ShrinkArray (Array a, int length, Type elementType, bool isNullable)
}
protected void UnknownNode (object o)
+ {
+ OnUnknownNode (ReadXmlNode (false), o);
+ }
+
+ void OnUnknownNode (XmlNode node, object o)
{
int line_number, line_position;
line_position = 0;
}
- if (eventSource != null)
- eventSource.OnUnknownNode (new XmlNodeEventArgs(line_number, line_position, Reader.LocalName, Reader.Name, Reader.NamespaceURI, Reader.NodeType, o, Reader.Value));
-
- if (Reader.NodeType == XmlNodeType.Attribute)
+ if (node is XmlAttribute)
{
- XmlAttribute att = (XmlAttribute) ReadXmlNode (false);
- UnknownAttribute (o, att);
+ UnknownAttribute (o, (XmlAttribute)node);
return;
}
- else if (Reader.NodeType == XmlNodeType.Element)
+ else if (node is XmlElement)
{
- XmlElement elem = (XmlElement) ReadXmlNode (false);
- UnknownElement (o, elem);
+ UnknownElement (o, (XmlElement) node);
return;
}
else
{
- Reader.Skip();
+ if (eventSource != null)
+ eventSource.OnUnknownNode (new XmlNodeEventArgs(line_number, line_position, node.LocalName, node.Name, node.NamespaceURI, node.NodeType, o, node.Value));
+
if (Reader.ReadState == ReadState.EndOfFile)
throw new InvalidOperationException ("End of document found");
}
+2005-06-09 Andrew Skiba <andrews@mainsoft.com>
+
+ * XmlDefaultContext.cs : add TARGET_JVM for roundtrip bug
+
+2004-06-07 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Expression.cs : set TARGET_JVM where collation matters.
+
2004-05-05 Atsushi Enomoto <atsushi@ximian.com>
* XPathAtomicValue.cs :
//
using System;
using System.Collections;
-using System.Globalization;\r
+using System.Globalization;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
// Return string in roundtrip format (currently it
// rather breaks things, so we don't use it until
// System.Double gets fixed.)
-// return ((double) d).ToString ("R", System.Globalization.NumberFormatInfo.InvariantInfo);
+#if TARGET_JVM
+ return d.ToString ("R", System.Globalization.NumberFormatInfo.InvariantInfo);
+#else
return ((double) d).ToString (System.Globalization.NumberFormatInfo.InvariantInfo);
+#endif
}
public static double ToNumber (object arg)
public XPathTextComparer (XmlSortOrder orderSort, XmlCaseOrder orderCase, string strLang)
{
_orderCase = orderCase;
+ // FIXME: We have to set this in
+ // reverse order since currently
+ // we don't support collation.
+#if TARGET_JVM
+ _nMulCase = (orderCase == XmlCaseOrder.UpperFirst) ? -1 : 1;
+#else
_nMulCase = (orderCase == XmlCaseOrder.UpperFirst) ? 1 : -1;
-
+#endif
_nMulSort = (orderSort == XmlSortOrder.Ascending) ? 1 : -1;
if (strLang == null || strLang == "")
+2005-06-09 Andrew Skiba <andrews@mainsoft.com>
+
+ * XmlConvert.cs : add TARGET_JVM for roundtrip bug
+
+2005-06-06 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlEntityReference.cs, XmlNode.cs : protected api fix.
+
2005-06-02 Atsushi Enomoto <atsushi@ximian.com>
* XmlEntityReference.cs, XmlNode.cs : For entity references, BaseURI
if (Double.IsNegativeInfinity(value)) return "-INF";
if (Double.IsPositiveInfinity(value)) return "INF";
if (Double.IsNaN(value)) return "NaN";
+#if TARGET_JVM
+ return value.ToString("R", NumberFormatInfo.InvariantInfo);
+#else
return value.ToString(CultureInfo.InvariantCulture);
+#endif
}
public static string ToString(float value)
if (Single.IsNegativeInfinity(value)) return "-INF";
if (Single.IsPositiveInfinity(value)) return "INF";
if (Single.IsNaN(value)) return "NaN";
+#if TARGET_JVM
+ return value.ToString("R", NumberFormatInfo.InvariantInfo);
+#else
return value.ToString(CultureInfo.InvariantCulture);
+#endif
}
[CLSCompliant (false)]
}
}
- protected override string ChildrenBaseURI {
+ internal override string ChildrenBaseURI {
get {
XmlEntity ent = Entity;
if (ent == null)
}
}
- protected virtual string ChildrenBaseURI {
+ internal virtual string ChildrenBaseURI {
get {
return BaseURI;
}
+2005-06-11 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaCollectionTests.cs : added test for #75126.
+
2005-02-28 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaTests.cs : just set NotWorking for trivial comparison tests.
col.Add (schema);\r
Assert (schema.IsCompiled);\r
}\r
+
+ [Test] // bug #75126
+ public void TestGetEnumerator ()
+ {
+ new XmlSchemaCollection().GetEnumerator();
+ }
}
}
+2005-06-06 Andrew Skiba <andrews@mainsoft.com>
+
+ * xslttest.cs : change messages
+
+2005-06-06 Andrew Skiba <andrews@mainsoft.com>
+
+ * xslttest.cs : make the input and output files look similar to System.Xml/W3C suite
+ * Makefile : reflect the change in the CLI of the xslttest.cs
+
2005-05-23 Andrew Skiba <andrews@mainsoft.com>
* xslttest.cs : wrap streams with using {...} so the file descriptors
FIXED_CATALOG = testsuite/TESTS/catalog-fixed.xml
TEST_EXE = xslttest.exe
-TEST_FLAGS = --report:TestResult.xml --xml --details --outall $(TEST_DOM)
+TEST_FLAGS = --report:TestResult.xml --xml --details $(TEST_DOM)
ifdef TEST_DOM
REFERENCE_RESULTS_NAME = domresults
-
-attribset_attribset15
-attribset_attribset42
-attribset_attribset45
-
-copy_copy27
-
-expression_expression02
-
-idkey_idkey08
-idkey_idkey18
-idkey_idkey43
-idkey_idkey49
-idkey_idkey50
-idkey_idkey57
-
-impincl_impincl08
-
-match_match14
-match_match19
-match_match22
-match_match26
-
-mdocs_mdocs01
-mdocs_mdocs02
-mdocs_mdocs03
-mdocs_mdocs04
-mdocs_mdocs05
-mdocs_mdocs06
-mdocs_mdocs07
-mdocs_mdocs08
-mdocs_mdocs09
-mdocs_mdocs10
-mdocs_mdocs11
-mdocs_mdocs12
-mdocs_mdocs13
-mdocs_mdocs14
-mdocs_mdocs15
-mdocs_mdocs16
-mdocs_mdocs17
-mdocs_mdocs18
-
-namespace_namespace20
-
-Output__84432
-Output__84433
-
-output_output03
-output_output06
-output_output08
-output_output28
-output_output29
-output_output30
-output_output41
-output_output42
-output_output43
-output_output46
-output_output61
-output_output62
-output_output74
-output_output75
-output_output81
-output_output87
-output_output88
-output_output91
-output_output92
-output_output93
-output_output94
-output_output95
-output_output96
-output_output97
-output_output98
-output_output101
-output_output102
-output_output103
-output_output104
-output_output105
-output_output106
-output_output107
-
-reluri_reluri09
-reluri_reluri10
-reluri_reluri11
-
-select_select67
-select_select68
-
-variable_variable24
-
-whitespace_whitespace35
-
-Text__78273
-Text__78274
-Text__78275
-Text__78276
-Text__78281
-Text__78308
-Text__78311
-Text_modified78308
-Text_modified78309
-Text_modified78311
-Text_DoeWithCdataInText
-
-XSLTFunctions__84049
-XSLTFunctions__84050
-XSLTFunctions_Bug76054
-XSLTFunctions_Bug76984
-XSLTFunctions_BooleanFunction
-XSLTFunctions_DocumentFuncWithEmptyArg
-XSLTFunctions_DocumentInUnion
-XSLTFunctions_DocumentInUnionWithDuplicateNodes
-XSLTFunctions_DocumentFunctionNoArg
-XSLTFunctions_ElementAvailFunctionTrueTest
-XSLTFunctions_specialCharInPattern
-
-Keys_PerfRepro2
Keys_PerfRepro3
+Number_ValueAsNodesetTest1
--- /dev/null
+mdocs_mdocs02
+output_output72
+reluri_reluri11
+ver_ver01
+ver_ver05
+ver_ver06
+ver_ver07
+Attributes__81543
+Attributes__81551
+BVTs_bvt023
+BVTs_bvt034
+Fallback__91818
+Fallback__91819
+Fallback__91820
+Fallback__91821
+Fallback__91823
+Fallback__91824
+ForwardComp__91842
+ForwardComp__91843
+ForwardComp__91845
+ForwardComp__91846
+ForwardComp__91849
+ForwardComp__91853
+Keys__91836
+Keys__91859
+Namespace-alias__91782
+Number__84715
+Output__77931
+Variables_UseDocumentFnToReturnRootNode
+XSLTFunctions_DocumentFunctionWithAbsoluteArgument
+XSLTFunctions_DocumentFunctionWithEntityRef
+XSLTFunctions_DocumentFunctionWithNonExistingFilename
+attribset_attribset17
+attribset_attribset18
+attribset_attribset41
+attribset_attribset42
+axes_axes88
+axes_axes108
+axes_axes109
+axes_axes110
+axes_axes111
+axes_axes112
+axes_axes120
+conflictres_conflictres34
+copy_copy09
+copy_copy27
+copy_copy44
+copy_copy46
+copy_copy47
+copy_copy48
+copy_copy51
+copy_copy55
+idkey_idkey18
+idkey_idkey49
+idkey_idkey50
+idkey_idkey57
+lre_lre02
+lre_lre03
+lre_lre04
+lre_lre15
+lre_lre17
+lre_lre18
+lre_lre20
+lre_lre21
+match_match19
+match_match22
+match_match26
+mdocs_mdocs01
+mdocs_mdocs03
+mdocs_mdocs04
+mdocs_mdocs05
+mdocs_mdocs06
+mdocs_mdocs07
+mdocs_mdocs08
+mdocs_mdocs09
+mdocs_mdocs10
+mdocs_mdocs11
+mdocs_mdocs14
+mdocs_mdocs15
+mdocs_mdocs17
+mdocs_mdocs18
+namespace_namespace06
+namespace_namespace07
+namespace_namespace09
+namespace_namespace10
+namespace_namespace12
+namespace_namespace17
+namespace_namespace19
+namespace_namespace20
+namespace_namespace21
+namespace_namespace24
+namespace_namespace26
+namespace_namespace27
+namespace_namespace35
+namespace_namespace39
+namespace_namespace44
+namespace_namespace45
+namespace_namespace46
+namespace_namespace55
+namespace_namespace67
+namespace_namespace69
+namespace_namespace75
+namespace_namespace77
+namespace_namespace75
+namespace_namespace80
+namespace_namespace90
+namespace_namespace93
+namespace_namespace94
+namespace_namespace95
+namespace_namespace96
+namespace_namespace98
+namespace_namespace101
+namespace_namespace102
+namespace_namespace103
+namespace_namespace104
+namespace_namespace107
+namespace_namespace108
+namespace_namespace109
+namespace_namespace110
+namespace_namespace120
+namespace_namespace121
+namespace_namespace122
+namespace_namespace123
+namespace_namespace124
+namespace_namespace128
+namespace_namespace130
+namespace_namespace134
+namespace_namespace139
+namespace_namespace140
+node_node04
+node_node05
+node_node06
+numberformat_numberformat04
+numberformat_numberformat07
+numberformat_numberformat17
+numberformat_numberformat28
+numberformat_numberformat31
+numberformat_numberformat34
+numberformat_numberformat37
+numberformat_numberformat38
+numberformat_numberformat39
+numbering_numbering10
+numbering_numbering17
+numbering_numbering79
+numbering_numbering85
+output_output01
+output_output02
+output_output03
+output_output09
+output_output35
+output_output38
+output_output40
+output_output49
+output_output52
+output_output58
+output_output63
+output_output73
+output_output74
+output_output82
+reluri_reluri09
+reluri_reluri10
+select_select67
+select_select68
+select_select74
+sort_sort27
+sort_sort28
+string_string30
+string_string130
+variable_variable24
+variable_variable51
+whitespace_whitespace09
+whitespace_whitespace13
+whitespace_whitespace35
+Attributes__78367
+Attributes__78368
+Attributes__78373
+Attributes__78382
+Attributes__78386
+Attributes_xsl_attribute_dup_attr_with_namespace_conflict
+AttributeSets__91081
+AttributeSets__91083
+AttributeSets__91098
+AVTs__77531
+AVTs__77564
+AVTs__77599
+BVTs_bvt002
+BVTs_bvt005
+BVTs_bvt008
+BVTs_bvt012
+BVTs_bvt013
+BVTs_bvt017
+BVTs_bvt018
+BVTs_bvt019
+BVTs_bvt027
+BVTs_bvt029
+BVTs_bvt038
+BVTs_bvt047
+BVTs_bvt054
+BVTs_bvt055
+BVTs_bvt057
+BVTs_bvt058
+BVTs_bvt062
+BVTs_bvt063
+BVTs_bvt064
+BVTs_bvt067
+BVTs_bvt075
+BVTs_bvt081
+BVTs_bvt085
+BVTs_bvt086
+BVTs_bvt095
+BVTs_bvt098
+BVTs_bvt099
+Completeness__84358
+ConflictResolution__77619
+ConflictResolution__77621
+ConflictResolution__77622
+ConflictResolution__77781
+ConflictResolution__77782
+ConflictResolution__77783
+ConflictResolution__77802
+ConflictResolution__77833
+ConflictResolution__77847
+ConflictResolution__77870
+ConflictResolution__77871
+ConflictResolution__84476
+Copying__84388
+Copying__84389
+Copying_UseXmlnsWithEmptyStringAsDefaultNs
+Elements__78318
+Elements__78319
+Elements__78362
+Elements__78364
+Elements__83968
+Elements__89067
+Elements__89175
+Elements__89203
+Elements__89283
+Elements__89714
+Fallback__91817
+FormatNumber_DecimalFormatZeroDigit
+FormatNumber_DecimalFormatZeroDigit1
+FormatNumber_DecimalFormatZeroDigit2
+FormatNumber_TestGrpSepr
+Keys__91690
+Keys__91726
+Keys__91727
+Keys__91730
+Keys__91732
+Keys__91832
+Keys__91833
+Keys__91834
+Keys__91835
+Keys_PerfRepro2
+Miscellaneous__83599
+Miscellaneous__83600
+Miscellaneous__83601
+Miscellaneous__83602
+Miscellaneous__83609
+Miscellaneous__84002
+Miscellaneous__84039
+Miscellaneous__84230
+Miscellaneous__84237
+Miscellaneous__84238
+Miscellaneous__84239
+Miscellaneous__84240
+Miscellaneous__84362
+Miscellaneous__84435
+Miscellaneous__91178
+NamedTemplates__84037
+NamedTemplates__84043
+Namespace__77655
+Namespace__77701
+Namespace__77703
+Namespace__77704
+Namespace__84474
+Namespace_CheckXmlnsResetOnResultTree
+Namespace_Bug85356
+Namespace_XPath_Conflict_XPath_XSLT
+Namespace_XPath_CopyNamespaceNodeToOutput
+Namespace_XPath_DefaultNamespace
+Namespace_XPath_NavigatorMethods
+Namespace_XPath_PredefinedPrefix_XML
+Namespace_XPath_PredefinedPrefix_XMLNS
+Namespace_XPath_SameQuery_DiffNamespace
+Namespace_XPath_ScopingRules
+Namespace-alias__91781
+Namespace-alias__91784
+Namespace-alias__91785
+Namespace-alias__91786
+Namespace-alias__91788
+Namespace-alias__91789
+Namespace-alias__91792
+Namespace-alias__91793
+Namespace-alias__91795
+Namespace-alias__91796
+Namespace-alias__91797
+Namespace-alias__91798
+Namespace-alias__91799
+Namespace-alias__91800
+Namespace-alias__91801
+Namespace-alias_Namespace-Alias_NSAliasForDefaultWithExcludeResPref
+Namespace-alias_Namespace-Alias_RenameAliasIfClauseForResultDocument
+Namespace-alias_Namespace-Alias_Test1
+Namespace-alias_Namespace-Alias_Test2
+Namespace-alias_Namespace-Alias_WithinRTF
+Namespace-alias_NSAlias_Inside_CallTemplate
+Number__10052
+Number__10053
+Number__84692
+Number__84699
+Number__84724
+Number__91022
+Number__91026
+Number__91027
+Number__91028
+Number__91029
+Number_NaNOrInvalidValue
+Number_ValueAsEmptyNodeset
+Output__77929
+Output__77957
+Output__77959
+Output__84008
+Output__84009
+Output__84012
+Output__84014
+Output__84016
+Output__84017
+Output__84018
+Output__84143
+Output__84144
+Output__84145
+Output__84146
+Output__84147
+Output__84148
+Output__84149
+Output__84150
+Output__84151
+Output__84152
+Output__84153
+Output__84154
+Output__84155
+Output__84156
+Output__84160
+Output__84161
+Output__84162
+Output__84163
+Output__84164
+Output__84165
+Output__84259
+Output__84260
+Output__84261
+Output__84262
+Output__84263
+Output__84264
+Output__84265
+Output__84266
+Output__84267
+Output__84268
+Output__84269
+Output__84270
+Output__84271
+Output__84272
+Output__84273
+Output__84274
+Output__84275
+Output__84276
+Output__84277
+Output__84278
+Output__84279
+Output__84280
+Output__84281
+Output__84282
+Output__84283
+Output__84284
+Output__84285
+Output__84286
+Output__84287
+Output__84288
+Output__84289
+Output__84290
+Output__84291
+Output__84292
+Output__84293
+Output__84294
+Output__84295
+Output__84296
+Output__84304
+Output__84305
+Output__84306
+Output__84309
+Output__84374
+Output__84452
+Output__84453
+Output__84454
+Output__84455
+Output__84456
+Output__84457
+Output__84458
+Output__84459
+Output__84460
+Output__84461
+Output__84462
+Output__84619
+Output__84620
+Output__84624
+Output__84625
+Output__84626
+Output_CdataSectionOnHtmlModeShouldBeIgnored
+Output_EntityRefInAttribHtml
+Output_Html_Op_Href_Attr_non_ascii_value
+Output_HtmlOutputWithLessThanInAttribute
+Output_MediaTypeTest
+Output_MethodEqualsHtmlWithoutIndentSet
+ProcessingInstruction__78201
+Sorting__77532
+Sorting__77539
+Sorting__77977
+Sorting__81711
+Sorting__81712
+Sorting__81719
+Sorting__84466
+Sorting__89758
+Sorting__91689
+Sorting__91691
+Sorting__91693
+Sorting__91694
+Sorting__91695
+Sorting__91696
+Sorting__91697
+Sorting__91698
+Sorting__91699
+Sorting__91700
+Sorting__91701
+Sorting__91752
+Sorting__91753
+Sorting_Sort_PositiveNumbersHavePlusSign
+Sorting_Sort_SortTextWithNonTextCharacters
+Sorting_Sort_TextNodesSpanMultipleLines
+Sorting_SortExprWithCurrentInsideForEach
+Sorting_SortExprWithCurrentInsideForEach1
+Sorting_SortExprWithCurrentInApplyTemplates
+Sorting_TurkishISortingTest
+Template_DocumentFNTakesStringParam
+Template_MatchFirstElementBelowDocRootWithExpression
+Text__78242
+Text__78272
+Text__78273
+Text__78274
+Text__78275
+Text__78276
+Text__78281
+Text__91137
+Text_DoeWithCdataInText
+Variables__84636
+Variables__84637
+Variables__84709
+Variables__84712
+Variables_GlobalVarHaveLocalVarDefinedWithin
+Whitespaces__91221
+Whitespaces__91225
+Whitespaces__91421
+Whitespaces__91422
+Whitespaces__91423
+Whitespaces__91424
+Whitespaces__91425
+Whitespaces__91426
+Whitespaces__91427
+Whitespaces__91428
+Whitespaces__91441
+Whitespaces__91442
+Whitespaces__91443
+Whitespaces__91444
+XSLTFunctions__84048
+XSLTFunctions__84049
+XSLTFunctions__84050
+XSLTFunctions__defaultPattern
+XSLTFunctions__EuropeanPattern
+XSLTFunctions__minimalValue
+XSLTFunctions__Non_DigitPattern
+XSLTFunctions__Pattern-separator
+XSLTFunctions__percentPattern
+XSLTFunctions__testOn-0.00
+XSLTFunctions_BooleanFunction
+XSLTFunctions_Document
+XSLTFunctions_DocumentFunctionNoArg
+XSLTFunctions_DocumentInUnion
+XSLTFunctions_DocumentInUnionWithDuplicateNodes
+XSLTFunctions_ElementAvailFunctionTrueTest
+XSLTFunctions_Bug76054
+XSLTFunctions_Bug76984
+XSLTFunctions_DocumentFuncWithEmptyArg
namespace XsltTest
{
- public class XsltTest
+ public class XsltTest: IDisposable
{
- #region static Vars
- static bool noExclude;
- static bool reportDetails;
- static bool reportAsXml;
- static bool useDomStyle;
- static bool useDomInstance;
- static bool generateOutput;
- static string outputDir;
- static bool whitespaceStyle;
- static bool whitespaceInstance;
- static bool stopImmediately;
- static bool outputAll;
- static readonly ArrayList skipTargets;
- static readonly ArrayList knownFailures = new ArrayList (new string [] { });
- static string explicitTarget;
- static TextWriter reportOutput = Console.Out;
- static XmlTextWriter reportXmlWriter;
- static StreamWriter missingFiles = new StreamWriter ("missing.lst");
- static StreamWriter failedTests = new StreamWriter ("failed.lst");
+ #region Options Vars
+ bool noExclude;
+ bool reportDetails;
+ bool reportAsXml;
+ bool useDomStyle;
+ bool useDomInstance;
+ bool generateOutput;
+ string outputDir;
+ bool whitespaceStyle;
+ bool whitespaceInstance;
+ bool stopImmediately;
+ bool outputOnlyErrors;
+ bool runSlow = false;
+ #endregion
+
+ #region statistics fields
+ int totalCount = 0;
+ int performedCount = 0;
+ int passedCount = 0;
+ int failedCount = 0;
+ int differentCount = 0;
+ int exceptionCount = 0;
+ int regressionsCount = 0; //failures not listed in knownFailures.lst
+ int fixedCount = 0; //tested known to fail that passed
+ #endregion
+
+ #region test list fields
+ ArrayList netExceptions = new ArrayList ();
+ ArrayList skipTargets = new ArrayList ();
+ ArrayList slowTests = new ArrayList ();
+ ArrayList knownFailures = new ArrayList ();
+ ArrayList fixmeList = new ArrayList ();
+ StreamWriter slowNewList;
+ StreamWriter missingFiles;
+ StreamWriter failedTests;
+ StreamWriter fixedTests;
+ StreamWriter netExceptionsWriter;
+ #endregion
+
+ #region IDisposable Members
+ public void Dispose() {
+ if (reportXmlWriter != null)
+ reportXmlWriter.Close ();
+ if (slowNewList != null)
+ slowNewList.Close();
+ if (missingFiles != null)
+ missingFiles.Close ();
+ if (failedTests != null)
+ failedTests.Close ();
+ if (fixedTests != null)
+ fixedTests.Close ();
+ if (netExceptionsWriter != null)
+ netExceptionsWriter.Close ();
+ reportXmlWriter = null;
+ slowNewList = null;
+ missingFiles = null;
+ failedTests = null;
+ fixedTests = null;
+ netExceptionsWriter = null;
+ }
+
+ #endregion
+
+ string explicitTarget;
+ TextWriter reportOutput = Console.Out;
+ XmlTextWriter reportXmlWriter;
+
+ #region ReadStrings ()
+ static void ReadStrings (ArrayList array, string filename) {
+ if (!File.Exists (filename))
+ return;
+
+ using (StreamReader reader = new StreamReader (filename)) {
+ foreach (string s_ in reader.ReadToEnd ().Split ("\n".ToCharArray ())) {
+ string s = s_.Trim ();
+ if (s.Length > 0)
+ array.Add (s);
+ }
+ }
+ }
#endregion
enum TestResult
Success, //no exception and output is as expected
};
- static XsltTest ()
- {
- skipTargets = new ArrayList (new string [] {
- });
- }
-
#region Options handling
static void Usage ()
{
Use this feature only when you want to update
reference output.
--noExclude Don't exclude meaningless comparison testcases.
- --outall Output fine results as OK (omitted by default).
+ --outErrors Output only error results (don't print dots).
--stoponerror Stops the test process and throw detailed
error if happened.
--ws Preserve spaces for both stylesheet and input source.
--wssrc Preserve spaces for input source.
--xml Report into xml output.
--report Write reports into specified file.
+ --run-slow Run all tests, including slow ones.
FileMatch:
arbitrary string that specifies part of file name.
");
}
- static void ParseOptions (string [] args)
+ void ParseOptions ()
{
- foreach (string arg in args) {
+ foreach (string arg in _args) {
switch (arg) {
case "-?":
Usage ();
case "--noExclude":
noExclude = true;
break;
- case "--outall":
- outputAll = true;
+ case "--outErrors":
+ outputOnlyErrors = true;
break;
case "--stoponerror":
stopImmediately = true;
case "--xml":
reportAsXml = true;
break;
+ case "--run-slow":
+ runSlow = true;
+ break;
default:
if (arg.StartsWith ("--report:")) {
string reportFile = arg.Substring (9);
}
#endregion
- public static void Main (string [] args)
+ public static int Main (string [] args)
{
- try {
- RunMain (args);
- } catch (Exception ex) {
- reportOutput.WriteLine (ex);
- } finally {
- reportOutput.Close ();
+ using (XsltTest test = new XsltTest(args)) {
+ if (!test.Run ())
+ return 1;
+ return 0;
}
}
- static void RunMain (string [] args)
+ string [] _args;
+
+ XsltTest (string [] args)
+ {
+ _args = args;
+ }
+
+ bool Run ()
{
- ParseOptions (args);
+ ParseOptions ();
+ string netExceptionsFilename = Path.Combine (outputDir, "net-exceptions.lst");
+ if (!Directory.Exists (outputDir))
+ Directory.CreateDirectory (outputDir);
+
if (!noExclude) {
- using (StreamReader ignoreReader = new StreamReader ("ignore.lst")) {
- foreach (string s_ in ignoreReader.ReadToEnd ()
- .Split ("\n".ToCharArray ())) {
- string s = s_.Trim ();
- if (s.Length > 0)
- skipTargets.Add (s);
- }
- }
- using (StreamReader knownReader = new StreamReader ("knownFailures.lst")) {
- foreach (string s_ in knownReader.ReadToEnd ()
- .Split ("\n".ToCharArray ())) {
- string s = s_.Trim ();
- if (s.Length > 0)
- knownFailures.Add (s);
- }
- }\r
+ ReadStrings (slowTests, "slow.lst");
+ ReadStrings (skipTargets, "ignore.lst");
+ ReadStrings (knownFailures, "knownFailures.lst");
+ ReadStrings (fixmeList, "fixme.lst");
+ ReadStrings (netExceptions, netExceptionsFilename);
}
+ slowNewList = new StreamWriter ("new-slow.lst");
+ missingFiles = new StreamWriter ("missing.lst");
+ failedTests = new StreamWriter ("failed.lst");
+ fixedTests = new StreamWriter ("fixed.lst");
+
+ if (generateOutput)
+ netExceptionsWriter = new StreamWriter (netExceptionsFilename);
+
if (reportAsXml) {
reportXmlWriter = new XmlTextWriter (reportOutput);
reportXmlWriter.Formatting = Formatting.Indented;
XmlDocument whole = new XmlDocument ();
whole.Load (@"testsuite/TESTS/catalog-fixed.xml");
+ bool res = true;
- foreach (XmlElement testCase in whole.SelectNodes ("test-suite/test-catalog/test-case"))
- ProcessTestCase (testCase);
-
+ foreach (XmlElement testCase in whole.SelectNodes ("test-suite/test-catalog/test-case")) {
+ string testId = testCase.GetAttribute ("id");
+ totalCount ++;
+ DateTime start = DateTime.Now;
+ if (!ProcessTestCase (testCase))
+ res = false;
+ TimeSpan span = DateTime.Now - start;
+ if (span.TotalSeconds > 1) {
+ if (slowTests.Contains (testId))
+ continue;
+ slowNewList.WriteLine (testId);
+ }
+ }
if (reportAsXml)
reportXmlWriter.WriteEndElement (); // test-results
+
+ Console.Error.WriteLine ("\n\n*********");
+ Console.Error.WriteLine ("Total:{0}", totalCount);
+ Console.Error.WriteLine (" Performed:{0}", performedCount);
+ Console.Error.WriteLine (" Passed:{0}", passedCount);
+ Console.Error.WriteLine (" Fixed:{0}\n", fixedCount);
+ Console.Error.WriteLine (" Failed:{0}", failedCount);
+ Console.Error.WriteLine (" Different:{0}", differentCount);
+ Console.Error.WriteLine (" Exceptions:{0}", exceptionCount);
+ Console.Error.WriteLine (" Regressions:{0}", regressionsCount);
+
+ if (fixedCount > 0)
+ Console.Error.WriteLine (@"
+
+ATTENTION!
+Delete the fixed tests (those listed in fixed.lst) from
+knownFailures.lst or fixme.lst, or we might miss
+regressions in the future.");
+
+ if (regressionsCount > 0)
+ Console.Error.WriteLine (@"
+
+ERROR!!! New regressions!
+If you see this message for the first time, your last changes had
+introduced new bugs! Before you commit, consider one of the following:
+
+1. Find and fix the bugs, so tests will pass again.
+2. Open new bugs in bugzilla and temporily add the tests to fixme.lst
+3. Write to devlist and confirm adding the new tests to knownFailures.lst");
+
+ return res;
}
- static void ProcessTestCase (XmlElement testCase)
+ bool ProcessTestCase (XmlElement testCase)
{
string stylesheetBase = null;
string testid = testCase.GetAttribute ("id");
if (skipTargets.Contains (testid))
- return;
+ return true;
+ if (!runSlow && slowTests.Contains (testid))
+ return true;
+ bool res = true;
try {
+ performedCount ++;
string submitter = testCase.SelectSingleNode ("./parent::test-catalog/@submitter")
.InnerText;
string filePath = testCase.SelectSingleNode ("file-path").InnerText;
else if (submitter == "Microsoft")
testAuthorDir = "MSFT_Conformance_Tests";
else
- return; //unknown directory
+ return true; //unknown directory
string relPath = Path.Combine (testAuthorDir, filePath);
string path = Path.Combine ("testsuite/TESTS", relPath);
Directory.CreateDirectory (outputPath);
foreach (XmlElement scenario in
testCase.SelectNodes ("scenario[@operation='standard']")) {
- RunTest (testid, scenario, path, outputPath, stylesheetBase);
+ if (!RunTest (testid, scenario, path, outputPath, stylesheetBase))
+ res = false;
}
} catch (Exception ex) {
if (stopImmediately)
throw;
- Report (TestResult.Crash, testid, "Exception: " + ex.Message);
+ if (!Report (TestResult.Crash, testid, "Exception: " + ex.Message))
+ res = false;
}
+ return res;
}
- static void RunTest (string testid, XmlElement scenario, string path, string outputPath,
+ bool RunTest (string testid, XmlElement scenario, string path, string outputPath,
string stylesheetBase)
{
stylesheetBase = scenario.SelectSingleNode ("input-file[@role='principal-stylesheet']")
if (!File.Exists (stylesheet)) {
missingFiles.WriteLine (stylesheet);
- missingFiles.Flush ();
}
string srcxml = Path.Combine (path,
scenario.SelectSingleNode ("input-file[@role='principal-data']").InnerText);
XslTransform trans = new XslTransform ();
if (explicitTarget != null && testid.IndexOf (explicitTarget) < 0)
- return;
+ return true;
if (skipTargets.Contains (stylesheetBase))
- return;
+ return true;
if (useDomStyle) {
XmlDocument styledoc = new XmlDocument ();
whitespaceStyle ? XmlSpace.Preserve :
XmlSpace.Default),
null, null);
-
+
+ string swString;
XmlTextReader xtr = new XmlTextReader (srcxml);
- XmlValidatingReader xvr = new XmlValidatingReader (xtr);
- xvr.ValidationType = ValidationType.None;
- IXPathNavigable input = null;
- if (useDomInstance) {
- XmlDocument dom = new XmlDocument ();
- if (whitespaceInstance)
- dom.PreserveWhitespace = true;
- dom.Load (xvr);
- input = dom;
- } else {
- input = new XPathDocument (xvr,
- whitespaceStyle ? XmlSpace.Preserve :
- XmlSpace.Default);
+
+ try {
+ XmlValidatingReader xvr = new XmlValidatingReader (xtr);
+ xvr.ValidationType = ValidationType.None;
+ IXPathNavigable input = null;
+ if (useDomInstance) {
+ XmlDocument dom = new XmlDocument ();
+ if (whitespaceInstance)
+ dom.PreserveWhitespace = true;
+ dom.Load (xvr);
+ input = dom;
+ } else {
+ input = new XPathDocument (xvr,
+ whitespaceStyle ? XmlSpace.Preserve :
+ XmlSpace.Default);
+ }
+ using (StringWriter sw = new StringWriter ()) {
+ trans.Transform (input, null, sw, null);
+ swString = sw.ToString ();
+ }
}
- string swString;
- using (StringWriter sw = new StringWriter ()) {
- trans.Transform (input, null, sw, null);
- swString = sw.ToString ();
+ finally {
+ xtr.Close ();
}
if (generateOutput) {
using (StreamWriter fw = new StreamWriter (outfile,
fw.Write (swString);
fw.Close ();
}
- Report (TestResult.Success, testid, "Created reference result");
+ return Report (TestResult.Success, testid, "Created reference result");
// ... and don't run comparison
- return;
}
if (!File.Exists (outfile)) {
// Reference output file does not exist.
- Report (TestResult.Unknown, testid, "No reference file found");
- return;
+ return Report (TestResult.Unknown, testid, "No reference file found");
}
string reference_out;
string actual_out;
actual_out = swString.Replace ("\r\n","\n");
}
if (reference_out != actual_out)
- Report (TestResult.Failure, testid, reference_out, actual_out);
- else if (outputAll)
- Report (TestResult.Success, testid, "OK");
+ return Report (TestResult.Failure, testid, reference_out, actual_out);
+ else if (!outputOnlyErrors)
+ return Report (TestResult.Success, testid, "OK");
+ else
+ return true;
}
- static void Report (TestResult res, string testid, string message)
+ bool Report (TestResult res, string testid, string message)
{
- if (TestResult.Success == res) {
- Console.Error.Write (".");
- return;
- }
- else if (TestResult.Unknown == res) {
- Console.Error.Write ("?");
- return;
+ if (TestResult.Success == res || TestResult.Unknown == res) {
+ passedCount ++;
+ if (fixmeList.Contains (testid) || knownFailures.Contains (testid)) {
+ fixedCount ++;
+ fixedTests.WriteLine (testid);
+ Console.Error.Write ("!");
+ return true;
+ }
+ if (netExceptions.Contains (testid))
+ Console.Error.Write (",");
+ else if (TestResult.Success == res)
+ Console.Error.Write (".");
+ else
+ Console.Error.Write ("?");
+ return true;
}
+
+ bool return_res = true;
+
+ failedCount ++;
+ if (TestResult.Crash == res)
+ exceptionCount ++;
+ else if (TestResult.Failure == res)
+ differentCount ++;
- if (knownFailures.Contains (testid))
+ if (knownFailures.Contains (testid) || fixmeList.Contains (testid))
Console.Error.Write ("k");
+ else if (res == TestResult.Crash && netExceptions.Contains (testid))
+ Console.Error.Write ("K");
else {
- failedTests.WriteLine (testid + "\t" + message);
- failedTests.Flush ();
+ regressionsCount ++;
+ if (reportAsXml) {
+ reportXmlWriter.WriteStartElement ("testcase");
+ reportXmlWriter.WriteAttributeString ("id", testid);
+ reportXmlWriter.WriteString (message);
+ reportXmlWriter.WriteEndElement ();
+ }
+ return_res = false;
+ failedTests.WriteLine (testid + "\t" + message);
- if (TestResult.Crash == res)
- Console.Error.Write ("E");
+ if (TestResult.Crash == res) {
+ Console.Error.Write ("E");
+ if (generateOutput)
+ netExceptionsWriter.WriteLine (testid);
+ }
else
- Console.Error.Write ("e");
- }
-
- if (reportAsXml) {
- reportXmlWriter.WriteStartElement ("testcase");
- reportXmlWriter.WriteAttributeString ("id", testid);
- reportXmlWriter.WriteString (message);
- reportXmlWriter.WriteEndElement ();
+ Console.Error.Write ("e");
}
+ return return_res;
}
- static void Report (TestResult res, string testid, string reference_out, string actual_out)
+ bool Report (TestResult res, string testid, string reference_out, string actual_out)
{
string baseMessage = reportAsXml ? "Different." : "Different: " + testid;
if (!reportDetails)
- Report (res, testid, baseMessage);
+ return Report (res, testid, baseMessage);
else
- Report (res, testid, baseMessage +
+ return Report (res, testid, baseMessage +
"\n Actual*****\n" +
actual_out +
"\n-------------------\nReference*****\n" +
+2005-06-12 Andrew Skiba <andrews@mainsoft.com>
+
+ * xmlconf.cs : make class IDisposable; add another output file for total report
+
+2005-06-09 Andrew Skiba <andrews@mainsoft.com>
+
+ * knownFailures.lst : fix the list of tests that fail on GH 1.6
+
+2005-06-06 Andrew Skiba <andrews@mainsoft.com>
+
+ * xmlconf.cs : change messages
+
2005-06-02 Andrew Skiba <andrews@mainsoft.com>
* Makefile : mkdir as unzip seems to have trouble otherwise (on Cygwin there is an ambiguity between xmlconf.exe and xmlconf dir)
not-wf-sa-031
not-wf-sa-072
+not-wf-sa-077
+not-wf-sa-115
not-wf-sa-116
not-wf-sa-142
not-wf-sa-143
not-wf-sa-146
not-wf-sa-153
not-wf-sa-162
+not-wf-sa-170
not-wf-sa-172
not-wf-sa-173
not-wf-sa-174
not-sa03
not-sa04
sa02
+sa03
sa04
ibm-invalid-P49-ibm49i01.xml
ibm-invalid-P50-ibm50i01.xml
ibm-invalid-P51-ibm51i01.xml
+ibm-not-wf-P66-ibm66n03.xml
ibm-not-wf-P77-ibm77n01.xml
rmt-e2e-14
rmt-e2e-15a
rmt-e2e-15b
rmt-e2e-15c
+rmt-e2e-15d
rmt-e2e-18
rmt-ns10-015
rmt-ns10-023
+rmt-ns10-029
+rmt-ns10-031
+rmt-ns10-032
+rmt-ns10-033
rmt-ns10-042
rmt-ns10-043
rmt-ns10-044
using System.Reflection;\r
\r
namespace XmlConfTest {\r
- class XmlConfTest {\r
+ class XmlConfTest: IDisposable {
\r
#region Command Line Options Handling\r
\r
int fixedCount = 0; //tested known to fail that passed\r
#endregion\r
\r
-\r
#region test list fields\r
ArrayList slowTests = new ArrayList ();\r
ArrayList igroredTests = new ArrayList ();\r
ArrayList knownFailures = new ArrayList ();\r
ArrayList fixmeList = new ArrayList ();\r
ArrayList netFailures = new ArrayList ();\r
- StreamWriter failedList;\r
- StreamWriter fixedList;\r
- StreamWriter slowNewList;\r
+ StreamWriter failedListWriter;\r
+ StreamWriter fixedListWriter;\r
+ StreamWriter slowNewListWriter;\r
+ StreamWriter totalListWriter;
#endregion\r
+
+ #region IDisposable Members
+ public void Dispose()
+ {
+ if (failedListWriter != null)
+ failedListWriter.Close ();
+ if (fixedListWriter != null)
+ fixedListWriter.Close ();
+ if (slowNewListWriter != null)
+ slowNewListWriter.Close ();
+ if (totalListWriter != null)
+ totalListWriter.Close ();
+ failedListWriter = null;
+ fixedListWriter = null;
+ slowNewListWriter = null;
+ totalListWriter = null;
+ }
+ #endregion
\r
#region command line option fields\r
[CommandLineOption ('s')]\r
\r
static int Main (string[] args)\r
{\r
- if (!new XmlConfTest(args).Run ())\r
- return 1;\r
- else\r
- return 0;\r
+ using (XmlConfTest test = new XmlConfTest (args)) {
+ if (!test.Run ())
+ return 1;
+ else
+ return 0;
+ }
}\r
\r
#region ReadStrings ()\r
XmlConfTest (string [] args)\r
{\r
_args = args;\r
- failedList = new StreamWriter ("failed.lst", false);\r
- fixedList = new StreamWriter ("fixed.lst", false);\r
- slowNewList = new StreamWriter ("slow-new.lst", false);\r
+ failedListWriter = new StreamWriter ("failed.lst", false);
+ fixedListWriter = new StreamWriter ("fixed.lst", false);
+ slowNewListWriter = new StreamWriter ("slow-new.lst", false);
+ totalListWriter = new StreamWriter ("total.lst", false);
ReadStrings (slowTests, "slow.lst");\r
ReadStrings (igroredTests, "ignored.lst");\r
ReadStrings (knownFailures, "knownFailures.lst");\r
}\r
\r
DateTime start = DateTime.Now;\r
- res = PerformTest (test) && res;\r
+ if (!PerformTest (test))\r
+ res = false;\r
TimeSpan span = DateTime.Now - start;\r
if (span.TotalSeconds > 1) {\r
if (slowTests.Contains (testId))\r
continue;\r
- slowNewList.WriteLine (testId);\r
- slowNewList.Flush ();\r
+ slowNewListWriter.WriteLine (testId);\r
}\r
}\r
\r
Console.Error.WriteLine ("Fixed:{0}\n", fixedCount);\r
\r
if (fixedCount > 0)\r
- Console.Error.WriteLine (@"ATTENTION!\r
-You must delete the fixed tests (those listed in fixed.lst) from\r
-knownFailures.lst or fixme.lst. If you don't do it, you can miss\r
+ Console.Error.WriteLine (@"\r
+\r
+ATTENTION!\r
+Delete the fixed tests (those listed in fixed.lst) from\r
+knownFailures.lst or fixme.lst, or we might miss\r
regressions in the future.");\r
\r
if (regressionsCount > 0)\r
- Console.Error.WriteLine (@"ERROR!!! New regressions!\r
+ Console.Error.WriteLine (@"\r
+\r
+ERROR!!! New regressions!\r
If you see this message for the first time, your last changes had\r
-introduced new bugs! Before you commit, you must do one of the following:\r
+introduced new bugs! Before you commit, consider one of the following:\r
\r
1. Find and fix the bugs, so tests will pass again.\r
2. Open new bugs in bugzilla and temporily add the tests to fixme.lst\r
bool Report (XmlElement test, bool isok, bool nonValidatingPassed, bool validatingPassed)\r
{\r
string testId = test.GetAttribute ("ID");\r
+ totalListWriter.Write (testId + "\t");
\r
if (isok) {\r
++passedCount;\r
if (fixmeList.Contains (testId) || knownFailures.Contains (testId)) {\r
++fixedCount;\r
- fixedList.WriteLine (testId);\r
- fixedList.Flush ();\r
+ fixedListWriter.WriteLine (testId);\r
Console.Error.Write ("!");\r
+ totalListWriter.WriteLine ("fixed");
return true;\r
}\r
if (netFailures.Contains (testId)) {\r
Console.Error.Write (",");\r
+ totalListWriter.WriteLine (",");
return true;\r
}\r
\r
Console.Error.Write (".");\r
+ totalListWriter.WriteLine (".");
return true;\r
}\r
\r
\r
if (netFailures.Contains (testId)) {\r
Console.Error.Write ("K");\r
+ totalListWriter.WriteLine ("dot net known failure");
return true;\r
}\r
if (knownFailures.Contains (testId)) {\r
Console.Error.Write ("k");\r
+ totalListWriter.WriteLine ("known failure");
return true;\r
}\r
if (fixmeList.Contains (testId)) {\r
Console.Error.Write ("f");\r
+ totalListWriter.WriteLine ("fixme");
return true;\r
}\r
\r
++regressionsCount;\r
Console.Error.Write ("E");\r
- failedList.Write ("*** Test failed:\t{0}\ttype:{1}\tnonValidatingPassed:{2},validatingPassed:{3}\t",\r
+ totalListWriter.WriteLine ("regression");
+ failedListWriter.Write ("*** Test failed:\t{0}\ttype:{1}\tnonValidatingPassed:{2},validatingPassed:{3}\t",\r
testId, test.GetAttribute ("TYPE"), nonValidatingPassed, validatingPassed);\r
- failedList.WriteLine (test.InnerXml);\r
- failedList.Flush ();\r
+ failedListWriter.WriteLine (test.InnerXml);\r
return false;\r
}\r
}\r
//
// Methods
//
- [MonoTODO]
- public CompilerResults CompileAssemblyFromDom (
- CompilerParameters options,CodeCompileUnit e)
+ public CompilerResults CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
{
- return CompileAssemblyFromDomBatch(options,new CodeCompileUnit[]{e});
+ return CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { e });
}
- public CompilerResults CompileAssemblyFromDomBatch (
- CompilerParameters options,CodeCompileUnit[] ea)
- {
- string[] fileNames=new string[ea.Length];
- int i=0;
- if (options == null)
- options = new CompilerParameters ();
-
- StringCollection assemblies = options.ReferencedAssemblies;
- foreach (CodeCompileUnit e in ea) {
- fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, i.ToString () + ".cs");
- FileStream f=new FileStream(fileNames[i],FileMode.OpenOrCreate);
- StreamWriter s=new StreamWriter(f, Encoding.UTF8);
- if (e.ReferencedAssemblies != null) {
- foreach (string str in e.ReferencedAssemblies) {
- if (!assemblies.Contains (str))
- assemblies.Add (str);
- }
- }
+ public CompilerResults CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
- ((ICodeGenerator)this).GenerateCodeFromCompileUnit (e, s, new CodeGeneratorOptions());
- s.Close();
- f.Close();
- i++;
+ try {
+ return CompileFromDomBatch (options, ea);
+ } finally {
+ options.TempFiles.Delete ();
}
- return CompileAssemblyFromFileBatch (options, fileNames);
}
-
- public CompilerResults CompileAssemblyFromFile (
- CompilerParameters options,string fileName)
+
+ public CompilerResults CompileAssemblyFromFile (CompilerParameters options, string fileName)
{
- return CompileAssemblyFromFileBatch (options, new string []{fileName});
+ return CompileAssemblyFromFileBatch (options, new string[] { fileName });
}
public CompilerResults CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ try {
+ return CompileFromFileBatch (options, fileNames);
+ } finally {
+ options.TempFiles.Delete ();
+ }
+ }
+
+ public CompilerResults CompileAssemblyFromSource (CompilerParameters options, string source)
+ {
+ return CompileAssemblyFromSourceBatch (options, new string[] { source });
+ }
+
+ public CompilerResults CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ try {
+ return CompileFromSourceBatch (options, sources);
+ } finally {
+ options.TempFiles.Delete ();
+ }
+ }
+
+ private CompilerResults CompileFromFileBatch (CompilerParameters options, string[] fileNames)
{
if (null == options)
throw new ArgumentNullException("options");
return results;
}
- public CompilerResults CompileAssemblyFromSource (
- CompilerParameters options,string source)
- {
- return CompileAssemblyFromSourceBatch(options,new string[]{source});
- }
- public CompilerResults CompileAssemblyFromSourceBatch (
- CompilerParameters options,string[] sources)
- {
- string[] fileNames=new string[sources.Length];
- int i=0;
- foreach (string source in sources) {
- fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, i.ToString () + ".cs");
- FileStream f=new FileStream(fileNames[i],FileMode.OpenOrCreate);
- StreamWriter s=new StreamWriter(f);
- s.Write(source);
- s.Close();
- f.Close();
- i++;
- }
- return CompileAssemblyFromFileBatch (options, fileNames);
- }
-
private static string BuildArgs(CompilerParameters options,string[] fileNames)
{
else
args.Append("/target:library ");
+ if (options.Win32Resource != null)
+ args.AppendFormat("/win32res:\"{0}\" ",
+ options.Win32Resource);
+
if (options.IncludeDebugInformation)
args.Append("/debug+ /optimize- ");
else
args.AppendFormat ("/warn:{0} ", options.WarningLevel);
if (options.OutputAssembly==null)
- options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, "dll");
+ options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, "dll", !options.GenerateInMemory);
args.AppendFormat("/out:\"{0}\" ",options.OutputAssembly);
if (null != options.ReferencedAssemblies)
return error;
}
- static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
+ private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
+ {
+ return temp_files.AddExtension (extension, keepFile);
+ }
+
+ private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
{
return temp_files.AddExtension (extension);
}
+
+ private CompilerResults CompileFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ if (ea == null) {
+ throw new ArgumentNullException ("ea");
+ }
+
+ string[] fileNames = new string[ea.Length];
+ StringCollection assemblies = options.ReferencedAssemblies;
+
+ for (int i = 0; i < ea.Length; i++) {
+ CodeCompileUnit compileUnit = ea[i];
+ fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".cs");
+ FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
+ StreamWriter s = new StreamWriter (f);
+ if (compileUnit.ReferencedAssemblies != null) {
+ foreach (string str in compileUnit.ReferencedAssemblies) {
+ if (!assemblies.Contains (str))
+ assemblies.Add (str);
+ }
+ }
+
+ ((ICodeGenerator) this).GenerateCodeFromCompileUnit (compileUnit, s, new CodeGeneratorOptions ());
+ s.Close ();
+ f.Close ();
+ }
+ return CompileAssemblyFromFileBatch (options, fileNames);
+ }
+
+ private CompilerResults CompileFromSourceBatch (CompilerParameters options, string[] sources)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ if (sources == null) {
+ throw new ArgumentNullException ("sources");
+ }
+
+ string[] fileNames = new string[sources.Length];
+
+ for (int i = 0; i < sources.Length; i++) {
+ fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".cs");
+ FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (sources[i]);
+ s.Close ();
+ }
+ f.Close ();
+ }
+ return CompileFromFileBatch (options, fileNames);
+ }
}
}
protected override bool Supports( GeneratorSupport supports )
{
- if ( (supports & GeneratorSupport.Win32Resources) != 0 )
- return false;
return true;
}
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * CSharpCodeCompiler.cs: Temp source files should have extension
+ ".cs".
+
+2005-06-11 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * CSharpCodeGenerator.cs: Win32 resources are supported. Fixes bug
+ #75218.
+ * CSharpCodeCompiler.cs: Clean up temporary files after compilation.
+ Fixes bug #75221. Added support for Win32 resources. Fixes bug
+ #75218.
+
2005-05-29 Gert Driesen <drieseng@users.sourceforge.net>
* CSharpCodeCompiler.cs: Load compiled assembly from byte array
+2005-06-13 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeCompiler.cs: Temp source files should have extension ".vb".
+
+2005-06-09 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeCompiler.cs: ArgumentException was thrown when more than
+ one file/source or CodeCompileUnit is built, temporary files were
+ not cleaned up. Fixes bug #75191.
+
2005-05-29 Gert Driesen <drieseng@users.sourceforge.net>
* VBCodeCompiler.cs: Load compiled assembly from byte array if
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.IO;
+using System.Text;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+
namespace Microsoft.VisualBasic
{
- using System;
- using System.CodeDom;
- using System.CodeDom.Compiler;
- using System.IO;
- using System.Text;
- using System.Reflection;
- using System.Collections;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.Text.RegularExpressions;
-
- internal class VBCodeCompiler: VBCodeGenerator, ICodeCompiler
+ internal class VBCodeCompiler : VBCodeGenerator, ICodeCompiler
{
static string windowsMonoPath;
static string windowsMbasPath;
if (Path.DirectorySeparatorChar == '\\') {
// FIXME: right now we use "fixed" version 1.0
// mcs at any time.
- PropertyInfo gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static|BindingFlags.NonPublic);
+ PropertyInfo gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo get_gac = gac.GetGetMethod (true);
string p = Path.GetDirectoryName (
(string) get_gac.Invoke (null, null));
}
}
- //
- // Constructors
- //
- public VBCodeCompiler()
+ public CompilerResults CompileAssemblyFromDom (CompilerParameters options, CodeCompileUnit e)
{
+ return CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { e });
}
- //
- // Methods
- //
- [MonoTODO]
- public CompilerResults CompileAssemblyFromDom (CompilerParameters options,CodeCompileUnit e)
+ public CompilerResults CompileAssemblyFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
{
- return CompileAssemblyFromDomBatch (options, new CodeCompileUnit []{e});
- }
-
- public CompilerResults CompileAssemblyFromDomBatch (CompilerParameters options,
- CodeCompileUnit [] ea)
- {
- string [] fileNames = new string [ea.Length];
- int i = 0;
- if (options == null)
- options = new CompilerParameters ();
-
- StringCollection assemblies = options.ReferencedAssemblies;
-
- foreach (CodeCompileUnit e in ea) {
- fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, "vb");
- FileStream f = new FileStream (fileNames [i], FileMode.OpenOrCreate);
- StreamWriter s = new StreamWriter (f);
- if (e.ReferencedAssemblies != null) {
- foreach (string str in e.ReferencedAssemblies) {
- if (!assemblies.Contains (str))
- assemblies.Add (str);
- }
- }
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
- ((ICodeGenerator)this).GenerateCodeFromCompileUnit (e, s, new CodeGeneratorOptions());
- s.Close();
- f.Close();
- i++;
+ try {
+ return CompileFromDomBatch (options, ea);
+ } finally {
+ options.TempFiles.Delete ();
}
- return CompileAssemblyFromFileBatch (options, fileNames);
}
public CompilerResults CompileAssemblyFromFile (CompilerParameters options, string fileName)
{
- return CompileAssemblyFromFileBatch (options, new string []{fileName});
+ return CompileAssemblyFromFileBatch (options, new string[] { fileName });
}
- public CompilerResults CompileAssemblyFromFileBatch (CompilerParameters options,
- string [] fileNames)
+ public CompilerResults CompileAssemblyFromFileBatch (CompilerParameters options, string[] fileNames)
{
- if (null == options)
+ if (options == null) {
throw new ArgumentNullException ("options");
-
- if (null == fileNames)
- throw new ArgumentNullException ("fileNames");
-
- CompilerResults results = new CompilerResults (options.TempFiles);
- Process mbas = new Process ();
-
- string mbas_output;
- string [] mbas_output_lines;
- // FIXME: these lines had better be platform independent.
- if (Path.DirectorySeparatorChar == '\\') {
- mbas.StartInfo.FileName = windowsMonoPath;
- mbas.StartInfo.Arguments = windowsMbasPath + ' ' + BuildArgs (options, fileNames);
}
- else {
- mbas.StartInfo.FileName = "mbas";
- mbas.StartInfo.Arguments = BuildArgs (options,fileNames);
- }
- mbas.StartInfo.CreateNoWindow = true;
- mbas.StartInfo.UseShellExecute = false;
- mbas.StartInfo.RedirectStandardOutput = true;
+
try {
- mbas.Start();
- mbas_output = mbas.StandardOutput.ReadToEnd ();
- mbas.WaitForExit();
+ return CompileFromFileBatch (options, fileNames);
} finally {
- results.NativeCompilerReturnValue = mbas.ExitCode;
- mbas.Close ();
- }
-
- mbas_output_lines = mbas_output.Split(Environment.NewLine.ToCharArray());
- bool loadIt=true;
- foreach (string error_line in mbas_output_lines) {
- CompilerError error = CreateErrorFromString (error_line);
- if (null != error) {
- results.Errors.Add (error);
- if (!error.IsWarning)
- loadIt = false;
- }
- }
-
- if (loadIt) {
- if (options.GenerateInMemory) {
- using (FileStream fs = File.OpenRead(options.OutputAssembly)) {
- byte[] buffer = new byte[fs.Length];
- fs.Read(buffer, 0, buffer.Length);
- results.CompiledAssembly = Assembly.Load(buffer, null, options.Evidence);
- fs.Close();
- }
- } else {
- results.CompiledAssembly = Assembly.LoadFrom(options.OutputAssembly);
- results.PathToAssembly = options.OutputAssembly;
- }
- } else {
- results.CompiledAssembly = null;
+ options.TempFiles.Delete ();
}
-
- return results;
}
- public CompilerResults CompileAssemblyFromSource (CompilerParameters options,
- string source)
+ public CompilerResults CompileAssemblyFromSource (CompilerParameters options, string source)
{
- return CompileAssemblyFromSourceBatch (options, new string [] {source});
+ return CompileAssemblyFromSourceBatch (options, new string[] { source });
}
- public CompilerResults CompileAssemblyFromSourceBatch (CompilerParameters options,
- string [] sources)
+ public CompilerResults CompileAssemblyFromSourceBatch (CompilerParameters options, string[] sources)
{
- string [] fileNames = new string [sources.Length];
- int i = 0;
- foreach (string source in sources) {
- fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, "vb");
- FileStream f = new FileStream (fileNames [i], FileMode.OpenOrCreate);
- StreamWriter s = new StreamWriter (f);
- s.Write (source);
- s.Close ();
- f.Close ();
- i++;
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ try {
+ return CompileFromSourceBatch (options, sources);
+ } finally {
+ options.TempFiles.Delete ();
}
- return CompileAssemblyFromFileBatch(options,fileNames);
}
- static string BuildArgs (CompilerParameters options, string [] fileNames)
+ static string BuildArgs (CompilerParameters options, string[] fileNames)
{
StringBuilder args = new StringBuilder ();
args.AppendFormat ("/quiet ");
if (options.GenerateExecutable)
- args.AppendFormat("/target:exe ");
+ args.AppendFormat ("/target:exe ");
else
- args.AppendFormat("/target:library ");
+ args.AppendFormat ("/target:library ");
/* Disabled. It causes problems now. -- Gonzalo
if (options.IncludeDebugInformation)
if (options.OutputAssembly == null) {
string ext = (options.GenerateExecutable ? "exe" : "dll");
- options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, ext);
+ options.OutputAssembly = GetTempFileNameWithExtension (options.TempFiles, ext, !options.GenerateInMemory);
}
args.AppendFormat ("/out:\"{0}\" ", options.OutputAssembly);
bool Reference2MSVBFound;
Reference2MSVBFound = false;
- if (null != options.ReferencedAssemblies)
- {
- foreach (string import in options.ReferencedAssemblies)
- {
+ if (null != options.ReferencedAssemblies) {
+ foreach (string import in options.ReferencedAssemblies) {
if (string.Compare (import, "Microsoft.VisualBasic", true, System.Globalization.CultureInfo.InvariantCulture) == 0)
Reference2MSVBFound = true;
args.AppendFormat ("/r:\"{0}\" ", import);
}
}
// add standard import to Microsoft.VisualBasic if missing
- if (Reference2MSVBFound == false)
+ if (!Reference2MSVBFound)
args.AppendFormat ("/r:\"{0}\" ", "Microsoft.VisualBasic");
- args.AppendFormat(" -- "); // makes mbas not try to process filenames as options
+ args.AppendFormat (" -- "); // makes mbas not try to process filenames as options
foreach (string source in fileNames)
- args.AppendFormat("\"{0}\" ",source);
+ args.AppendFormat ("\"{0}\" ", source);
- return args.ToString();
+ return args.ToString ();
}
static CompilerError CreateErrorFromString (string error_string)
if (!match.Success)
return null;
- if (String.Empty != match.Result("${file}"))
+ if (String.Empty != match.Result ("${file}"))
error.FileName = match.Result ("${file}");
if (String.Empty != match.Result ("${line}"))
error.Line = Int32.Parse (match.Result ("${line}"));
- if (String.Empty != match.Result( "${column}"))
+ if (String.Empty != match.Result ("${column}"))
error.Column = Int32.Parse (match.Result ("${column}"));
- if (match.Result ("${level}") =="warning")
+ if (match.Result ("${level}") == "warning")
error.IsWarning = true;
error.ErrorNumber = match.Result ("${number}");
return error;
}
- static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
+ private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension, bool keepFile)
+ {
+ return temp_files.AddExtension (extension, keepFile);
+ }
+
+ private static string GetTempFileNameWithExtension (TempFileCollection temp_files, string extension)
{
return temp_files.AddExtension (extension);
}
+
+ private CompilerResults CompileFromFileBatch (CompilerParameters options, string[] fileNames)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ if (fileNames == null) {
+ throw new ArgumentNullException ("fileNames");
+ }
+
+ CompilerResults results = new CompilerResults (options.TempFiles);
+ Process mbas = new Process ();
+
+ string mbas_output;
+ string[] mbas_output_lines;
+ // FIXME: these lines had better be platform independent.
+ if (Path.DirectorySeparatorChar == '\\') {
+ mbas.StartInfo.FileName = windowsMonoPath;
+ mbas.StartInfo.Arguments = windowsMbasPath + ' ' + BuildArgs (options, fileNames);
+ } else {
+ mbas.StartInfo.FileName = "mbas";
+ mbas.StartInfo.Arguments = BuildArgs (options, fileNames);
+ }
+ mbas.StartInfo.CreateNoWindow = true;
+ mbas.StartInfo.UseShellExecute = false;
+ mbas.StartInfo.RedirectStandardOutput = true;
+ try {
+ mbas.Start ();
+ mbas_output = mbas.StandardOutput.ReadToEnd ();
+ mbas.WaitForExit ();
+ } finally {
+ results.NativeCompilerReturnValue = mbas.ExitCode;
+ mbas.Close ();
+ }
+
+ mbas_output_lines = mbas_output.Split (Environment.NewLine.ToCharArray ());
+ bool loadIt = true;
+ foreach (string error_line in mbas_output_lines) {
+ CompilerError error = CreateErrorFromString (error_line);
+ if (null != error) {
+ results.Errors.Add (error);
+ if (!error.IsWarning)
+ loadIt = false;
+ }
+ }
+
+ if (loadIt) {
+ if (options.GenerateInMemory) {
+ using (FileStream fs = File.OpenRead (options.OutputAssembly)) {
+ byte[] buffer = new byte[fs.Length];
+ fs.Read (buffer, 0, buffer.Length);
+ results.CompiledAssembly = Assembly.Load (buffer, null, options.Evidence);
+ fs.Close ();
+ }
+ } else {
+ results.CompiledAssembly = Assembly.LoadFrom (options.OutputAssembly);
+ results.PathToAssembly = options.OutputAssembly;
+ }
+ } else {
+ results.CompiledAssembly = null;
+ }
+
+ return results;
+ }
+
+ private CompilerResults CompileFromDomBatch (CompilerParameters options, CodeCompileUnit[] ea)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ if (ea == null) {
+ throw new ArgumentNullException ("ea");
+ }
+
+ string[] fileNames = new string[ea.Length];
+ StringCollection assemblies = options.ReferencedAssemblies;
+
+ for (int i = 0; i < ea.Length; i++) {
+ CodeCompileUnit compileUnit = ea[i];
+ fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".vb");
+ FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
+ StreamWriter s = new StreamWriter (f);
+ if (compileUnit.ReferencedAssemblies != null) {
+ foreach (string str in compileUnit.ReferencedAssemblies) {
+ if (!assemblies.Contains (str))
+ assemblies.Add (str);
+ }
+ }
+
+ ((ICodeGenerator) this).GenerateCodeFromCompileUnit (compileUnit, s, new CodeGeneratorOptions ());
+ s.Close ();
+ f.Close ();
+ }
+ return CompileAssemblyFromFileBatch (options, fileNames);
+ }
+
+ private CompilerResults CompileFromSourceBatch (CompilerParameters options, string[] sources)
+ {
+ if (options == null) {
+ throw new ArgumentNullException ("options");
+ }
+
+ if (sources == null) {
+ throw new ArgumentNullException ("sources");
+ }
+
+ string[] fileNames = new string[sources.Length];
+
+ for (int i = 0; i < sources.Length; i++) {
+ fileNames[i] = GetTempFileNameWithExtension (options.TempFiles, i + ".vb");
+ FileStream f = new FileStream (fileNames[i], FileMode.OpenOrCreate);
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (sources[i]);
+ s.Close ();
+ }
+ f.Close ();
+ }
+ return CompileFromFileBatch (options, fileNames);
+ }
}
}
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ToolboxItemAttribute.cs: fix the fix that was fixed before.
+
+2005-06-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * ToolboxItemAttribute.cs: Revert last change as it breaks the build.
+
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ToolboxItemAttribute.cs: fix default type name.
+
2005-06-04 Gert Driesen <drieseng@users.sourceforge.net>
* Win32Exception.cs: improve error message for error 10047.
[AttributeUsage(AttributeTargets.All)]
public class ToolboxItemAttribute : Attribute
{
- private static string defaultItemType = "System.Drawing.Design.ToolboxItem,System.Drawing";
+ static string defaultItemType;
public static readonly ToolboxItemAttribute Default = new ToolboxItemAttribute (defaultItemType);
public static readonly ToolboxItemAttribute None = new ToolboxItemAttribute (false);
private Type itemType;
private string itemTypeName;
+ static ToolboxItemAttribute ()
+ {
+ defaultItemType = "System.Drawing.Desing.ToolboxItem" + Consts.AssemblySystem_Drawing;
+ }
+
public ToolboxItemAttribute (bool defaultType)
{
if (defaultType)
+2005-06-09 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * TraceImpl.cs: Adjust internal indentlevel and indentsize before
+ passing on to listeners. Fixes some test failures.
+
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * DefaultTraceListener.cs: s/MONO_TRACE/MONO_TRACE_LISTENER/. The
+ runtime uses MONO_TRACE too...
+
2005-05-31 Sebastien Pouliot <sebastien@ximian.com>
* PerformanceCounterPermissionEntry.cs: Added more 2.0 validations for
// messages. On Win32 platforms (OnWin32 = true), we use the
// `OutputDebugString' api.
//
- // On Linux platforms, we use MONO_TRACE to figure things out. See the
- // API documentation for more information on MONO_TRACE.
+ // On Linux platforms, we use MONO_TRACE_LISTENER to figure things out. See the
+ // API documentation for more information on MONO_TRACE_LISTENER.
OnWin32 = (Path.DirectorySeparatorChar == '\\');
if (!OnWin32) {
// If we're running on Unix, we don't have OutputDebugString.
- // Instead, send output to...wherever the MONO_TRACE environment
+ // Instead, send output to...wherever the MONO_TRACE_LISTENER environment
// variables says to.
- String trace = Environment.GetEnvironmentVariable("MONO_TRACE");
+ String trace = Environment.GetEnvironmentVariable("MONO_TRACE_LISTENER");
if (trace != null) {
string file = null;
/**
* Get the prefix for the specified variable.
*
- * "Prefixes" are used in the MONO_TRACE variable, and specify text that
+ * "Prefixes" are used in the MONO_TRACE_LISTENER variable, and specify text that
* should precede each message printed to the console. The prefix is
* appended to the console location with a colon (':') separating them.
- * For example, if MONO_TRACE is "Console.Out:** my prefix", the prefix is
+ * For example, if MONO_TRACE_LISTENER is "Console.Out:** my prefix", the prefix is
* "** my prefix".
*
* Everything after the colon, if the colon is present, is used as the
* prefix.
*
- * @param var The current MONO_TRACE variable
+ * @param var The current MONO_TRACE_LISTENER variable
* @param target The name of the output location, e.g. "Console.Out"
*/
private static string GetPrefix (string var, string target)
get {return indentLevel;}
set {
lock (ListenersSyncRoot) {
+ indentLevel = value;
+
foreach (TraceListener t in Listeners) {
t.IndentLevel = indentLevel;
}
-
- indentLevel = value;
}
}
}
get {return indentSize;}
set {
lock (ListenersSyncRoot) {
+ indentSize = value;
+
foreach (TraceListener t in Listeners) {
t.IndentSize = indentSize;
}
-
- indentSize = value;
}
}
}
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TcpClient.cs: patch by Hans Kratz that uses an integer when setting
+ NoDelay instead of a bool, which is only handled in 2.0.
+
2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Socket.cs: disallow connecting to .Any addresses. Fixes bug #75154.
set {
client.SetSocketOption(
SocketOptionLevel.Tcp,
- SocketOptionName.NoDelay, value);
+ SocketOptionName.NoDelay, value ? 1 : 0);
}
}
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * WebConnection.cs:
+ * HttpWebRequest.cs:
+ * WebConnectionStream.cs: initiate the polling for input data after
+ sending the header so that we detect any response that the server sends
+ back even if we're still trying to write the request for a POST/PUT.
+ If we get the response (or an error) before any one calls GetResponse(),
+ keep it around instead of ignoring it.
+
2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpWebRequest.cs: send the right header/user/password in
byte[] bodyBuffer;
int bodyBufferLength;
bool getResponseCalled;
+ Exception saved_exc;
#if NET_1_1
int maxResponseHeadersLength;
static int defaultMaxResponseHeadersLength;
initialMethod = method;
if (haveResponse) {
if (webResponse != null) {
+ Exception saved = saved_exc;
Monitor.Exit (this);
- asyncRead.SetCompleted (true, webResponse);
+ if (saved == null) {
+ asyncRead.SetCompleted (true, webResponse);
+ } else {
+ asyncRead.SetCompleted (true, saved);
+ }
asyncRead.DoCallback ();
return asyncRead;
}
public override WebResponse GetResponse()
{
- if (haveResponse && webResponse != null)
- return webResponse;
-
WebAsyncResult result = (WebAsyncResult) BeginGetResponse (null, null);
return EndGetResponse (result);
}
asyncWrite = null;
}
}
-
+
+ void CheckSendError (WebConnectionData data)
+ {
+ // Got here, but no one called GetResponse
+ if (data.StatusCode < 400)
+ return;
+
+ if (writeStream != null && asyncRead == null && !writeStream.CompleteRequestWritten) {
+ // The request has not been completely sent and we got here!
+ // We should probably just close and cause an error in any case,
+ saved_exc = new WebException (data.StatusDescription, null, WebExceptionStatus.ProtocolError, webResponse);
+ webResponse.ReadAll ();
+ }
+ }
+
internal void SetResponseData (WebConnectionData data)
{
if (aborted) {
data.stream.Close ();
}
+ if (wexc == null && (method == "POST" || method == "PUT")) {
+ lock (this) {
+ CheckSendError (data);
+ if (saved_exc != null)
+ wexc = (WebException) saved_exc;
+ }
+ }
+
WebAsyncResult r = asyncRead;
if (r != null) {
if (wexc != null) {
return result;
}
- internal void EndWrite (IAsyncResult result)
+ internal bool EndWrite (IAsyncResult result)
{
- if (nstream != null)
+ if (nstream == null)
+ return false;
+
+ try {
nstream.EndWrite (result);
+ return true;
+ } catch (Exception e) {
+ status = WebExceptionStatus.SendFailure;
+ return false;
+ }
}
internal int Read (byte [] buffer, int offset, int size)
object locker = new object ();
bool initRead;
bool read_eof;
+ bool complete_request_written;
public WebConnectionStream (WebConnection cnc)
{
pending = new ManualResetEvent (true);
}
+ internal bool CompleteRequestWritten {
+ get { return complete_request_written; }
+ }
+
internal bool SendChunked {
set { sendChunked = value; }
}
if (cnc.Data.StatusCode != 0 && cnc.Data.StatusCode != 100)
return;
- cnc.Write (bytes, 0, length);
+ if (!initRead) {
+ initRead = true;
+ WebConnection.InitRead (cnc);
+ }
+
+ IAsyncResult result = cnc.BeginWrite (bytes, 0, length, null, null);
+ complete_request_written = cnc.EndWrite (result);
}
internal void InternalClose ()
{
disposed = true;
}
-
+
+ internal void ForceCloseConnection ()
+ {
+ if (!disposed) {
+ disposed = true;
+ cnc.Close (true);
+ }
+ }
+
public override void Close ()
{
if (sendChunked) {
}
return;
} else if (!allowBuffering) {
+ complete_request_written = true;
if (!initRead) {
initRead = true;
WebConnection.InitRead (cnc);
if (disposed)
return;
- disposed = true;
-
long length = request.ContentLength;
if (length != -1 && length > writeBuffer.Length)
throw new IOException ("Cannot close the stream until all bytes are written");
WriteRequest ();
- if (!initRead) {
- initRead = true;
- WebConnection.InitRead (cnc);
- }
+ disposed = true;
}
public override long Seek (long a, SeekOrigin b)
}
public string Value {
- get {
- if (text!= null)
- return text.Substring (index, length);
- else
- return String.Empty;
- }
+ get { return text == null ? String.Empty : text.Substring (index, length); }
}
- public override string ToString () {
+ public override string ToString ()
+ {
return Value;
}
internal Capture (string text) : this (text, 0, 0) { }
- internal Capture (string text, int index, int length) {
+ internal Capture (string text, int index, int length)
+ {
this.text = text;
this.index = index;
this.length = length;
[Serializable]
public class CaptureCollection: ICollection, IEnumerable
{
- private ArrayList list;
+ private Capture [] list;
/* No public constructor */
- internal CaptureCollection () {
- list = new ArrayList ();
+ internal CaptureCollection (int n)
+ {
+ list = new Capture [n];
}
public virtual int Count {
- get {
- return(list.Count);
- }
+ get { return list.Length; }
}
public bool IsReadOnly {
- get {
- return(true);
- }
+ get { return true; }
}
public virtual bool IsSynchronized {
- get {
- return(false);
- }
+ get { return false; }
}
- public Capture this[int i] {
+ public Capture this [int i] {
get {
- if (i < 0 ||
- i > Count) {
+ if (i < 0 || i > Count)
throw new ArgumentOutOfRangeException ("Index is out of range");
- }
-
- return((Capture)list[i]);
- }
- }
-
- public virtual object SyncRoot {
- get {
- return(list);
- }
- }
-
- public virtual void CopyTo (Array array, int index) {
- foreach (object o in list) {
- if (index > array.Length) {
- break;
- }
-
- array.SetValue (o, index++);
+ return list [i];
}
}
- public virtual IEnumerator GetEnumerator () {
- return(new Enumerator (list));
+ internal void SetValue (Capture cap, int i)
+ {
+ list [i] = cap;
}
- internal void Add (object o) {
- list.Add (o);
+ public virtual object SyncRoot {
+ get { return list; }
}
- internal void Reverse () {
- list.Reverse ();
+ public virtual void CopyTo (Array array, int index)
+ {
+ list.CopyTo (array, index);
}
- private class Enumerator: IEnumerator {
- private IList list;
- private int ptr;
-
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count) {
- throw new InvalidOperationException ();
- }
-
- return(list[ptr]);
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count) {
- throw new InvalidOperationException ();
- }
-
- return(++ptr < list.Count);
- }
-
- public void Reset () {
- ptr = -1;
- }
+ public virtual IEnumerator GetEnumerator ()
+ {
+ return list.GetEnumerator ();
}
}
}
+2005-06-10 Raja R Harinath <rharinath@novell.com>
+
+ * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two
+ intermediate arrays to build the final result.
+ (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper
+ functions.
+ * CaptureCollection.cs (list): Change from ArrayList to list.
+ (SetValue): New internal helper, used by Interpreter.PopulateGroup.
+ (Enumerator): Remove helper class.
+ (IEnumerator.GetEnumerator): Just use list.GetEnumerator.
+ * GroupCollection.cs: Likewise.
+ * Group.cs (Group): Move responsibility of populating 'Captures'
+ to Interpreter.PopulateGroup.
+ * Match.cs (Match): Move responsibility of populating 'Groups' to
+ Interpreter.GenerateMatch.
+
2005-05-25 Raja R Harinath <rharinath@novell.com>
* replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid
[Serializable]
public class Group : Capture {
- public static Group Synchronized (Group inner) {
+ public static Group Synchronized (Group inner)
+ {
return inner; // is this enough?
}
+ internal static Group Fail = new Group ();
+
public CaptureCollection Captures {
get { return captures; }
}
}
// internal
-
- internal Group (string text, int[] caps) : base (text) {
- this.captures = new CaptureCollection ();
-
- if (caps == null || caps.Length == 0) {
- this.success = false;
- return;
- }
-
- this.success = true;
- this.index = caps[0];
- this.length = caps[1];
- captures.Add (this);
- for (int i = 2; i < caps.Length; i += 2)
- captures.Add (new Capture (text, caps[i], caps[i + 1]));
- captures.Reverse ();
+ internal Group (string text, int index, int length, int n_caps) : base (text, index, length)
+ {
+ success = true;
+ captures = new CaptureCollection (n_caps);
+ captures.SetValue (this, n_caps - 1);
}
- internal Group (): base ("")
+ internal Group () : base ("")
{
- captures = new CaptureCollection ();
+ success = false;
+ captures = new CaptureCollection (0);
}
private bool success;
[Serializable]
public class GroupCollection: ICollection, IEnumerable
{
- private ArrayList list;
+ private Group [] list;
/* No public constructor */
- internal GroupCollection () {
- list = new ArrayList ();
+ internal GroupCollection (int n)
+ {
+ list = new Group [n];
}
public virtual int Count {
- get {
- return(list.Count);
- }
+ get { return list.Length; }
}
public bool IsReadOnly {
- get {
- return(true);
- }
+ get { return true; }
}
public virtual bool IsSynchronized {
- get {
- return(false);
- }
+ get { return false; }
}
- public Group this[int i] {
+ public Group this [int i] {
get {
- if (i < list.Count &&
- i >= 0) {
- return((Group)list[i]);
- } else {
- return(new Group ());
- }
+ if (i < list.Length && i >= 0)
+ return list [i];
+ else
+ return Group.Fail;
}
}
- public Group this[string groupName] {
- get {
- foreach (object o in list) {
- if (!(o is Match)) {
- continue;
- }
-
- int index = ((Match)o).Regex.GroupNumberFromName (groupName);
-
- if (index != -1) {
- return(this[index]);
- }
- }
-
- return(new Group ());
- }
+ internal void SetValue (Group g, int i)
+ {
+ list [i] = g;
}
- public virtual object SyncRoot {
+ public Group this [string groupName] {
get {
- return(list);
- }
- }
+ foreach (Group g in list) {
+ if (!(g is Match))
+ continue;
- public virtual void CopyTo (Array array, int index) {
- foreach (object o in list) {
- if (index > array.Length) {
- break;
+ int index = ((Match)g).Regex.GroupNumberFromName (groupName);
+ if (index != -1)
+ return this [index];
}
- array.SetValue (o, index++);
+ return Group.Fail;
}
}
- public virtual IEnumerator GetEnumerator () {
- return(new Enumerator (list));
- }
-
- internal void Add (object o) {
- list.Add (o);
+ public virtual object SyncRoot {
+ get { return list; }
}
- internal void Reverse () {
- list.Reverse ();
+ public virtual void CopyTo (Array array, int index)
+ {
+ list.CopyTo (array, index);
}
- private class Enumerator: IEnumerator {
- private IList list;
- private int ptr;
-
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count) {
- throw new InvalidOperationException ();
- }
-
- return(list[ptr]);
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count) {
- throw new InvalidOperationException ();
- }
-
- return(++ptr < list.Count);
- }
-
- public void Reset () {
- ptr = -1;
- }
+ public virtual IEnumerator GetEnumerator ()
+ {
+ return list.GetEnumerator ();
}
}
}
get { return empty; }
}
- public static Match Synchronized (Match inner) {
+ public static Match Synchronized (Match inner)
+ {
return inner; // FIXME need to sync on machine access
}
get { return groups; }
}
- public Match NextMatch () {
+ public Match NextMatch ()
+ {
if (this == Empty)
return Empty;
return machine.Scan (regex, Text, scan_ptr, text_length);
}
- public virtual string Result (string replacement) {
+ public virtual string Result (string replacement)
+ {
return ReplacementEvaluator.Evaluate (replacement, this);
}
// internal
- internal Match () : base (null, null) {
+ internal Match () : base ()
+ {
this.regex = null;
this.machine = null;
this.text_length = 0;
- this.groups = new GroupCollection ();
- groups.Add (this);
+ this.groups = new GroupCollection (1);
+ groups.SetValue (this, 0);
}
- internal Match (Regex regex, IMachine machine, string text, int text_length, int[][] grps) :
- base (text, grps[0])
+ internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups,
+ int index, int length, int n_caps) :
+ base (text, index, length, n_caps)
{
this.regex = regex;
this.machine = machine;
this.text_length = text_length;
- this.groups = new GroupCollection ();
- groups.Add (this);
- for (int i = 1; i < grps.Length; ++ i)
- groups.Add (new Group (text, grps[i]));
+ this.groups = new GroupCollection (n_groups);
+ groups.SetValue (this, 0);
}
internal Regex Regex {
return m;
}
- private Match GenerateMatch (Regex regex) {
- int[][] grps = new int[groups.Length][];
- ArrayList caps = new ArrayList ();
-
- for (int gid = 0; gid < groups.Length; ++ gid) {
- caps.Clear ();
- for (int m = groups[gid]; m >= 0; m = marks[m].Previous) {
- if (!marks[m].IsDefined)
- continue;
-
- caps.Add (marks[m].Index);
- caps.Add (marks[m].Length);
+ private void GetGroupInfo (int gid, out int first_mark_index, out int n_caps)
+ {
+ first_mark_index = -1;
+ bool first = true;
+ n_caps = 0;
+ for (int m = groups [gid]; m >= 0; m = marks [m].Previous) {
+ if (!marks [m].IsDefined)
+ continue;
+ ++n_caps;
+ if (first) {
+ first = false;
+ first_mark_index = m;
}
+ }
+ }
- grps[gid] = (int[])caps.ToArray (typeof (int));
+ private void PopulateGroup (Group g, int first_mark_index, int n_caps)
+ {
+ int i = 1;
+ for (int m = marks [first_mark_index].Previous; m >= 0; m = marks [m].Previous) {
+ if (!marks [m].IsDefined)
+ continue;
+ Capture cap = new Capture (text, marks [m].Index, marks [m].Length);
+ g.Captures.SetValue (cap, n_caps - 1 - i);
+ ++i;
}
+ }
- return new Match (regex, this, text, text_end, grps);
+ private Match GenerateMatch (Regex regex)
+ {
+ int n_caps, first_mark_index;
+ Group g;
+ GetGroupInfo (0, out first_mark_index, out n_caps);
+ Match retval = new Match (regex, this, text, text_end, groups.Length,
+ marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps);
+ PopulateGroup (retval, first_mark_index, n_caps);
+
+ for (int gid = 1; gid < groups.Length; ++ gid) {
+ GetGroupInfo (gid, out first_mark_index, out n_caps);
+ if (first_mark_index < 0) {
+ g = Group.Fail;
+ } else {
+ g = new Group (text, marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps);
+ PopulateGroup (g, first_mark_index, n_caps);
+ }
+ retval.Groups.SetValue (g, gid);
+ }
+ return retval;
}
// interpreter attributes
+2005-06-11 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * Uri.cs: Domain address might have trailing period to indicate
+ that the domain name is fully qualified. Fixes bug #75230.
+
2005-06-02 Gert Driesen <drieseng@users.sourceforge.net>
* Uri.cs: throw UriFormatException if URI starts with colon.
{
int len = name.Length;
- if (name [len - 1] == '.')
- return false;
-
int count = 0;
for (int i = 0; i < len; i++) {
char c = name [i];
//
-// Microsoft.CSharp.CSharpCodeProvider.cs
+// Microsoft.CSharp.CSharpCodeProviderTest.cs
//
// Author:
// Gert Driesen (drieseng@users.sourceforge.net)
//
+// (C) 2005 Novell
+//
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
+using System.Globalization;
using System.IO;
using System.Reflection;
-
using Microsoft.CSharp;
-
using NUnit.Framework;
namespace MonoTests.Microsoft.CSharp
[TestFixture]
public class CSharpCodeProviderTest
{
- // NOTE: This test does not clean-up the generated assemblies
+ private string _tempDir;
+ private CodeDomProvider _codeProvider;
+
+ private static readonly string _sourceTest1 = "public class Test1 {}";
+ private static readonly string _sourceTest2 = "public class Test2 {}";
+
+ [SetUp]
+ public void SetUp ()
+ {
+ _codeProvider = new CSharpCodeProvider ();
+ _tempDir = CreateTempDirectory ();
+ }
+
+ [TearDown]
+ public void TearDown ()
+ {
+ RemoveDirectory (_tempDir);
+ }
+
+ [Test]
+ public void FileExtension ()
+ {
+ Assert.AreEqual ("cs", _codeProvider.FileExtension);
+ }
+
+ [Test]
+ public void LanguageOptionsTest ()
+ {
+ Assert.AreEqual (LanguageOptions.None, _codeProvider.LanguageOptions);
+ }
+
+ [Test]
+ public void GeneratorSupports ()
+ {
+ ICodeGenerator codeGenerator = _codeProvider.CreateGenerator ();
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEnums), "#1");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ArraysOfArrays), "#2");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.AssemblyAttributes), "#3");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ChainedConstructorArguments), "#4");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ComplexExpressions), "#5");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareDelegates), "#6");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEnums), "#7");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEvents), "#8");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareInterfaces), "#9");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareValueTypes), "#10");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.EntryPointMethod), "#11");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GotoStatements), "#12");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.MultidimensionalArrays), "#13");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.MultipleInterfaceMembers), "#14");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.NestedTypes), "#15");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ParameterAttributes), "#16");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PublicStaticMembers), "#17");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ReferenceParameters), "#18");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ReturnTypeAttributes), "#19");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.StaticConstructors), "#20");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.TryCatchStatements), "#21");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Win32Resources), "#22");
+#if NET_2_0
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareIndexerProperties), "#23");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeDeclaration), "#24");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeReference), "#25");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PartialTypes), "#26");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Resources), "#27");
+#endif
+ }
+
+ [Test]
+ public void CompileFromFile_InMemory ()
+ {
+ // create source file
+ string sourceFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest1);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromFile (options,
+ sourceFile);
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#4");
+ Assert.AreEqual (sourceFile, tempFiles[0], "#5");
+
+ }
+
+ [Test]
+ public void CompileFromFileBatch_InMemory ()
+ {
+ // create source file
+ string sourceFile1 = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile1, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest1);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ string sourceFile2 = Path.Combine (_tempDir, "file2." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile2, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest2);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
+ new string[] { sourceFile1, sourceFile2 });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test2"), "#4");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#5");
+ Assert.IsTrue (File.Exists (sourceFile1), "#6");
+ Assert.IsTrue (File.Exists (sourceFile2), "#7");
+ }
+
+ [Test]
+ public void CompileFromSource_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromSource (options,
+ _sourceTest1);
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#4");
+ Assert.AreEqual (tempFile, tempFiles[0], "#5");
+ }
+
+ [Test]
+ public void CompileFromSourceBatch_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromSourceBatch (options,
+ new string[] { _sourceTest1, _sourceTest2 });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test2"), "#4");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#5");
+ Assert.AreEqual (tempFile, tempFiles[0], "#6");
+ }
+
+ [Test]
+ public void CompileFromDom_NotInMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ // compile and verify result in separate appdomain to avoid file locks
+ AppDomain testDomain = CreateTestDomain ();
+ CrossDomainTester compileTester = CreateCrossDomainTester (testDomain);
+
+ string outputAssembly = null;
+
+ try {
+ outputAssembly = compileTester.CompileAssemblyFromDom (_tempDir);
+ } finally {
+ AppDomain.Unload (testDomain);
+ }
+
+ // there should be two files in temp dir: temp file and output assembly
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#1");
+ Assert.IsTrue (File.Exists (outputAssembly), "#2");
+ Assert.IsTrue (File.Exists (tempFile), "#3");
+ }
+
[Test]
- public void CompileAssembly_InMemory ()
+ public void CompileFromDomBatch_NotInMemory ()
{
- // NOT in memory
- CompilerResults results = CompileAssembly (false);
- Assert.IsTrue (results.CompiledAssembly.Location.Length != 0, "#1");
- Assert.IsNotNull (results.PathToAssembly, "#2");
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
- // in memory
- results = CompileAssembly (true);
- Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#3");
- Assert.IsNull (results.PathToAssembly, "#4");
+ // compile and verify result in separate appdomain to avoid file locks
+ AppDomain testDomain = CreateTestDomain ();
+ CrossDomainTester compileTester = CreateCrossDomainTester (testDomain);
+
+ string outputAssembly = null;
+ try {
+ outputAssembly = compileTester.CompileAssemblyFromDomBatch (_tempDir);
+ } finally {
+ AppDomain.Unload (testDomain);
+ }
+
+ // there should be two files in temp dir: temp file and output assembly
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#1");
+ Assert.IsTrue (File.Exists (outputAssembly), "#2");
+ Assert.IsTrue (File.Exists (tempFile), "#3");
+ }
+
+ [Test]
+ public void CompileFromDom_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDom (options, new CodeCompileUnit ());
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#3");
+ Assert.AreEqual (tempFile, tempFiles[0], "#4");
}
- private CompilerResults CompileAssembly (bool inMemory)
+ [Test]
+ public void CompileFromDomBatch_InMemory ()
{
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
CompilerParameters options = new CompilerParameters ();
options.GenerateExecutable = false;
- options.GenerateInMemory = inMemory;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDomBatch (options,
+ new CodeCompileUnit[] { new CodeCompileUnit (), new CodeCompileUnit () });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#3");
+ Assert.AreEqual (tempFile, tempFiles[0], "#4");
+ }
+
+ private static string CreateTempDirectory ()
+ {
+ // create a uniquely named zero-byte file
+ string tempFile = Path.GetTempFileName ();
+ // remove the temporary file
+ File.Delete (tempFile);
+ // create a directory named after the unique temporary file
+ Directory.CreateDirectory (tempFile);
+ // return the path to the temporary directory
+ return tempFile;
+ }
+
+ private static void RemoveDirectory (string path)
+ {
+ try {
+ if (Directory.Exists (path)) {
+ string[] directoryNames = Directory.GetDirectories (path);
+ foreach (string directoryName in directoryNames) {
+ RemoveDirectory (directoryName);
+ }
+ string[] fileNames = Directory.GetFiles (path);
+ foreach (string fileName in fileNames) {
+ File.Delete (fileName);
+ }
+ Directory.Delete (path, true);
+ }
+ } catch (Exception ex) {
+ throw new AssertionException ("Unable to cleanup '" + path + "'.", ex);
+ }
+ }
+
+ private static void AssertCompileResults (CompilerResults results, bool allowWarnings)
+ {
+ foreach (CompilerError compilerError in results.Errors) {
+ if (allowWarnings && compilerError.IsWarning) {
+ continue;
+ }
+
+ Assert.Fail (compilerError.ToString ());
+ }
+ }
+
+ private static AppDomain CreateTestDomain ()
+ {
+ return AppDomain.CreateDomain ("CompileFromDom", AppDomain.CurrentDomain.Evidence,
+ AppDomain.CurrentDomain.SetupInformation);
+ }
+
+ private static CrossDomainTester CreateCrossDomainTester (AppDomain domain)
+ {
+ Type testerType = typeof (CrossDomainTester);
+
+ return (CrossDomainTester) domain.CreateInstanceAndUnwrap (
+ testerType.Assembly.FullName, testerType.FullName, false,
+ BindingFlags.Public | BindingFlags.Instance, null, new object[0],
+ CultureInfo.InvariantCulture, new object[0], domain.Evidence);
+ }
+
+ private class CrossDomainTester : MarshalByRefObject
+ {
+ public string CompileAssemblyFromDom (string tempDir)
+ {
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = false;
+ options.TempFiles = new TempFileCollection (tempDir);
+
+ CSharpCodeProvider codeProvider = new CSharpCodeProvider ();
+ ICodeCompiler compiler = codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDom (options, new CodeCompileUnit ());
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.IsTrue (results.CompiledAssembly.Location.Length != 0,
+ "Location should not be empty string");
+ Assert.IsNotNull (results.PathToAssembly, "PathToAssembly should not be null");
+
+ return results.PathToAssembly;
+ }
+
+ public string CompileAssemblyFromDomBatch (string tempDir)
+ {
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = false;
+ options.TempFiles = new TempFileCollection (tempDir);
+
+ CSharpCodeProvider codeProvider = new CSharpCodeProvider ();
+ ICodeCompiler compiler = codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { new CodeCompileUnit (), new CodeCompileUnit () });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.IsTrue (results.CompiledAssembly.Location.Length != 0,
+ "Location should not be empty string");
+ Assert.IsNotNull (results.PathToAssembly, "PathToAssembly should not be null");
- CSharpCodeProvider codeProvider = new CSharpCodeProvider ();
- ICodeCompiler compiler = codeProvider.CreateCompiler ();
- return compiler.CompileAssemblyFromDom (options,
- new CodeCompileUnit ());
+ return results.PathToAssembly;
+ }
}
}
}
+2005-06-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * CSharpCodeProviderTest.cs: added tests for bug #75221 and
+ #75218.
+
+2005-06-09 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * CodeGeneratorFromCompileUnitTest.cs: added test for bug #75190.
+
2005-06-05 Gert Driesen <drieseng@users.sourceforge.net>
* CodeGeneratorFromCompileUnitTest.cs: re-enabled tests as
Assertion.AssertEquals ("[assembly: A()]", Code.Trim ());
}
+ [Test]
+ [Ignore ("Bug #75190")]
+ public void CodeSnippetTest ()
+ {
+ codeUnit = new CodeSnippetCompileUnit ("public class Test1 {}");
+ generator.GenerateCodeFromCompileUnit (codeUnit, writer, options);
+ writer.Close ();
+ Assertion.AssertEquals ("public class Test1 {}" + writer.NewLine, writer.ToString());
+ }
+
/* FIXME
[Test]
public void AttributeWithValueTest ()
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeProviderTest.cs: Marked tests NotWorking on 2.0 profile
+ as we don't yet have an mbas for that profile.
+
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeProviderTest.cs: fixed line endings
+
+2005-06-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeProviderTest.cs: improve reporting of test failures as a
+ result of compile errors. Added a ICodeGenerator.Supports tests
+ for .NET 2.0.
+
+2005-06-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeProviderTest.cs: removed unnecessary test, added test
+ for ICodeGenerator.Supports.
+
+2005-06-09 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * VBCodeProviderTest.cs: added batch of tests that check whether
+ temporary files are cleaned up, compile multiple sources/compile units
+ and files. Use separate AppDomain for tests that actually loaded
+ the compiled assembly, to ensure no test output is left on the system.
+
2005-06-05 Gert Driesen <drieseng@users.sourceforge.net>
* VBCodeProviderTest.cs: moved to using NUnit 2.x Assert, improve
-//\r
-// Microsoft.VisualBasic.VBCodeProvider.cs\r
-//\r
-// Author:\r
-// Jochen Wezel (jwezel@compumaster.de) //\r
-//\r
-// (C) 2003 Jochen Wezel (CompuMaster GmbH)\r
-//\r
-// Last modifications:\r
-// 2003-12-10 JW: publishing of this file\r
-//\r
-\r
-using NUnit.Framework;\r
-using System;\r
-using Microsoft.VisualBasic;\r
-using System.CodeDom;\r
-using System.CodeDom.Compiler;\r
-using System.ComponentModel;\r
-using System.Collections.Specialized;\r
-using System.Reflection;\r
-using System.Diagnostics;\r
-using System.IO;\r
-\r
-namespace MonoTests.Microsoft.VisualBasic\r
-{\r
-\r
- enum OsType {\r
- Windows,\r
- Unix,\r
- Mac\r
- }\r
-\r
- [TestFixture]\r
- public class VBCodeProviderTest {\r
- \r
- CodeDomProvider MyVBCodeProvider;\r
- static OsType OS;\r
- static char DSC = Path.DirectorySeparatorChar;\r
-\r
- [SetUp]\r
- public void GetReady() { \r
- if ('/' == DSC) {\r
- OS = OsType.Unix;\r
- } else if ('\\' == DSC) {\r
- OS = OsType.Windows;\r
- } else {\r
- OS = OsType.Mac;\r
- }\r
-\r
- MyVBCodeProvider = new VBCodeProvider(); \r
- }\r
-\r
- [Test]\r
- public void FileExtension ()\r
- {\r
- Assert.AreEqual("vb", MyVBCodeProvider.FileExtension, "#JW10");\r
- }\r
-\r
- [Test]\r
- public void LanguageOptionsTest ()\r
- {\r
- Assert.AreEqual(LanguageOptions.CaseInsensitive, MyVBCodeProvider.LanguageOptions, "#JW20");\r
- }\r
-\r
- [Test]\r
- public void CreateCompiler()\r
- {\r
- // prepare the compilation\r
- ICodeCompiler MyVBCodeCompiler = MyVBCodeProvider.CreateCompiler();\r
- Assert.IsNotNull(MyVBCodeCompiler, "#JW30 - CreateCompiler");\r
- \r
- CompilerParameters options = new CompilerParameters();\r
- options.GenerateExecutable = true;\r
- options.IncludeDebugInformation = true;\r
- options.TreatWarningsAsErrors = true;\r
- \r
- // process compilation\r
- CompilerResults MyVBCodeCompilerResults = MyVBCodeCompiler.CompileAssemblyFromSource(options,\r
- "public class TestModule" + Environment.NewLine + "public shared sub Main()" \r
- + Environment.NewLine + "System.Console.Write(\"Hello world!\")" \r
- + Environment.NewLine + "End Sub" + Environment.NewLine + "End Class");\r
-\r
- // verify outcome of compilation\r
- if (MyVBCodeCompilerResults.Errors.Count > 0) {\r
- Assert.Fail("Hello World compilation failed: " + MyVBCodeCompilerResults.Errors[0].ToString());\r
- }\r
-\r
- try\r
- {\r
- Assembly MyAss = MyVBCodeCompilerResults.CompiledAssembly;\r
- }\r
- catch (Exception ex)\r
- {\r
- Assert.Fail("#JW32 - MyVBCodeCompilerResults.CompiledAssembly hasn't been an expected object" + \r
- Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace);\r
- }\r
-\r
- // Execute the test app\r
- ProcessStartInfo NewProcInfo = new ProcessStartInfo();\r
- if (Windows) {\r
- NewProcInfo.FileName = MyVBCodeCompilerResults.CompiledAssembly.Location;\r
- }\r
- else {\r
- NewProcInfo.FileName = "mono";\r
- NewProcInfo.Arguments = MyVBCodeCompilerResults.CompiledAssembly.Location;\r
- }\r
- NewProcInfo.RedirectStandardOutput = true;\r
- NewProcInfo.UseShellExecute = false;\r
- NewProcInfo.CreateNoWindow = true;\r
- string TestAppOutput = "";\r
-\r
- try\r
- {\r
- Process MyProc = Process.Start(NewProcInfo);\r
- MyProc.WaitForExit();\r
- TestAppOutput = MyProc.StandardOutput.ReadToEnd();\r
- MyProc.Close();\r
- MyProc.Dispose();\r
- }\r
- catch (Exception ex)\r
- {\r
- Assert.Fail("#JW34 - " + ex.Message + Environment.NewLine + ex.StackTrace);\r
- }\r
- \r
- Assert.AreEqual("Hello world!", TestAppOutput, "#JW33 - Application output");\r
-\r
- // Clean up\r
- try\r
- {\r
- File.Delete (NewProcInfo.FileName);\r
- }\r
- catch {}\r
- }\r
-\r
- // NOTE: This test does not clean-up the generated assemblies\r
- [Test]\r
- public void CompileAssembly_InMemory ()\r
- {\r
- // NOT in memory\r
- CompilerResults results = CompileAssembly (false);\r
- Assert.IsTrue(results.CompiledAssembly.Location.Length != 0, "#1");\r
- Assert.IsNotNull(results.PathToAssembly, "#2");\r
-\r
- // in memory\r
- results = CompileAssembly (true);\r
- Assert.AreEqual(string.Empty, results.CompiledAssembly.Location, "#3");\r
- Assert.IsNull(results.PathToAssembly, "#4");\r
- }\r
-\r
- [Test]\r
- public void CreateGenerator()\r
- {\r
- ICodeGenerator MyVBCodeGen;\r
- MyVBCodeGen = MyVBCodeProvider.CreateGenerator();\r
- Assert.IsNotNull(MyVBCodeGen, "#JW40 - CreateGenerator");\r
- Assert.IsTrue(MyVBCodeGen.Supports(GeneratorSupport.DeclareEnums), "#JW41");\r
- }\r
-\r
- \r
- //TODO: [Test]\r
- public void CreateParser()\r
- {\r
- //System.CodeDom.Compiler.ICodeParser CreateParser()\r
- }\r
-\r
- //TODO: [Test]\r
- public void CreateObjRef()\r
- {\r
- //System.Runtime.Remoting.ObjRef CreateObjRef(System.Type requestedType)\r
- }\r
-\r
- bool Windows\r
- {\r
- get {\r
- return OS == OsType.Windows;\r
- }\r
- }\r
-\r
- bool Unix\r
- {\r
- get {\r
- return OS == OsType.Unix;\r
- }\r
- }\r
-\r
- bool Mac\r
- {\r
- get {\r
- return OS == OsType.Mac;\r
- }\r
- }\r
-\r
- private CompilerResults CompileAssembly(bool inMemory) {\r
- CompilerParameters options = new CompilerParameters();\r
- options.GenerateExecutable = false;\r
- options.GenerateInMemory = inMemory;\r
-\r
- VBCodeProvider codeProvider = new VBCodeProvider();\r
- ICodeCompiler compiler = codeProvider.CreateCompiler();\r
- return compiler.CompileAssemblyFromDom(options,\r
- new CodeCompileUnit());\r
- }\r
- }\r
-}\r
+//
+// Microsoft.VisualBasic.VBCodeProvider.cs
+//
+// Author:
+// Jochen Wezel (jwezel@compumaster.de)
+//
+// (C) 2003 Jochen Wezel (CompuMaster GmbH)
+//
+// Last modifications:
+// 2003-12-10 JW: publishing of this file
+//
+
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.Collections.Specialized;
+using System.Globalization;
+using System.Reflection;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using Microsoft.VisualBasic;
+using NUnit.Framework;
+
+namespace MonoTests.Microsoft.VisualBasic
+{
+ enum OsType
+ {
+ Windows,
+ Unix,
+ Mac
+ }
+
+ [TestFixture]
+ public class VBCodeProviderTest
+ {
+ private string _tempDir;
+ private CodeDomProvider _codeProvider;
+ private static OsType OS;
+ private static char DSC = Path.DirectorySeparatorChar;
+
+ private static readonly string _sourceTest1 = "Public Class Test1" +
+ Environment.NewLine + "End Class";
+ private static readonly string _sourceTest2 = "Public Class Test2" +
+ Environment.NewLine + "End Class";
+
+ [SetUp]
+ public void GetReady ()
+ {
+ if ('/' == DSC) {
+ OS = OsType.Unix;
+ } else if ('\\' == DSC) {
+ OS = OsType.Windows;
+ } else {
+ OS = OsType.Mac;
+ }
+
+ _codeProvider = new VBCodeProvider ();
+ _tempDir = CreateTempDirectory ();
+ }
+
+ [TearDown]
+ public void TearDown ()
+ {
+ RemoveDirectory (_tempDir);
+ }
+
+ [Test]
+ public void FileExtension ()
+ {
+ Assert.AreEqual ("vb", _codeProvider.FileExtension, "#JW10");
+ }
+
+ [Test]
+ public void LanguageOptionsTest ()
+ {
+ Assert.AreEqual (LanguageOptions.CaseInsensitive, _codeProvider.LanguageOptions, "#JW20");
+ }
+
+ [Test]
+ public void GeneratorSupports ()
+ {
+ ICodeGenerator codeGenerator = _codeProvider.CreateGenerator ();
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEnums), "#1");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ArraysOfArrays), "#2");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.AssemblyAttributes), "#3");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ChainedConstructorArguments), "#4");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ComplexExpressions), "#5");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareDelegates), "#6");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEnums), "#7");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareEvents), "#8");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareInterfaces), "#9");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareValueTypes), "#10");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.EntryPointMethod), "#11");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GotoStatements), "#12");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.MultidimensionalArrays), "#13");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.MultipleInterfaceMembers), "#14");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.NestedTypes), "#15");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ParameterAttributes), "#16");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PublicStaticMembers), "#17");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ReferenceParameters), "#18");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.ReturnTypeAttributes), "#19");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.StaticConstructors), "#20");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.TryCatchStatements), "#21");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Win32Resources), "#22");
+#if NET_2_0
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.DeclareIndexerProperties), "#23");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeDeclaration), "#24");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.GenericTypeReference), "#25");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.PartialTypes), "#26");
+ Assert.IsTrue (codeGenerator.Supports (GeneratorSupport.Resources), "#27");
+#endif
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#else
+ [Ignore ("Bug #75223")]
+#endif
+ public void CreateCompiler ()
+ {
+ // Prepare the compilation
+ ICodeCompiler codeCompiler = _codeProvider.CreateCompiler ();
+ Assert.IsNotNull (codeCompiler, "#JW30 - CreateCompiler");
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = true;
+ options.IncludeDebugInformation = true;
+ options.TreatWarningsAsErrors = true;
+
+ // process compilation
+ CompilerResults compilerResults = codeCompiler.CompileAssemblyFromSource (options,
+ "public class TestModule" + Environment.NewLine + "public shared sub Main()"
+ + Environment.NewLine + "System.Console.Write(\"Hello world!\")"
+ + Environment.NewLine + "End Sub" + Environment.NewLine + "End Class");
+
+ // Analyse the compilation success/messages
+ StringCollection MyOutput = compilerResults.Output;
+ string MyOutStr = "";
+ foreach (string MyStr in MyOutput) {
+ MyOutStr += MyStr + Environment.NewLine + Environment.NewLine;
+ }
+
+ if (compilerResults.Errors.Count != 0) {
+ Assert.Fail ("#JW31 - Hello world compilation: " + MyOutStr);
+ }
+
+ try {
+ Assembly MyAss = compilerResults.CompiledAssembly;
+ } catch (Exception ex) {
+ Assert.Fail ("#JW32 - compilerResults.CompiledAssembly hasn't been an expected object" +
+ Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace);
+ }
+
+ // Execute the test app
+ ProcessStartInfo NewProcInfo = new ProcessStartInfo ();
+ if (Windows) {
+ NewProcInfo.FileName = compilerResults.CompiledAssembly.Location;
+ } else {
+ NewProcInfo.FileName = "mono";
+ NewProcInfo.Arguments = compilerResults.CompiledAssembly.Location;
+ }
+ NewProcInfo.RedirectStandardOutput = true;
+ NewProcInfo.UseShellExecute = false;
+ NewProcInfo.CreateNoWindow = true;
+ string TestAppOutput = "";
+ try {
+ Process MyProc = Process.Start (NewProcInfo);
+ MyProc.WaitForExit ();
+ TestAppOutput = MyProc.StandardOutput.ReadToEnd ();
+ MyProc.Close ();
+ MyProc.Dispose ();
+ } catch (Exception ex) {
+ Assert.Fail ("#JW34 - " + ex.Message + Environment.NewLine + ex.StackTrace);
+ }
+ Assert.AreEqual ("Hello world!", TestAppOutput, "#JW33 - Application output");
+
+ // Clean up
+ try {
+ File.Delete (NewProcInfo.FileName);
+ } catch { }
+ }
+
+ [Test]
+ public void CreateGenerator ()
+ {
+ ICodeGenerator MyVBCodeGen;
+ MyVBCodeGen = _codeProvider.CreateGenerator ();
+ Assert.IsNotNull (MyVBCodeGen, "#JW40 - CreateGenerator");
+ Assert.IsTrue (MyVBCodeGen.Supports (GeneratorSupport.DeclareEnums), "#JW41");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromFile_InMemory ()
+ {
+ // create vb source file
+ string sourceFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest1);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromFile (options,
+ sourceFile);
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#4");
+ Assert.AreEqual (sourceFile, tempFiles[0], "#5");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromFileBatch_InMemory ()
+ {
+ // create vb source file
+ string sourceFile1 = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile1, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest1);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ string sourceFile2 = Path.Combine (_tempDir, "file2." + _codeProvider.FileExtension);
+ using (FileStream f = new FileStream (sourceFile2, FileMode.Create)) {
+ using (StreamWriter s = new StreamWriter (f)) {
+ s.Write (_sourceTest2);
+ s.Close ();
+ }
+ f.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromFileBatch (options,
+ new string[] { sourceFile1, sourceFile2 });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test2"), "#4");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#5");
+ Assert.IsTrue (File.Exists (sourceFile1), "#6");
+ Assert.IsTrue (File.Exists (sourceFile2), "#7");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromSource_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromSource (options,
+ _sourceTest1);
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#4");
+ Assert.AreEqual (tempFile, tempFiles[0], "#5");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromSourceBatch_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromSourceBatch (options,
+ new string[] { _sourceTest1, _sourceTest2 });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test1"), "#3");
+ Assert.IsNotNull (results.CompiledAssembly.GetType ("Test2"), "#4");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#5");
+ Assert.AreEqual (tempFile, tempFiles[0], "#6");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromDom_NotInMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ // compile and verify result in separate appdomain to avoid file locks
+ AppDomain testDomain = CreateTestDomain ();
+ CrossDomainTester compileTester = CreateCrossDomainTester (testDomain);
+
+ string outputAssembly = null;
+
+ try {
+ outputAssembly = compileTester.CompileAssemblyFromDom (_tempDir);
+ } finally {
+ AppDomain.Unload (testDomain);
+ }
+
+ // there should be two files in temp dir: temp file and output assembly
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#1");
+ Assert.IsTrue (File.Exists (outputAssembly), "#2");
+ Assert.IsTrue (File.Exists (tempFile), "#3");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromDomBatch_NotInMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ // compile and verify result in separate appdomain to avoid file locks
+ AppDomain testDomain = CreateTestDomain ();
+ CrossDomainTester compileTester = CreateCrossDomainTester (testDomain);
+
+ string outputAssembly = null;
+
+ try {
+ outputAssembly = compileTester.CompileAssemblyFromDomBatch (_tempDir);
+ } finally {
+ AppDomain.Unload (testDomain);
+ }
+
+ // there should be two files in temp dir: temp file and output assembly
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (2, tempFiles.Length, "#1");
+ Assert.IsTrue (File.Exists (outputAssembly), "#2");
+ Assert.IsTrue (File.Exists (tempFile), "#3");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromDom_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDom (options, new CodeCompileUnit ());
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#3");
+ Assert.AreEqual (tempFile, tempFiles[0], "#4");
+ }
+
+ [Test]
+#if NET_2_0
+ // there's not yet an mbas for the 2.0 profile
+ [Category ("NotWorking")]
+#endif
+ public void CompileFromDomBatch_InMemory ()
+ {
+ // create a file in temp directory to ensure that compiler is not removing
+ // too much (temporary) files
+ string tempFile = Path.Combine (_tempDir, "file." + _codeProvider.FileExtension);
+ using (FileStream fs = File.Create (tempFile)) {
+ fs.Close ();
+ }
+
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = true;
+ options.TempFiles = new TempFileCollection (_tempDir);
+
+ ICodeCompiler compiler = _codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDomBatch (options,
+ new CodeCompileUnit[] { new CodeCompileUnit (), new CodeCompileUnit () });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.AreEqual (string.Empty, results.CompiledAssembly.Location, "#1");
+ Assert.IsNull (results.PathToAssembly, "#2");
+
+ // verify we don't cleanup files in temp directory too agressively
+ string[] tempFiles = Directory.GetFiles (_tempDir);
+ Assert.AreEqual (1, tempFiles.Length, "#3");
+ Assert.AreEqual (tempFile, tempFiles[0], "#4");
+ }
+
+ //TODO: [Test]
+ public void CreateParser ()
+ {
+ //System.CodeDom.Compiler.ICodeParser CreateParser()
+ }
+
+ //TODO: [Test]
+ public void CreateObjRef ()
+ {
+ //System.Runtime.Remoting.ObjRef CreateObjRef(System.Type requestedType)
+ }
+
+ bool Windows
+ {
+ get {
+ return OS == OsType.Windows;
+ }
+ }
+
+ bool Unix
+ {
+ get {
+ return OS == OsType.Unix;
+ }
+ }
+
+ bool Mac
+ {
+ get {
+ return OS == OsType.Mac;
+ }
+ }
+
+ private static string CreateTempDirectory ()
+ {
+ // create a uniquely named zero-byte file
+ string tempFile = Path.GetTempFileName ();
+ // remove the temporary file
+ File.Delete (tempFile);
+ // create a directory named after the unique temporary file
+ Directory.CreateDirectory (tempFile);
+ // return the path to the temporary directory
+ return tempFile;
+ }
+
+ private static void RemoveDirectory (string path)
+ {
+ try {
+ if (Directory.Exists (path)) {
+ string[] directoryNames = Directory.GetDirectories (path);
+ foreach (string directoryName in directoryNames) {
+ RemoveDirectory (directoryName);
+ }
+ string[] fileNames = Directory.GetFiles (path);
+ foreach (string fileName in fileNames) {
+ File.Delete (fileName);
+ }
+ Directory.Delete (path, true);
+ }
+ } catch (Exception ex) {
+ throw new AssertionException ("Unable to cleanup '" + path + "'.", ex);
+ }
+ }
+
+ private static void AssertCompileResults (CompilerResults results, bool allowWarnings)
+ {
+ foreach (CompilerError compilerError in results.Errors) {
+ if (allowWarnings && compilerError.IsWarning) {
+ continue;
+ }
+
+ Assert.Fail (compilerError.ToString ());
+ }
+ }
+
+ private static AppDomain CreateTestDomain ()
+ {
+ return AppDomain.CreateDomain ("CompileFromDom", AppDomain.CurrentDomain.Evidence,
+ AppDomain.CurrentDomain.SetupInformation);
+ }
+
+ private static CrossDomainTester CreateCrossDomainTester (AppDomain domain)
+ {
+ Type testerType = typeof (CrossDomainTester);
+
+ return (CrossDomainTester) domain.CreateInstanceAndUnwrap (
+ testerType.Assembly.FullName, testerType.FullName, false,
+ BindingFlags.Public | BindingFlags.Instance, null, new object[0],
+ CultureInfo.InvariantCulture, new object[0], domain.Evidence);
+ }
+
+ private class CrossDomainTester : MarshalByRefObject
+ {
+ public string CompileAssemblyFromDom (string tempDir)
+ {
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = false;
+ options.TempFiles = new TempFileCollection (tempDir);
+
+ VBCodeProvider codeProvider = new VBCodeProvider ();
+ ICodeCompiler compiler = codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDom (options, new CodeCompileUnit ());
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.IsTrue (results.CompiledAssembly.Location.Length != 0,
+ "Location should not be empty string");
+ Assert.IsNotNull (results.PathToAssembly, "PathToAssembly should not be null");
+
+ return results.PathToAssembly;
+ }
+
+ public string CompileAssemblyFromDomBatch (string tempDir)
+ {
+ CompilerParameters options = new CompilerParameters ();
+ options.GenerateExecutable = false;
+ options.GenerateInMemory = false;
+ options.TempFiles = new TempFileCollection (tempDir);
+
+ VBCodeProvider codeProvider = new VBCodeProvider ();
+ ICodeCompiler compiler = codeProvider.CreateCompiler ();
+ CompilerResults results = compiler.CompileAssemblyFromDomBatch (options, new CodeCompileUnit[] { new CodeCompileUnit (), new CodeCompileUnit () });
+
+ // verify compilation was successful
+ AssertCompileResults (results, true);
+
+ Assert.IsTrue (results.CompiledAssembly.Location.Length != 0,
+ "Location should not be empty string");
+ Assert.IsNotNull (results.PathToAssembly, "PathToAssembly should not be null");
+
+ return results.PathToAssembly;
+ }
+ }
+ }
+}
+2005-06-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * TraceTest.cs: Fixed test failure.
+
2005-05-31 Sebastien Pouliot <sebastien@ximian.com>
* EventLogPermissionAttributeTest.cs: Character #133 is refused into
t2.Join ();
Assert.IsTrue (m.Exception == null, m.Exception);
- Assert.IsTrue (m.listener.WriteLines < MultiThreadModify.MaxIterations,
+ Assert.AreEqual (MultiThreadModify.MaxIterations, m.listener.WriteLines,
"#tmtm: listener was removed before iterations were completed");
}
}
+2005-06-11 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * UriTest.cs: modify tests to reflect fix for bug #75230.
+
2005-06-03 Gert Driesen <drieseng@users.sourceforge.net>
* UriTest.cs: modify tests to reflect fixes in .NET 2.0.
[Category("NotDotNet")]
public void CheckHostName1 ()
{
- // reported to MSDN Product Feedback Center (FDBK28674)
- AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com."));
// reported to MSDN Product Feedback Center (FDBK28671)
AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
}
AssertEquals ("#8", UriHostNameType.Dns, Uri.CheckHostName ("9001.002.03.4"));
AssertEquals ("#9", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"));
AssertEquals ("#10", UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"));
+ AssertEquals ("#11", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com."));
AssertEquals ("#12", UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"));
AssertEquals ("#13", UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"));
AssertEquals ("#14", UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"));
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * corlib_test.dll.sources: Added unit tests for System.Security.
+ Policy.StrongNameMembershipCondition.
+
+2005-06-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * corlib_test.dll.sources: Added unit tests (normal and CAS) for
+ System.Runtime.InteropServices.RuntimeEnvironment.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * corlib.dll.sources: Some System.Reflection classes got renamed in net 2.0
+ beta 2.
+
2005-06-04 Ben Maurer <bmaurer@ximian.com>
* corlib.dll.sources: IEqualityComparer, etc
+2005-06-12 Ben Maurer <bmaurer@ximian.com>
+
+ * Comparer.cs, EqualityComparer.cs: Important performance hack:
+ make sure that we don't box stuff and do reflection on every
+ comparison. We use reflection at cctor time rather than on every
+ request.
+
+2005-06-09 Raja R Harinath <rharinath@novell.com>
+
+ Simplify Enumerator.MoveNext to make it "obviously correct", rather
+ than require subtle reasoning about the state of various variables.
+ * Dictionary.cs (Enumerator._isValid): Remove. Replace all uses
+ with "_current == null".
+ (Enumerator._validNodeVisited): Remove.
+ (Enumerator._next): New. Holds the the next position.
+ (Enumerator.FixNest): New helper function that ensures that _next
+ has the right value.
+ (Enumerator.MoveNext): Simplify. Now, copies _next to _current
+ and advances _next if possible.
+
+2005-06-08 Martin Baulig <martin@ximian.com>
+
+ * Dictionary.cs (Dictionary.KeyEnumerator): Removed the public
+ GetEnumerator() function since it's returning the wrong type.
+ (Dictionary.ValueEnumerator): Likewise. Fix #75073.
+
+2005-06-08 Ankit Jain <ankit@corewars.org>
+
+ * Dictionary.cs (Dictionary<TKey, TValue>.MoveNext): Allow traversal of chain in last slot
+ of the table. Fixes #75168.
+
2005-06-04 Ben Maurer <bmaurer@ximian.com>
* *.cs: 2.0 api fixups
namespace System.Collections.Generic {
[Serializable]
public abstract class Comparer<T> : IComparer<T>, System.Collections.IComparer {
-
+
+ static Comparer ()
+ {
+ if (typeof (IComparable<T>).IsAssignableFrom (typeof (T)))
+ _default = (Comparer<T>) Activator.CreateInstance (typeof (IComparableOfTComparer <>).BindGenericParameters (new Type [] { typeof (T) }));
+ else
+ _default = new DefaultComparer ();
+ }
+
+
public abstract int Compare (T x, T y);
- static DefaultComparer _default;
+ static readonly Comparer <T> _default;
- [MonoTODO ("This is going to make a really slow comparer. We need to speed this up if T : ICompareable<T> create a class with a where clause of T : ICompareable <T>")]
- public static Comparer<T> Default {
+ public static Comparer <T> Default {
get {
- if (_default != null)
- return _default;
- return _default = new DefaultComparer ();
+ return _default;
}
}
}
}
}
+
+ class IComparableOfTComparer <T> : Comparer <T> where T : IComparable {
+ public override int Compare (T x, T y)
+ {
+ // `null' is less than any other ref type
+ if (x == null)
+ return y == null ? 0 : -1;
+ else if (y == null)
+ return 1;
+
+ return x.CompareTo (y);
+ }
+ }
}
#endif
public struct Enumerator : IEnumerator<KeyValuePair<TKey,TValue>>,
IDisposable, IDictionaryEnumerator, IEnumerator
{
- Dictionary<TKey, TValue> _dictionary;
+ Slot [] _dictionaryTable;
+ EnumerationMode _navigationMode;
+
Slot _current;
+ Slot _next;
int _index;
- int _validNodeVisited;
- bool _isValid;
- EnumerationMode _navigationMode;
-
-
public Enumerator (Dictionary<TKey, TValue> dictionary) : this (dictionary, EnumerationMode.KeyValuePair)
{
public Enumerator (Dictionary<TKey, TValue> dictionary, EnumerationMode mode)
{
+ _dictionaryTable = dictionary._table;
+ _navigationMode = mode;
+
+ // The following stanza is identical to IEnumerator.Reset (), but because of the
+ // definite assignment rule, we cannot call it here.
_index = 0;
_current = null;
- _validNodeVisited = 0;
- _dictionary = dictionary;
- _isValid = false;
- _navigationMode = mode;
+ _next = _dictionaryTable [_index];
+ FixNext ();
}
-
+
public bool MoveNext ()
{
- if (_validNodeVisited == _dictionary.Count)
- return (_isValid = false);
-
- while (_index < _dictionary._table.Length) {
- if (_current == null)
- _current = _dictionary._table [_index++];
- else
- _current = _current.next;
-
- if (_current != null) {
- ++_validNodeVisited;
- return (_isValid = true);
- }
+ _current = _next;
+ if (_next == null)
+ return false;
+ _next = _next.next;
+ FixNext ();
+ return true;
+ }
+
+ void FixNext ()
+ {
+ // _next == null ==> _next fell off the end of the chain pointed by _index.
+ while (_next == null) {
+ if (++_index >= _dictionaryTable.Length)
+ break;
+ _next = _dictionaryTable [_index];
}
-
- return (_isValid = false);
}
-
+
public KeyValuePair<TKey, TValue> Current {
get {
- if (!_isValid) throw new InvalidOperationException ();
+ if (_current == null)
+ throw new InvalidOperationException ();
KeyValuePair<TKey, TValue> kv = new KeyValuePair<TKey, TValue> (_current.Key, _current.Value);
return kv;
}
object IEnumerator.Current {
get {
- if (!_isValid) throw new InvalidOperationException ();
+ if (_current == null)
+ throw new InvalidOperationException ();
switch (_navigationMode) {
case EnumerationMode.Key:
return _current.Key as object;
{
get
{
- if (!_isValid) throw new InvalidOperationException ();
+ if (_current == null)
+ throw new InvalidOperationException ();
DictionaryEntry entry = new DictionaryEntry (_current.Key, _current.Value);
return entry;
}
{
_index = 0;
_current = null;
- _isValid = false;
- _validNodeVisited = 0;
+ _next = _dictionaryTable [_index];
+ FixNext ();
}
object IDictionaryEnumerator.Key
{
get
{
- if (!_isValid) throw new InvalidOperationException ();
+ if (_current == null)
+ throw new InvalidOperationException ();
return _current.Key;
}
}
{
get
{
- if (!_isValid) throw new InvalidOperationException ();
+ if (_current == null)
+ throw new InvalidOperationException ();
return _current.Value;
}
}
}
}
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (_dictionary);
- }
-
IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator ()
{
return new KeyEnumerator (_dictionary);
}
}
- public Enumerator GetEnumerator ()
- {
- return new Enumerator (_dictionary);
- }
-
IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator ()
{
return new ValueEnumerator (_dictionary);
namespace System.Collections.Generic {
[Serializable]
- public abstract class EqualityComparer<T> : IEqualityComparer<T> {
-
+ public abstract class EqualityComparer <T> : IEqualityComparer <T> {
+
+ static EqualityComparer ()
+ {
+ if (typeof (IEquatable <T>).IsAssignableFrom (typeof (T)))
+ _default = (EqualityComparer <T>) Activator.CreateInstance (typeof (IEquatableOfTEqualityComparer <>).BindGenericParameters (new Type [] { typeof (T) }));
+ else
+ _default = new DefaultComparer ();
+ }
+
+
public abstract int GetHashCode (T obj);
public abstract bool Equals (T x, T y);
- static DefaultComparer _default;
+ static readonly EqualityComparer <T> _default;
- [MonoTODO ("This is going to make a really slow comparer. We need to speed this up if T : ICompareable<T> create a class with a where clause of T : ICompareable <T>")]
- public static EqualityComparer<T> Default {
+ public static EqualityComparer <T> Default {
get {
- if (_default != null)
- return _default;
- return _default = new DefaultComparer ();
+ return _default;
}
}
public override bool Equals (T x, T y)
{
- return Object.Equals (x, y);
+ if (x == null)
+ return y == null;
+
+ return x.Equals (y);
}
}
}
+
+ class IEquatableOfTEqualityComparer <T> : EqualityComparer <T> where T : IEquatable <T> {
+ public override int GetHashCode (T obj)
+ {
+ return obj.GetHashCode ();
+ }
+
+ public override bool Equals (T x, T y)
+ {
+ if (x == null)
+ return y == null;
+
+ return x.Equals (y);
+ }
+ }
}
#endif
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Hashtable.cs: Add some missing 2.0 attributes.
+
2005-05-26 Ben Maurer <bmaurer@ximian.com>
* Queue.cs (grow): fix 61919.
}
#if NET_2_0
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
#endif
public virtual void Remove (Object key)
{
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * CultureInfo.cs: added internal method to check for a culture
+ valid for formatting. Correctly get the calendar type. Before
+ it was always type 0. Thanks to Mcs for pointing this out.
+
2005-05-06 Miguel de Icaza <miguel@novell.com>
* CultureInfo.cs: Eliminate double-check lock always init the invariant_culture_info.
static volatile CultureInfo invariant_culture_info;
const int NumOptionalCalendars = 5;
- const int CalendarTypeMask = 0xFF;
+ const int GregorianTypeMask = 0x00FFFFFF;
const int CalendarTypeBits = 24;
bool m_isReadOnly;
}
}
+ internal void CheckNeutral ()
+ {
+ if (IsNeutralCulture) {
+ throw new NotSupportedException ("Culture \"" + m_name + "\" is " +
+ "a neutral culture. It can not be used in formatting " +
+ "and parsing and therefore cannot be set as the thread's " +
+ "current culture.");
+ }
+ }
+
public virtual NumberFormatInfo NumberFormat {
get {
if (!constructed) Construct ();
- if (IsNeutralCulture) {
- throw new NotSupportedException ("Culture \"" + m_name + "\" is " +
- "a neutral culture. It can not be used in formatting " +
- "and parsing and therefore cannot be set as the thread's " +
- "current culture.");
- }
+ CheckNeutral ();
if (numInfo == null){
lock (this){
if (numInfo == null) {
get
{
if (!constructed) Construct ();
- if (IsNeutralCulture) {
- throw new NotSupportedException ("Culture \"" + m_name + "\" is " +
- "a neutral culture. It can not be used in formatting " +
- "and parsing and therefore cannot be set as the thread's " +
- "current culture.");
- }
+ CheckNeutral ();
if (dateTimeInfo == null)
{
lock (this)
for (int i=0; i<NumOptionalCalendars; i++) {
Calendar cal = null;
- switch (*(calendar_data + i) & CalendarTypeMask >> CalendarTypeBits) {
+ int caldata = *(calendar_data + i);
+ int caltype = (caldata >> CalendarTypeBits);
+ switch (caltype) {
case 0:
- int gt = (*(calendar_data + i) & CalendarTypeMask);
- GregorianCalendarTypes type = (GregorianCalendarTypes) gt;
- cal = new GregorianCalendar (type);
+ GregorianCalendarTypes greg_type;
+ greg_type = (GregorianCalendarTypes) (caldata & GregorianTypeMask);
+ cal = new GregorianCalendar (greg_type);
break;
case 1:
cal = new HijriCalendar ();
cal = new ThaiBuddhistCalendar ();
break;
default:
- throw new Exception ("invalid calendar type: " + *(calendar_data + i));
+ throw new Exception ("invalid calendar type: " + caldata);
}
optional_calendars [i] = cal;
}
}
}
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_AssemblyBuilder))]
+#endif
public sealed class AssemblyBuilder : Assembly {
#region Sync with reflection.h
private IntPtr dynamic_assembly;
private RefEmitPermissionSet[] permissions_minimum;
private RefEmitPermissionSet[] permissions_optional;
private RefEmitPermissionSet[] permissions_refused;
- PortableExecutableKind peKind;
+ PortableExecutableKinds peKind;
ImageFileMachine machine;
bool corlib_internal;
#endregion
#else
internal
#endif
- void Save (string assemblyFileName, PortableExecutableKind portableExecutableKind, ImageFileMachine imageFileMachine)
+ void Save (string assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
{
this.peKind = portableExecutableKind;
this.machine = imageFileMachine;
public void Save (string assemblyFileName)
{
- Save (assemblyFileName, PortableExecutableKind.ILOnly, ImageFileMachine.I386);
+ Save (assemblyFileName, PortableExecutableKinds.ILOnly, ImageFileMachine.I386);
}
public void SetEntryPoint (MethodInfo entryMethod)
}
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute ( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection.Emit
{
#if NET_2_0
-#else
- [Flags]
+ [ComVisible (true)]
#endif
+ [Flags]
public enum AssemblyBuilderAccess
{
Run = 1,
Save = 2,
RunAndSave = 3
+#if NET_2_0
+ ,
+ ReflectionOnly = 6
+#endif
}
}
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * FieldBuilder.cs: FieldBuilder.FieldHandle should throw
+ NotSupportedException to match MS.NET (both 1.x and 2.x).
+ Fixes regression introduced in r45750.
+ * MethodBuilder.cs: MethodBuilder.MethodHandle should throw
+ NotSupportedException to match MS.NET (both 1.x and 2.x).
+ Fixes regression introduced in r45750.
+
+2005-06-09 Kamil Skalski <nazgul@nemerle.org>
+ * ConstructorBuilder.cs FieldBuilders.cs MethodBuilder.cs: Return
+ RuntimeHandles when requested
+
+ * TypeBuilder.cs: Add static Get{Method,Constructor,Field} methods
+ from .NET 2.0 beta 2 API for obtaining instanciated *Info objects
+ from non-instanciated counterparts
+
+2005-06-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * ConstructorBuilder.cs FieldBuilder.cs MethodBuilder.cs PropertyBuilder.cs:
+ Add 2.0 Module property.
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+2005-06-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * *Token.cs: Add net 2.0 Equals methods.
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * AssemblyBuilder.cs: Update after PortableExecutableKinds name change.
+
2005-06-03 Zoltan Varga <vargaz@freemail.hu>
* MethodBuilder.cs CustomAttributeBuilder.cs: Rework DllImportAttribute
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_ConstructorBuilder))]
+#endif
public sealed class ConstructorBuilder : ConstructorInfo {
private RuntimeMethodHandle mhandle;
private ILGenerator ilgen;
public override RuntimeMethodHandle MethodHandle {
get {
- throw not_supported ();
+ return mhandle;
}
}
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
return false;
}
}
+
+ public override Module Module {
+ get {
+ return base.Module;
+ }
+ }
#endif
public override string ToString() {
using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_CustomAttributeBuilder))]
+#endif
public class CustomAttributeBuilder {
ConstructorInfo ctor;
byte[] data;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class DynamicMethod : MethodInfo {
#region Sync with reflection.h
private RuntimeMethodHandle mhandle;
create_dynamic_method (this);
}
+ [ComVisible (true)]
public Delegate CreateDelegate (Type delegateType)
{
if (delegateType == null)
return deleg;
}
+ [ComVisible (true)]
public Delegate CreateDelegate (Type delegateType, object target)
{
if (delegateType == null)
using System.Reflection.Emit;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_EnumBuilder))]
+#endif
public sealed class EnumBuilder : Type {
private TypeBuilder _tb;
private FieldBuilder _underlyingField;
_tb.SetCustomAttribute (customBuilder);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute (ConstructorInfo con, byte[] binaryAttribute)
{
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_EventBuilder))]
+#endif
public sealed class EventBuilder {
string name;
Type type;
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Event.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct EventToken {
return res;
}
+#if NET_2_0
+ public bool Equals (EventToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_FieldBuilder))]
+#endif
public sealed class FieldBuilder : FieldInfo {
private FieldAttributes attrs;
private Type type;
}
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
RejectIfCreated ();
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
+#if NET_2_0
+ [Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
+#endif
public void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
RejectIfCreated ();
marshal_info = unmanagedMarshal;
{
return this;
}
+
+ public override Module Module {
+ get {
+ return base.Module;
+ }
+ }
#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Field.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct FieldToken {
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
}
+#if NET_2_0
+ public bool Equals (FieldToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
+
/// <summary>
/// Tests whether the given object is an instance of
/// FieldToken and has the same token value.
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Describes how an instruction alters the flow of control.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum FlowControl {
/// <summary>
/// <summary>
/// Annotation for ann.phi instruction.
/// </summary>
+#if NET_2_0
+ [Obsolete ("This API has been deprecated.")]
+#endif
Phi = 6,
/// <summary>
using System.Reflection.Emit;
using System.Collections;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Globalization;
using System.Runtime.Serialization;
#if NET_2_0 || BOOTSTRAP_NET_2_0
namespace System.Reflection.Emit
{
+ [ComVisible (true)]
public sealed class GenericTypeParameterBuilder : Type
{
#region Sync with reflection.h
this.base_type = base_type_constraint;
}
+ [ComVisible (true)]
public void SetInterfaceConstraints (Type[] iface_constraints)
{
this.iface_constraints = iface_constraints;
int GetToken (SignatureHelper helper);
}
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_ILGenerator))]
+#endif
public class ILGenerator: Object {
private struct LabelFixup {
public int offset; // The number of bytes between pos and the
code [code_len++] = val;
}
+ [ComVisible (true)]
public virtual void Emit (OpCode opcode, ConstructorInfo constructor)
{
int token = token_gen.GetToken (constructor);
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection.Emit {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct Label {
internal int label;
label = val;
}
- [MonoTODO]
public override bool Equals (object obj) {
- /* FIXME */
- return false;
+ bool res = obj is Label;
+
+ if (res) {
+ Label l = (Label)obj;
+ res = (label == l.label);
+ }
+
+ return res;
+ }
+
+#if NET_2_0
+ public bool Equals (Label obj)
+ {
+ return (label == obj.label);
}
+#endif
public override int GetHashCode () {
return label.GetHashCode ();
using System.Reflection.Emit;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Diagnostics.SymbolStore;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_LocalBuilder))]
+#endif
#if NET_2_0
public sealed class LocalBuilder : LocalVariableInfo {
#else
using System.Diagnostics.SymbolStore;
namespace System.Reflection.Emit {
-
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_MethodBuilder))]
+#endif
public sealed class MethodBuilder : MethodInfo {
private RuntimeMethodHandle mhandle;
private Type rtype;
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
attrs |= MethodAttributes.HasSecurity;
}
- [MonoTODO]
+#if NET_2_0
+ [Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
+#endif
public void SetMarshal (UnmanagedMarshal unmanagedMarshal)
{
RejectIfCreated ();
this.parameters = new Type [parameter_types.Length];
System.Array.Copy (parameter_types, this.parameters, parameter_types.Length);
}
+
+ public void SetReturnType (Type returnType)
+ {
+ rtype = returnType;
+ }
+
+ public void SetParameters (params Type[] parameterTypes)
+ {
+ if (parameterTypes != null) {
+ for (int i = 0; i < parameterTypes.Length; ++i)
+ if (parameterTypes [i] == null)
+ throw new ArgumentException ("Elements of the parameterTypes array cannot be null", "parameterTypes");
+
+ this.parameters = new Type [parameterTypes.Length];
+ System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
+ }
+ }
+
+ public void SetSignature (Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers) {
+ SetReturnType (returnType);
+ SetParameters (parameterTypes);
+ this.returnModReq = returnTypeRequiredCustomModifiers;
+ this.returnModOpt = returnTypeOptionalCustomModifiers;
+ this.paramModReq = parameterTypeRequiredCustomModifiers;
+ this.paramModOpt = parameterTypeOptionalCustomModifiers;
+ }
+
+ public override Module Module {
+ get {
+ return base.Module;
+ }
+ }
#endif
}
}
//
using System.Security.Permissions;
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_MethodRental))]
+#endif
public sealed class MethodRental {
public const int JitImmediate = 1;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Method.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct MethodToken {
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (MethodToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
using System.Globalization;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_ModuleBuilder))]
+#endif
public class ModuleBuilder : Module {
#region Sync with reflection.h
private IntPtr dynamic_image;
name_cache.Add (name, tb);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
return DefineType (name, attr, parent, interfaces, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
}
return eb;
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override Type GetType( string className) {
return GetType (className, false, false);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override Type GetType( string className, bool ignoreCase) {
return GetType (className, false, ignoreCase);
}
}
return null;
}
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override Type GetType (string className, bool throwOnError, bool ignoreCase) {
int subt;
string orig = className;
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
return GetMethodToken (GetArrayMethod (arrayClass, methodName, callingConvention, returnType, parameterTypes));
}
-
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public MethodToken GetConstructorToken (ConstructorInfo con)
{
if (con == null)
using System;
using System.Reflection;
using System.Reflection.Emit;
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct OpCode {
internal byte op1, op2;
return v.op1 == op1 && v.op2 == op2;
}
+#if NET_2_0
+ public bool Equals (OpCode obj)
+ {
+ return obj.op1 == op1 && obj.op2 == op2;
+ }
+#endif
+
public override string ToString ()
{
return Name;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Describes the types of MSIL instructions.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum OpCodeType {
/// <summary>
/// additional information to particular
/// MSIL processor.
/// </summary>
+#if NET_2_0
+ [Obsolete ("This API has been deprecated.")]
+#endif
Annotation = 0,
/// <summary>
+using System.Runtime.InteropServices;
+
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class OpCodes {
+
+ internal OpCodes () {
+ }
+
//
// The order is:
// Op1, Op2, StackBehaviourPush, StackBehaviourPop
0xFF << 0 | 0x73 << 8 | (byte) StackBehaviour.Pushref << 16 | (byte) StackBehaviour.Varpop << 24,
1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineMethod << 16 | (byte) FlowControl.Call << 24);
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public static readonly OpCode Castclass = new OpCode (
0xFF << 0 | 0x74 << 8 | (byte) StackBehaviour.Pushref << 16 | (byte) StackBehaviour.Popref << 24,
1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
0xFF << 0 | 0xA4 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_popref << 24,
1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
+ public static readonly OpCode Ldelem = new OpCode (
+ 0xFF << 0 | 0xA3 << 8 | (byte) StackBehaviour.Push1 << 16 | (byte) StackBehaviour.Popref_popi << 24,
+ 1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
+
+ public static readonly OpCode Stelem = new OpCode (
+ 0xFF << 0 | 0xA4 << 8 | (byte) StackBehaviour.Push0 << 16 | (byte) StackBehaviour.Popref_popi_popref << 24,
+ 1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
+
public static readonly OpCode Unbox_Any = new OpCode (
0xFF << 0 | 0xA5 << 8 | (byte) StackBehaviour.Push1 << 16 | (byte) StackBehaviour.Popref << 24,
1 << 0 | (byte) OpCodeType.Objmodel << 8 | (byte) OperandType.InlineType << 16 | (byte) FlowControl.Next << 24);
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Describes the operand types of MSIL instructions.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum OperandType {
/// <summary>
/// <summary>
/// </summary>
+#if NET_2_0
+ [Obsolete ("This API has been deprecated.")]
+#endif
InlinePhi = 6,
/// <summary>
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
+
namespace System.Reflection.Emit {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum PEFileKinds {
Dll = 1,
ConsoleApplication = 2,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
#if NET_2_0
#else
[Flags]
+#endif
+#if NET_2_0
+ [ComVisible (true)]
#endif
public enum PackingSize {
using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_ParameterBuilder))]
+#endif
public class ParameterBuilder {
private MethodBase methodb; /* MethodBuilder or ConstructorBuilder */
private string name;
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
+#if NET_2_0
+ [Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
+#endif
public virtual void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
marshal_info = unmanagedMarshal;
attrs |= ParameterAttributes.HasFieldMarshal;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Parameter.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct ParameterToken {
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (ParameterToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
using System.Reflection.Emit;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_PropertyBuilder))]
+#endif
public sealed class PropertyBuilder : PropertyInfo {
private PropertyAttributes attrs;
private string name;
private MethodBuilder get_method;
private int table_idx = 0;
internal TypeBuilder typeb;
+ private Type[] returnModReq;
+ private Type[] returnModOpt;
+ private Type[][] paramModReq;
+ private Type[][] paramModOpt;
- internal PropertyBuilder (TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
+ internal PropertyBuilder (TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt) {
this.name = name;
this.attrs = attributes;
this.type = returnType;
+ this.returnModReq = returnModReq;
+ this.returnModOpt = returnModOpt;
+ this.paramModReq = paramModReq;
+ this.paramModOpt = paramModOpt;
if (parameterTypes != null) {
this.parameters = new Type [parameterTypes.Length];
System.Array.Copy (parameterTypes, this.parameters, this.parameters.Length);
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
}
public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
}
+
+#if NET_2_0
+ public override Module Module {
+ get {
+ return base.Module;
+ }
+ }
+#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Property.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct PropertyToken {
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (PropertyToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
-
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_SignatureHelper))]
+#endif
public sealed class SignatureHelper {
internal enum SignatureHelperType {
HELPER_FIELD,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a Signature.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#else
[Serializable]
+#endif
public struct SignatureToken {
internal int tokValue;
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (SignatureToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Describes how values are pushed onto or popped off a stack.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum StackBehaviour {
/// <summary>
/// <summary>
/// </summary>
Varpush = 0x1B
+
+#if NET_2_0
+ ,
+ Popref_popi_pop1 = 0x1C
+#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// <summary>
/// Represents the Token returned by the metadata to represent a String.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct StringToken {
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (StringToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
using System.Diagnostics.SymbolStore;
namespace System.Reflection.Emit {
-
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_TypeBuilder))]
+#endif
public sealed class TypeBuilder : Type {
#region Sync with reflection.h
private string tname;
attrs |= TypeAttributes.HasSecurity;
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void AddInterfaceImplementation( Type interfaceType) {
if (interfaceType == null)
throw new ArgumentNullException ("interfaceType");
return res;
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
return DefineNestedType (name, attr, parent, interfaces, PackingSize.Unspecified, UnspecifiedTypeSize);
}
return DefineNestedType (name, attr, parent, null, packsize, UnspecifiedTypeSize);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorBuilder DefineConstructor (MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
return DefineConstructor (attributes, callingConvention, parameterTypes, null, null);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
#if NET_2_0 || BOOTSTRAP_NET_2_0
public
#else
return cb;
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorBuilder DefineDefaultConstructor (MethodAttributes attributes)
{
Type parent_type;
return cb;
}
- public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) {
- return DefineMethod (name, attributes, CallingConventions.Standard, returnType, parameterTypes);
- }
-
private void append_method (MethodBuilder mb) {
if (methods != null) {
if (methods.Length == num_methods) {
num_methods ++;
}
+ public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) {
+ return DefineMethod (name, attributes, CallingConventions.Standard, returnType, parameterTypes);
+ }
+
public MethodBuilder DefineMethod( string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
return DefineMethod (name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
}
nativeCallConv, nativeCharSet);
}
+#if NET_2_0
+ public MethodBuilder DefineMethod (string name, MethodAttributes attributes) {
+ return DefineMethod (name, attributes, CallingConventions.Standard);
+ }
+
+ public MethodBuilder DefineMethod (string name, MethodAttributes attributes, CallingConventions callConv) {
+ return DefineMethod (name, attributes, callConv, null, null);
+ }
+#endif
+
public void DefineMethodOverride( MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration) {
if (methodInfoBody == null)
throw new ArgumentNullException ("methodInfoBody");
}
public PropertyBuilder DefineProperty( string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
+ return DefineProperty (name, attributes, returnType, null, null, parameterTypes, null, null);
+ }
+
+#if NET_2_0
+ public
+#else
+ internal
+#endif
+ PropertyBuilder DefineProperty (string name, PropertyAttributes attributes, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers) {
check_name ("name", name);
if (parameterTypes != null)
foreach (Type param in parameterTypes)
throw new ArgumentNullException ("parameterTypes");
check_not_created ();
- PropertyBuilder res = new PropertyBuilder (this, name, attributes, returnType, parameterTypes);
+ PropertyBuilder res = new PropertyBuilder (this, name, attributes, returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers);
if (properties != null) {
PropertyBuilder[] new_properties = new PropertyBuilder [properties.Length+1];
return res;
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorBuilder DefineTypeInitializer() {
return DefineConstructor (MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, CallingConventions.Standard, null);
}
symbolWriter.CloseNamespace ();
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
{
if (ctors == null)
cattrs [0] = customBuilder;
}
}
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
}
return pmodule.get_next_table_index (obj, table, inc);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override InterfaceMapping GetInterfaceMap (Type interfaceType)
{
if (created == null)
return base.IsAssignableFrom (c);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO]
public override bool IsSubclassOf (Type c)
{
public override bool HasGenericArguments {
get {
- throw new NotImplementedException ();
+ return generic_params != null;
}
}
{
return DefineMethod (name, attributes, CallingConventions.Standard, null, null);
}
+
+ public static ConstructorInfo GetConstructor (Type instanciated, ConstructorInfo ctor)
+ {
+ ConstructorInfo res = instanciated.GetConstructor (ctor);
+ if (res == null)
+ throw new System.Exception ("constructor not found");
+ else
+ return res;
+ }
+
+ public static MethodInfo GetMethod (Type instanciated, MethodInfo meth)
+ {
+ MethodInfo res = instanciated.GetMethod (meth);
+ if (res == null)
+ throw new System.Exception ("method not found");
+ else
+ return res;
+ }
+
+ public static FieldInfo GetField (Type instanciated, FieldInfo fld)
+ {
+ FieldInfo res = instanciated.GetField (fld);
+ if (res == null)
+ throw new System.Exception ("field not found");
+ else
+ return res;
+ }
#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
/// Represents the Token returned by the metadata to represent a Type.
/// </summary>
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct TypeToken {
internal int tokValue;
tokValue = val;
}
-
-
/// <summary>
/// </summary>
public override bool Equals (object obj)
return res;
}
+#if NET_2_0
+ public bool Equals (TypeToken obj)
+ {
+ return (this.tokValue == obj.tokValue);
+ }
+#endif
/// <summary>
/// Tests whether the given object is an instance of
namespace System.Reflection.Emit {
+#if NET_2_0
+ [Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class UnmanagedMarshal {
private int count;
using System;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class AmbiguousMatchException : SystemException {
// Constructors
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_Assembly))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public class Assembly : System.Reflection.ICustomAttributeProvider,
*/
// FIXME: LoadWithPartialName must look cache (no CAS) or read from disk (CAS)
-#if NET_2_0
- [Obsolete ("")]
- [ComVisible (false)]
- [MonoTODO]
- public
-#else
- internal
-#endif
- static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
+ internal static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence, bool oldBehavior)
{
if (!oldBehavior)
throw new NotImplementedException ();
}
[ComVisible (false)]
+ [Obsolete ("Please use Assembly.ManifestModule.GetPEKind() instead - this will be removed before Whidbey ships.")]
public ImageFileMachine ImageFileMachine {
get {
ImageFileMachine machine;
- PortableExecutableKind kind;
+ PortableExecutableKinds kind;
ModuleHandle handle = ManifestModule.ModuleHandle;
handle.GetPEKind (out kind, out machine);
return machine;
}
[ComVisible (false)]
+ [Obsolete ("This method has been deprecated and will be removed before v2.0 RTM is released.")]
public extern int MetadataToken {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
get;
}
[ComVisible (false)]
- public PortableExecutableKind PortableExecutableKind {
+ [Obsolete ("Please use Assembly.ManifestModule.GetPEKind() instead - this will be removed before Whidbey ships.")]
+ public PortableExecutableKinds PortableExecutableKinds {
get {
ImageFileMachine machine;
- PortableExecutableKind kind;
+ PortableExecutableKinds kind;
ModuleHandle handle = ManifestModule.ModuleHandle;
handle.GetPEKind (out kind, out machine);
return kind;
using System;
using System.Configuration.Assemblies;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyAlgorithmIdAttribute : Attribute
{
// Field
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyCompanyAttribute : Attribute
{
// Field
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyConfigurationAttribute : Attribute
{
// Field
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyCopyrightAttribute : Attribute
{
// Field
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyCultureAttribute : Attribute
{
// Field
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyDefaultAliasAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyDelaySignAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyDescriptionAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyFileVersionAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyFlagsAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyInformationalVersionAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyKeyFileAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyKeyNameAttribute : Attribute
{
// Field
// a. Uniform Resource Identifiers (URI): Generic Syntax
// http://www.ietf.org/rfc/rfc2396.txt
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_AssemblyName))]
+#endif
[Serializable]
[MonoTODO ("Fix serialization compatibility with MS.NET")]
public sealed class AssemblyName : ICloneable, ISerializable, IDeserializationCallback {
+ #region Synch with object-internals.h
string name;
string codebase;
int major, minor, build, revision;
byte[] keyToken;
AssemblyVersionCompatibility versioncompat;
Version version;
+#if NET_2_0
+ ProcessorArchitecture processor_architecture;
+#else
+ int processor_architecture;
+#endif
+ #endregion
public AssemblyName ()
{
{
name = assemblyName;
}
+
+ [MonoTODO]
+ public ProcessorArchitecture ProcessorArchitecture {
+ get {
+ return processor_architecture;
+ }
+ set {
+ processor_architecture = value;
+ }
+ }
#endif
internal AssemblyName (SerializationInfo si, StreamingContext sc)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
-
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
[Serializable]
public enum AssemblyNameFlags {
#endif
#if NET_2_0
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
Library = 0x2,
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
AppDomainPlatform = 0x4,
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
ProcessPlatform = 0x6,
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
SystemPlatform = 0x8,
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
LongevityMask = 0xe,
+ [Obsolete ("This will be removed before Whidbey ships. There will be no replacement for Whidbey.")]
LongevityUnspecified = 0x0,
EnableJITcompileOptimizer = 0x4000,
EnableJITcompileTracking = 0x8000
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class AssemblyNameProxy : MarshalByRefObject
{
// Constructor
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyProductAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyTitleAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyTrademarkAttribute : Attribute
{
// Field
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
+#else
[AttributeUsage (AttributeTargets.Assembly)]
+#endif
public sealed class AssemblyVersionAttribute : Attribute
{
// Field
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.AutoDual)]
public abstract class Binder
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
-
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum BindingFlags {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum CallingConventions {
+2005-06-09 Kamil Skalski <nazgul@nemerle.org>
+ * MonoGenericClass.cs: Add overrides of Get{Method,Constructor,Field}
+ for obtaining instanciated *Info objects from non-instanciated counterparts
+
+
+2005-06-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * CustomAttributeData.cs EventInfo.cs Assembly.cs: Updates for net 2.0 beta 2.
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+2005-06-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+2005-06-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * CustomAttributeData.cs: Implemented.
+
+ * CustomAttributeDataNamedArgument.cs: Implemented.
+
+ * CustomAttrbuteDataTypedArgument.cs: Implemented.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Assembly.cs ExceptionHandlingClause.cs: Fix build.
+
+ * ProcessorArchitecture.cs: New file.
+
+ * ExceptionHandlingClause.cs: Update after ExceptionHandlingClauseFlags name change.
+
+ * *.cs: Updates for net 2.0 beta 2.
+
+ * *.cs: Add net 2.0 ComVisibleAttribute.
+
2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Assembly.cs: if the assembly is loaded from a byte array, Location
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_ConstructorInfo))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public abstract class ConstructorInfo : MethodBase {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public static readonly string ConstructorName = ".ctor";
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public static readonly string TypeConstructorName = ".cctor";
protected ConstructorInfo() {
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override MemberTypes MemberType {
get {return MemberTypes.Constructor;}
}
//
// Author:
// Zoltan Varga (vargaz@gmail.com)
+// Carlos Alberto Cortez (calberto.cortez@gmail.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+using System.Text;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class CustomAttributeData {
+ ConstructorInfo ctorInfo;
+ IList<CustomAttributeTypedArgument> ctorArgs;
+ IList<CustomAttributeNamedArgument> namedArgs;
+
+ internal CustomAttributeData (ConstructorInfo ctorInfo, object [] ctorArgs, object [] namedArgs)
+ {
+ this.ctorInfo = ctorInfo;
+
+ this.ctorArgs = Array.AsReadOnly<CustomAttributeTypedArgument>
+ (ctorArgs != null ? UnboxValues<CustomAttributeTypedArgument> (ctorArgs) : new CustomAttributeTypedArgument [0]);
+
+ this.namedArgs = Array.AsReadOnly<CustomAttributeNamedArgument>
+ (namedArgs != null ? UnboxValues<CustomAttributeNamedArgument> (namedArgs) : new CustomAttributeNamedArgument [0]);
+ }
- [MonoTODO]
+ [ComVisible (true)]
public ConstructorInfo Constructor {
get {
- throw new NotImplementedException ();
+ return ctorInfo;
}
}
- [MonoTODO]
public IList<CustomAttributeTypedArgument> ConstructorArguments {
get {
- throw new NotImplementedException ();
+ return ctorArgs;
}
}
- [MonoTODO]
public IList<CustomAttributeNamedArgument> NamedArguments {
get {
- throw new NotImplementedException ();
+ return namedArgs;
}
}
- [MonoTODO]
- public static IList<CustomAttributeData> GetCustomAttributes (Assembly yarget) {
- throw new NotImplementedException ();
+ public static IList<CustomAttributeData> GetCustomAttributes (Assembly target) {
+ return MonoCustomAttrs.GetCustomAttributesData (target);
}
- [MonoTODO]
public static IList<CustomAttributeData> GetCustomAttributes (MemberInfo target) {
- throw new NotImplementedException ();
+ return MonoCustomAttrs.GetCustomAttributesData (target);
}
- [MonoTODO]
public static IList<CustomAttributeData> GetCustomAttributes (Module target) {
- throw new NotImplementedException ();
+ return MonoCustomAttrs.GetCustomAttributesData (target);
}
- [MonoTODO]
public static IList<CustomAttributeData> GetCustomAttributes (ParameterInfo target) {
- throw new NotImplementedException ();
+ return MonoCustomAttrs.GetCustomAttributesData (target);
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append ("[" + ctorInfo.DeclaringType.Name + " (");
+ for (int i = 0; i < ctorArgs.Count; i++) {
+ sb.Append (ctorArgs [i].ToString ());
+ if (i + 1 < ctorArgs.Count)
+ sb.Append (", ");
+ }
+
+ if (namedArgs.Count > 0)
+ sb.Append (", ");
+
+ for (int j = 0; j < namedArgs.Count; j++) {
+ sb.Append (namedArgs [j].ToString ());
+ if (j + 1 < namedArgs.Count)
+ sb.Append (", ");
+ }
+ sb.AppendFormat (")]");
+
+ return sb.ToString ();
+ }
+
+ static T [] UnboxValues<T> (object [] values)
+ {
+ T [] retval = new T [values.Length];
+ for (int i = 0; i < values.Length; i++)
+ retval [i] = (T) values [i];
+
+ return retval;
}
}
using System.Globalization;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public class CustomAttributeFormatException : FormatException
{
//
// Author:
// Zoltan Varga (vargaz@gmail.com)
+// Carlos Alberto Cortez (calberto.cortez@gmail.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
#if NET_2_0
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+ [ComVisible (true)]
+ [Serializable]
public struct CustomAttributeNamedArgument {
+ CustomAttributeTypedArgument typedArgument;
+ MemberInfo memberInfo;
+
+ internal CustomAttributeNamedArgument (MemberInfo memberInfo, object typedArgument)
+ {
+ this.memberInfo = memberInfo;
+ this.typedArgument = (CustomAttributeTypedArgument) typedArgument;
+ }
- [MonoTODO]
public MemberInfo MemberInfo {
get {
- throw new NotImplementedException ();
+ return memberInfo;
}
}
- [MonoTODO]
public CustomAttributeTypedArgument TypedValue {
get {
- throw new NotImplementedException ();
+ return typedArgument;
}
}
+
+ public override string ToString ()
+ {
+ return memberInfo.Name + " = " + typedArgument.ToString ();
+ }
}
}
//
// Author:
// Zoltan Varga (vargaz@gmail.com)
+// Carlos Alberto Cortez (calberto.cortez@gmail.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
#if NET_2_0
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+ [ComVisible (true)]
+ [Serializable]
public struct CustomAttributeTypedArgument {
+ Type argumentType;
+ object value;
+
+ internal CustomAttributeTypedArgument (Type argumentType, object value)
+ {
+ this.argumentType = argumentType;
+ this.value = value;
+ }
- [MonoTODO]
public Type ArgumentType {
get {
- throw new NotImplementedException ();
+ return argumentType;
}
}
- [MonoTODO]
public object Value {
get {
- throw new NotImplementedException ();
+ return value;
}
}
+
+ public override string ToString ()
+ {
+ string val = value.ToString ();
+ if (argumentType == typeof (string))
+ return "\"" + val + "\"";
+ if (argumentType == typeof (Type))
+ return "typeof (" + val + ")";
+
+ return val;
+ }
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
AttributeTargets.Interface)]
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum EventAttributes {
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_EventInfo))]
+ [Serializable]
+#endif
[ClassInterface(ClassInterfaceType.None)]
public abstract class EventInfo : MemberInfo {
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class ExceptionHandlingClause {
#region Sync with reflection.h
internal Type catch_type;
internal int filter_offset;
- internal ExceptionHandlingClauseFlags flags;
+ internal ExceptionHandlingClauseOptions flags;
internal int try_offset;
internal int try_length;
internal int handler_offset;
}
}
- public ExceptionHandlingClauseFlags Flags {
+ public ExceptionHandlingClauseOptions Flags {
get {
return flags;
}
+++ /dev/null
-//
-// System.Reflection/ExceptionHandlingClauseFlags.cs
-//
-// Author:
-// Zoltan Varga (vargaz@gmail.com)
-//
-// 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.
-//
-
-
-#if NET_2_0
-
-using System;
-
-namespace System.Reflection {
-
- [Flags]
- public enum ExceptionHandlingClauseFlags {
- Clause = 0x0,
- Filter = 0x1,
- Finally = 0x2,
- Fault = 0x4
- }
-
-}
-
-#endif
--- /dev/null
+//
+// System.Reflection/ExceptionHandlingClauseOptions.cs
+//
+// Author:
+// Zoltan Varga (vargaz@gmail.com)
+//
+// 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.
+//
+
+
+#if NET_2_0
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace System.Reflection {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ [Flags]
+ public enum ExceptionHandlingClauseOptions {
+ Clause = 0x0,
+ Filter = 0x1,
+ Finally = 0x2,
+ Fault = 0x4
+ }
+
+}
+
+#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum FieldAttributes {
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_FieldInfo))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public abstract class FieldInfo : MemberInfo {
}
#if NET_2_0 || BOOTSTRAP_NET_2_0
+ [Obsolete ("Use FieldInfo.GetOptionalCustomModifiers().")]
public virtual Type[] OptionalCustomModifiers {
get {
- throw new NotImplementedException ();
+ return GetOptionalCustomModifiers ();
}
}
+ [Obsolete ("Use FieldInfo.GetRequiredCustomModifiers().")]
public virtual Type[] RequiredCustomModifiers {
get {
- throw new NotImplementedException ();
+ return GetRequiredCustomModifiers ();
}
}
+
+ [MonoTODO]
+ public virtual Type[] GetOptionalCustomModifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual Type[] GetRequiredCustomModifiers () {
+ throw new NotImplementedException ();
+ }
#endif
#if NET_2_0 || BOOTSTRAP_NET_2_0
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface ICustomAttributeProvider {
object [] GetCustomAttributes (bool inherit);
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Guid("AFBF15E5-C37C-11d2-B88E-00A0C9B471B8")]
public interface IReflect {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
#if NET_2_0 || BOOTSTRAP_NET_2_0
public
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Reflection {
+using System.Runtime.InteropServices;
+namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct InterfaceMapping {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public MethodInfo[] InterfaceMethods;
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public Type InterfaceType;
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public MethodInfo[] TargetMethods;
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public Type TargetType;
}
}
using System.Globalization;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public class InvalidFilterCriteriaException : ApplicationException
{
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class LocalVariableInfo {
#region Sync with reflection.h
internal Type type;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class ManifestResourceInfo
{
private Assembly _assembly;
//
using System;
using System.Reflection;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public delegate bool MemberFilter( MemberInfo m, object filterCriteria);
}
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_MemberInfo))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum MemberTypes {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum MethodAttributes {
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_MethodBase))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public abstract class MethodBase: MemberInfo {
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class MethodBody {
#region Sync with reflection.h
ExceptionHandlingClause[] clauses;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#else
[Flags]
+#endif
public enum MethodImplAttributes {
/// <summary>
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_MethodInfo))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public abstract class MethodInfo: MethodBase {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [Serializable]
+#endif
public sealed class Missing
{
public static readonly Missing Value = new Missing ();
Other
};
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_Module))]
+#endif
[Serializable]
public class Module : ISerializable, ICustomAttributeProvider {
}
#if NET_2_0
- [CLSCompliant(false)]
public ModuleHandle ModuleHandle {
get {
return new ModuleHandle (_impl);
return null;
}
}
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual Type GetType(string className)
{
return GetType (className, false, false);
}
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual Type GetType(string className, bool ignoreCase)
{
return GetType (className, false, ignoreCase);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual Type GetType(string className, bool throwOnError, bool ignoreCase)
{
if (className == null)
return name;
}
- internal Guid MvId {
+#if NET_2_0
+ [Obsolete ("Please use ModuleVersionId instead - this will be removed before Whidbey ships.")]
+ public
+#else
+ internal
+#endif
+ Guid MvId {
get {
return Mono_GetGuid (this);
}
}
#if NET_2_0
- Guid ModuleVersionId {
+ public Guid ModuleVersionId {
get {
return Mono_GetGuid (this);
}
}
- public void GetPEKind (out PortableExecutableKind peKind, out ImageFileMachine machine) {
+ public void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine) {
ModuleHandle.GetPEKind (out peKind, out machine);
}
#endif
return new ArgumentException (String.Format ("Token 0x{0:x} is not a valid {1} token in the scope of module {2}", metadataToken, tokenType, name), "metadataToken");
}
+ [Obsolete ("Please use ResolveField(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) - this will be removed before Whidbey ships.")]
public FieldInfo ResolveField (int metadataToken) {
ResolveTokenError error;
return m;
}
+ [Obsolete ("Please use ResolveMethod(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) - this will be removed before Whidbey ships.")]
public MethodBase ResolveMethod (int metadataToken) {
ResolveTokenError error;
return s;
}
+ [Obsolete ("Please use ResolveType(int metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) - this will be removed before Whidbey ships.")]
public Type ResolveType (int metadataToken) {
ResolveTokenError error;
internal static extern MemberInfo ResolveMemberToken (IntPtr module, int token, out ResolveTokenError error);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- internal static extern void GetPEKind (IntPtr module, out PortableExecutableKind peKind, out ImageFileMachine machine);
+ internal static extern void GetPEKind (IntPtr module, out PortableExecutableKinds peKind, out ImageFileMachine machine);
}
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
using System;
+using System.Runtime.InteropServices;
+
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public delegate Module ModuleResolveEventHandler (object sender, ResolveEventArgs e);
}
return field;
}
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- [MonoTODO]
- public override Type[] OptionalCustomModifiers {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override Type[] RequiredCustomModifiers {
- get {
- throw new NotImplementedException ();
- }
- }
-#endif
-
#if NET_2_0 || BOOTSTRAP_NET_2_0
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public override extern FieldInfo Mono_GetGenericFieldDefinition ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
protected extern void initialize (MethodInfo[] methods, ConstructorInfo[] ctors, FieldInfo[] fields, PropertyInfo[] properties, EventInfo[] events);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern MethodInfo GetCorrespondingInflatedMethod (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern ConstructorInfo GetCorrespondingInflatedConstructor (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern FieldInfo GetCorrespondingInflatedField (IntPtr generic);
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
protected extern MethodInfo[] GetMethods_internal (Type reflected_type);
return generic_type.IsValueType;
}
+ internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+ {
+ initialize ();
+
+ return GetCorrespondingInflatedMethod (fromNoninstanciated.MethodHandle.Value);
+ }
+
+ internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+ initialize ();
+
+ return GetCorrespondingInflatedConstructor (fromNoninstanciated.MethodHandle.Value);
+ }
+
+ internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+ initialize ();
+
+ return GetCorrespondingInflatedField (fromNoninstanciated.FieldHandle.Value);
+ }
+
public override MethodInfo[] GetMethods (BindingFlags bf)
{
ArrayList l = new ArrayList ();
public override string ToString () {
return PropertyType.ToString () + " " + Name;
}
-
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- [MonoTODO]
- public override Type[] OptionalCustomModifiers {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override Type[] RequiredCustomModifiers {
- get {
- throw new NotImplementedException ();
- }
- }
-#endif
}
}
#if NET_2_0 || BOOTSTRAP_NET_2_0
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
- [AttributeUsage (AttributeTargets.Assembly)]
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly, Inherited=false)]
public sealed class ObfuscateAssemblyAttribute : Attribute {
private bool is_private;
}
}
+ public bool StripAfterObfuscation {
+ get {
+ return strip;
+ }
+ set {
+ strip = value;
+ }
+ }
+
+ [Obsolete ("Use 'StripAfterObfuscation' instead.")]
public bool Strip {
get {
return strip;
#if NET_2_0 || BOOTSTRAP_NET_2_0
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
- [AttributeUsage (AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Event|AttributeTargets.Interface|AttributeTargets.Parameter|AttributeTargets.Delegate)]
+ [ComVisible (true)]
+ [AttributeUsage (AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Event|AttributeTargets.Interface|AttributeTargets.Parameter|AttributeTargets.Delegate, AllowMultiple=true, Inherited=false)]
public sealed class ObfuscationAttribute : Attribute {
private bool exclude;
}
}
+ public bool StripAfterObfuscation {
+ get {
+ return strip;
+ }
+ set {
+ strip = value;
+ }
+ }
+
+ [Obsolete ("Use 'StripAfterObfuscation' instead.")]
public bool Strip {
get {
return strip;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum ParameterAttributes {
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+ [ClassInterfaceAttribute (ClassInterfaceType.None)]
+ [ComDefaultInterfaceAttribute (typeof (_ParameterInfo))]
+#endif
[Serializable]
public class ParameterInfo : ICustomAttributeProvider
{
}
#if NET_2_0 || BOOTSTRAP_NET_2_0
- [MonoTODO]
+ [Obsolete ("Use ParameterInfo.GetOptionalCustomModifiers().")]
public virtual Type[] OptionalCustomModifiers {
get {
- throw new NotImplementedException ();
+ return GetOptionalCustomModifiers ();
}
}
- [MonoTODO]
+ [Obsolete ("Use ParameterInfo.GetRequiredCustomModifiers().")]
public virtual Type[] RequiredCustomModifiers {
+ get {
+ return GetRequiredCustomModifiers ();
+ }
+ }
+
+ [MonoTODO]
+ public virtual Type[] GetOptionalCustomModifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual Type[] GetRequiredCustomModifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual object RawDefaultValue {
get {
throw new NotImplementedException ();
}
//
using System;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public struct ParameterModifier {
private bool[] _byref;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+
+#if NET_2_0
+ [ComVisible (true)]
+ [Serializable]
+#endif
[CLSCompliant(false)]
public unsafe sealed class Pointer : ISerializable {
+++ /dev/null
-//
-// System.Reflection.PortableExecutableKind flag
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// 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.
-//
-
-namespace System.Reflection {
-
- [Flags]
- [Serializable]
-#if NET_2_0 || BOOTSTRAP_NET_2_0
- public
-#else
- internal
-#endif
- enum PortableExecutableKind {
- NotAPortableExecutableImage = 0,
- ILOnly = 1,
- Required32Bit = 2,
- Plus32Bit = 4,
- Unmanaged32Bit = 8
- }
-}
-
--- /dev/null
+//
+// System.Reflection.PortableExecutableKinds flag
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// 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.Runtime.InteropServices;
+
+namespace System.Reflection {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ [Flags]
+ [Serializable]
+#if NET_2_0 || BOOTSTRAP_NET_2_0
+ public
+#else
+ internal
+#endif
+ enum PortableExecutableKinds {
+ NotAPortableExecutableImage = 0,
+ ILOnly = 1,
+ Required32Bit = 2,
+ [Obsolete ("Please use PE32Plus instead - this will be removed before Whidbey ships")]
+ Plus32Bit = 4,
+ PE32Plus = 4,
+ Unmanaged32Bit = 8
+ }
+}
+
--- /dev/null
+//
+// System.Reflection.ProcessorArchitecture flag
+//
+// Author:
+// Zoltan Varga (vargaz@gmail.com)
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System.Runtime.InteropServices;
+
+namespace System.Reflection {
+
+ [ComVisible (true)]
+ [Serializable]
+ public enum ProcessorArchitecture {
+ None = 0,
+ MSIL = 1,
+ X86 = 2,
+ IA64 = 3,
+ Amd64 = 4
+ }
+}
+
+#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum PropertyAttributes {
using System.Runtime.InteropServices;
namespace System.Reflection {
+
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterfaceAttribute (typeof (_PropertyInfo))]
+#endif
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
public abstract class PropertyInfo : MemberInfo {
public abstract void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
#if NET_2_0 || BOOTSTRAP_NET_2_0
- [MonoTODO]
+ [Obsolete ("Use ParameterInfo.GetOptionalCustomModifiers().")]
public virtual Type[] OptionalCustomModifiers {
get {
- throw new NotImplementedException ();
+ return GetOptionalCustomModifiers ();
}
}
- [MonoTODO]
+ [Obsolete ("Use ParameterInfo.GetRequiredCustomModifiers().")]
public virtual Type[] RequiredCustomModifiers {
get {
- throw new NotImplementedException ();
+ return GetRequiredCustomModifiers ();
}
}
+ [MonoTODO]
+ public virtual Type[] GetOptionalCustomModifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual Type[] GetRequiredCustomModifiers () {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public virtual object GetConstantValue () {
throw new NotImplementedException ();
- }
+ }
+
+ [MonoTODO]
+ public virtual object GetRawConstantValue() {
+ throw new NotImplementedException ();
+ }
#endif
}
}
//
using System.Globalization;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class ReflectionTypeLoadException : SystemException
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum ResourceAttributes {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum ResourceLocation {
using System.IO;
using System.Security.Cryptography;
using System.Security.Permissions;
+using System.Runtime.InteropServices;
using Mono.Security;
using Mono.Security.Cryptography;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public class StrongNameKeyPair
{
using System.Globalization;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public class TargetException : ApplicationException
{
//
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class TargetInvocationException : ApplicationException
{
using System.Runtime.Serialization;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Reflection
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class TargetParameterCountException : ApplicationException
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
/// <summary>
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum TypeAttributes {
/// <summary>
/// </summary>
HasSecurity = 262144,
+
+ /// <summary>
+ /// </summary>
+ CustomFormatClass = 0x30000,
+
+ /// <summary>
+ /// </summary>
+ CustomFormatMask = 0xc00000
} // TypeAttributes
} // System.Reflection
using System;
using System.Reflection;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Reflection {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public class TypeDelegator : Type {
protected Type typeImpl;
return typeImpl.GetConstructor (bindingAttr, binder, callConvention, types, modifiers);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr)
{
return typeImpl.GetConstructors (bindingAttr);
return typeImpl.GetInterface (name, ignoreCase);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public override InterfaceMapping GetInterfaceMap( Type interfaceType)
{
return typeImpl.GetInterfaceMap (interfaceType);
throw new NotImplementedException ();
}
}
+
+ public override int MetadataToken {
+ get {
+ return typeImpl.MetadataToken;
+ }
+ }
#endif
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Reflection {
-
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public delegate bool TypeFilter (Type m, object filterCriteria);
} // System.Reflection
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * RuntimeHelpers.cs: Add some missing 2.0 attributes.
+
2005-02-12 Marek Safar <marek.safar@seznam.cz>
\r
* CompilationRelaxationsAttribute.cs,\r
throw new NotImplementedException ();
}
+ [MonoTODO]
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+ public static void PrepareConstrainedRegionsNoOP () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+ public static void ProbeForSufficientStack() {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public static void PrepareDelegate (Delegate d) {
if (d == null)
+2005-06-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RuntimeEnvironment.cs: I get better results when calling Demand.
+
+2005-06-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RuntimeEnvironment.cs: Implemented TODO. Added security for CAS.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * _Exception.cs: That one wasn't backported to 1.1 SP1 by MS. This
+ should fix a lot of extra reported in the API status pages.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Marshal.cs: Add some missing 2.0 attributes.
+
2005-05-15 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* _Attribute.cs
public extern static IntPtr AllocCoTaskMem (int cb);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public extern static IntPtr AllocHGlobal (IntPtr cb);
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public static IntPtr AllocHGlobal (int cb) {
return AllocHGlobal ((IntPtr)cb);
}
public extern static void FreeCoTaskMem (IntPtr ptr);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public extern static void FreeHGlobal (IntPtr hglobal);
#if NET_2_0
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public static extern int GetLastWin32Error();
[MonoTODO]
//
// Authors:
// Dominik Fretz (roboto@gmx.net)
+// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2003 Dominik Fretz
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.IO;
using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.Permissions;
namespace System.Runtime.InteropServices
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RuntimeEnvironment
{
public RuntimeEnvironment ()
{
}
- public static string SystemConfigurationFile
- {
- get { return Environment.GetMachineConfigPath (); }
+ public static string SystemConfigurationFile {
+ get {
+ // GetMachineConfigPath is internal and not protected by CAS
+ string path = Environment.GetMachineConfigPath ();
+ if (SecurityManager.SecurityEnabled) {
+ new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand ();
+ }
+ return path;
+ }
}
-
- [MonoTODO]
public static bool FromGlobalAccessCache (Assembly a)
{
- throw new NotImplementedException ();
+ // yes, this will throw a NullReferenceException (just like MS, reported as ...)
+ return a.GlobalAssemblyCache;
}
-
public static string GetRuntimeDirectory ()
{
return Path.GetDirectoryName (typeof (int).Assembly.Location);
}
+ [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static string GetSystemVersion ()
{
return "v" + Environment.Version.Major + "." + Environment.Version.Minor + "." + Environment.Version.Build;
}
-
}
}
-
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_1_1
+#if NET_2_0
-using System;
using System.Reflection;
using System.Runtime.Serialization;
+2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
+
+ * RealProxy.cs: Report invalid return type of values using
+ InvalidCastException, like MS.NET. Fixes bug #75203.
+
2004-10-26 Lluis Sanchez Gual <lluis@novell.com>
* RealProxy.cs: Added _targetDomainId and _targetUri fields, which are
MethodInfo mi = (MethodInfo) call.MethodBase;
if (mrm.ReturnValue != null && !mi.ReturnType.IsInstanceOfType (mrm.ReturnValue))
- throw new RemotingException ("Return value has an invalid type");
+ throw new InvalidCastException ("Return value has an invalid type");
// Check out parameters
object outArg = mrm.GetOutArg (nout++);
if (outArg != null && !par.ParameterType.IsInstanceOfType (outArg))
{
- throw new RemotingException ("Return argument '" + par.Name + "' has an invalid type");
+ throw new InvalidCastException ("Return argument '" + par.Name + "' has an invalid type");
}
outArgs [narg++] = outArg;
}
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * ObjRef.cs RemotingServices.cs: Add some missing 2.0 attributes.
+
2005-05-26 Ben Maurer <bmaurer@ximian.com>
* InternalRemotingServices.cs: Move hashtable init to
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System.Runtime.Remoting {
[Serializable]
}
public virtual IChannelInfo ChannelInfo {
-
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
get {
return channel_info;
}
return identity.IsFromThisAppDomain;
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public bool IsFromThisProcess ()
{
foreach (object data in channel_info.ChannelData)
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System.Runtime.Remoting
{
public sealed class RemotingServices
internal extern static object InternalExecute (MethodBase method, Object obj,
Object[] parameters, out object [] out_args);
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern static bool IsTransparentProxy (object proxy);
return app_id + Environment.TickCount + "_" + n + ".rem";
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public static RealProxy GetRealProxy (object proxy)
{
if (!IsTransparentProxy(proxy)) throw new RemotingException("Cannot get the real proxy from an object that is not a transparent proxy.");
+2005-06-13 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Formatter.cs: Properly initialize protected fields. Fixes bug #75233.
+
2005-05-17 Lluis Sanchez Gual <lluis@novell.com>
* SerializationInfo.cs: Use IsInstanceOfType instead of IsAssignableFrom
{
}
- protected ObjectIDGenerator m_idGenerator;
- protected Queue m_objectQueue;
+ protected ObjectIDGenerator m_idGenerator = new ObjectIDGenerator ();
+ protected Queue m_objectQueue = new Queue ();
public abstract SerializationBinder Binder {
get;
// Sebastien Pouliot (sebastien@ximian.com)
//
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class AsymmetricAlgorithm : IDisposable {
protected int KeySizeValue;
// Authors:\r
// Thomas Neidhart (tome@sbox.tugraz.at)\r
//
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class AsymmetricKeyExchangeDeformatter {\r
\r
public AsymmetricKeyExchangeDeformatter ()
// Authors:\r
// Thomas Neidhart (tome@sbox.tugraz.at)\r
//\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class AsymmetricKeyExchangeFormatter {\r
\r
public AsymmetricKeyExchangeFormatter ()
// Authors:
// Thomas Neidhart (tome@sbox.tugraz.at)
//
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class AsymmetricSignatureDeformatter {
public AsymmetricSignatureDeformatter ()
// Authors:
// Thomas Neidhart (tome@sbox.tugraz.at)
//
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class AsymmetricSignatureFormatter {
public AsymmetricSignatureFormatter ()
// Sergey Chaban (serge@wildwestsoftware.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
namespace System.Security.Cryptography {
-\r
+
+#if NET_2_0
+ internal static class Base64Constants {\r
+#else\r
internal sealed class Base64Constants {\r
\r
private Base64Constants ()\r
{\r
// Never instantiated.\r
}
-
+#endif
// Pre-calculated tables\r
\r
public static readonly byte[] EncodeTable = {
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * all: 2.0 beta2 fixes, i.e. mostly added [ComVisible(true)]
+
+2005-06-09 Sebastien Pouliot <sebastien@ximian.com>
+
+ * HMAC.cs: BlockSizeValue has changed from a protected member to
+ a protected property.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * CspProviderFlags.cs: UseExistingKey was added in 1.1 SP1. Added
+ ComVisible attribute for 2.0.
+
2005-05-19 Sebastien Pouliot <sebastien@ximian.com>
* CryptoConfig.cs: Don't use the global hashtables until the
// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
//
// Copyright 2001 by Matthew S. Ford.
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum CipherMode {
CBC = 0x1, // Cipher Block Chaining
ECB, // Electronic Codebook
// Note: This class isn't used by Mono as all algorithms are provided with
// 100% managed implementations.
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class CryptoAPITransform : ICryptoTransform {
private bool m_disposed;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public class CryptoConfig {
static private object lockObject;
// Sebastien Pouliot (sebastien@ximian.com)
//
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class CryptoStream : Stream {
private Stream _stream;
private ICryptoTransform _transform;
// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
//
// Copyright 2001 by authors.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum CryptoStreamMode {
Read,
Write
// Thomas Neidhart (tome@sbox.tugraz.at)
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
[Serializable]
#if NET_2_0
+ [ComVisible (true)]
public class CryptographicException : SystemException, _Exception {
#else
public class CryptographicException : SystemException {
// Thomas Neidhart (tome@sbox.tugraz.at)
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Security.Cryptography {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class CryptographicUnexpectedOperationException : CryptographicException {
public CryptographicUnexpectedOperationException ()
#if NET_2_0
+using System.Runtime.InteropServices;
using System.Security.AccessControl;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public sealed class CspKeyContainerInfo {
private CspParameters _params;
//
#if NET_2_0
+using System.Runtime.InteropServices;
using System.Security.AccessControl;
#endif
\r
namespace System.Security.Cryptography {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class CspParameters {
\r
private CspProviderFlags _Flags;\r
// Thomas Neidhart <tome@sbox.tugraz.at>
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
[Flags]
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum CspProviderFlags {
UseMachineKeyStore = 1,
- UseDefaultKeyContainer = 2
+ UseDefaultKeyContainer = 2,
+ UseExistingKey = 8,
#if NET_2_0
- ,
NoFlags = 0,
NoPrompt = 64,
UseArchivableKey = 16,
- UseExistingKey = 8,
UseNonExportableKey = 4,
UseUserProtectedKey = 32
#endif
//
using System.Globalization;
+using System.Runtime.InteropServices;
// References:
// a. FIPS PUB 46-3: Data Encryption Standard
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public abstract class DES : SymmetricAlgorithm {
private const int keySizeByte = 8;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
}
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class DESCryptoServiceProvider : DES {
public DESCryptoServiceProvider () : base ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Text;
using Mono.Xml;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class DSA : AsymmetricAlgorithm {
#if NET_2_0
// (C) 2002
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// Portions (C) 2003 Ben Maurer
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
namespace System.Security.Cryptography {
#if NET_2_0
+ [ComVisible (true)]
public sealed class DSACryptoServiceProvider : DSA, ICspAsymmetricAlgorithm {
#elif NET_1_1
public sealed class DSACryptoServiceProvider : DSA {
// Author:\r
// Thomas Neidhart (tome@sbox.tugraz.at)\r
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
\r
[Serializable]\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct DSAParameters {
\r
public int Counter;\r
// Sebastien Pouliot (sebastien@ximian.com)
//
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class DSASignatureDeformatter : AsymmetricSignatureDeformatter {
private DSA dsa;
// Sebastien Pouliot (sebastien@ximian.com)
//
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class DSASignatureFormatter : AsymmetricSignatureFormatter {
private DSA dsa;
// Author:\r
// Thomas Neidhart (tome@sbox.tugraz.at)\r
//\r
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class DeriveBytes {\r
\r
protected DeriveBytes ()
// Author:
// Sergey Chaban (serge@wildwestsoftware.com)
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum FromBase64TransformMode : int {
IgnoreWhiteSpaces,
DoNotIgnoreWhiteSpaces
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class FromBase64Transform : ICryptoTransform {
private FromBase64TransformMode mode;
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
// not free :-(
// http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI+X9%2E71%2D2000
+ [ComVisible (true)]
public abstract class HMAC : KeyedHashAlgorithm {
private bool _disposed;
private string _hashName;
private HashAlgorithm _algo;
private BlockProcessor _block;
- protected Int32 BlockSizeValue;
+ private int _blockSizeValue;
// constructors
// properties
+ protected int BlockSizeValue {
+ get { return _blockSizeValue; }
+ set { _blockSizeValue = value; }
+ }
+
public string HashName {
get { return _hashName; }
set {
// HMACMD5.cs: HMAC implementation using MD5
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
// b. IETF RFC2202: Test Cases for HMAC-MD5 and HMAC-SHA-1
// (include C source for HMAC-MD5 and HAMAC-SHA1)
// http://www.ietf.org/rfc/rfc2202.txt
-
+ [ComVisible (true)]
public class HMACMD5 : HMAC {
- public HMACMD5 () : this (KeyBuilder.Key (8)) {}
+ public HMACMD5 ()
+ : this (KeyBuilder.Key (8))
+ {
+ }
public HMACMD5 (byte[] rgbKey) : base ()
{
HashSizeValue = 128;
Key = rgbKey;
}
-
- ~HMACMD5 ()
- {
- Dispose (false);
- }
}
}
-#endif
\ No newline at end of file
+#endif
// HMACRIPEMD160.cs: HMAC implementation using RIPEMD160
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public class HMACRIPEMD160 : HMAC {
- public HMACRIPEMD160 () : this (KeyBuilder.Key (8)) {}
+ public HMACRIPEMD160 ()
+ : this (KeyBuilder.Key (8))
+ {
+ }
public HMACRIPEMD160 (byte[] rgbKey) : base ()
{
HashSizeValue = 160;
Key = rgbKey;
}
-
- ~HMACRIPEMD160 ()
- {
- Dispose (false);
- }
}
}
-#endif
\ No newline at end of file
+#endif
// HMACSHA1.cs: Handles HMAC with SHA-1
//
// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.IO;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
}
}
#else
+ [ComVisible (true)]
public class HMACSHA1 : HMAC {
- public HMACSHA1 () : this (KeyBuilder.Key (8))
+ public HMACSHA1 ()
+ : this (KeyBuilder.Key (8))
{
}
HashSizeValue = 160;
Key = rgbKey;
}
-
- ~HMACSHA1 ()
- {
- Dispose (false);
- }
}
#endif
}
// HMACSHA256.cs: HMAC implementation using SHA256
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public class HMACSHA256 : HMAC {
- public HMACSHA256 () : this (KeyBuilder.Key (8)) {}
+ public HMACSHA256 ()
+ : this (KeyBuilder.Key (8))
+ {
+ }
public HMACSHA256 (byte[] rgbKey) : base ()
{
HashSizeValue = 256;
Key = rgbKey;
}
-
- ~HMACSHA256 ()
- {
- Dispose (false);
- }
}
}
-#endif
\ No newline at end of file
+#endif
// HMACSHA384.cs: HMAC implementation using SHA384
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public class HMACSHA384 : HMAC {
- public HMACSHA384 () : this (KeyBuilder.Key (8)) {}
+ public HMACSHA384 ()
+ : this (KeyBuilder.Key (8))
+ {
+ }
public HMACSHA384 (byte[] rgbKey) : base ()
{
HashSizeValue = 384;
Key = rgbKey;
}
-
- ~HMACSHA384 ()
- {
- Dispose (false);
- }
}
}
-#endif
\ No newline at end of file
+#endif
// HMACSHA512.cs: HMAC implementation using SHA512
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public class HMACSHA512 : HMAC {
- public HMACSHA512 () : this (KeyBuilder.Key (8)) {}
+ public HMACSHA512 ()
+ : this (KeyBuilder.Key (8))
+ {
+ }
public HMACSHA512 (byte[] rgbKey) : base ()
{
HashSizeValue = 512;
Key = rgbKey;
}
-
- ~HMACSHA512 ()
- {
- Dispose (false);
- }
}
}
-#endif
\ No newline at end of file
+#endif
using System.Globalization;
using System.IO;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class HashAlgorithm : ICryptoTransform {
protected byte[] HashValue;
// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
//
// Copyright 2001 by Matthew S. Ford.
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface ICryptoTransform : IDisposable {
bool CanReuseTransform {
// ICspAsymmetricAlgorithm.cs: interface for CSP based asymmetric algorithm
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public interface ICspAsymmetricAlgorithm {
byte[] ExportCspBlob (bool includePrivateParameters);
}
}
-#endif
\ No newline at end of file
+#endif
// KeyNumber.cs: Key Number for CAPI containers
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public enum KeyNumber {
Exchange = 1,
Signature = 2
// Sebastien Pouliot (sebastien@ximian.com)
//
// Copyright 2001 by Matthew S. Ford.
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
#if NET_1_0
public class KeySizes {
#else
+ #if NET_2_0
+ [ComVisible (true)]
+ #endif
public sealed class KeySizes {
#endif
private int _maxSize;
// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public abstract class KeyedHashAlgorithm : HashAlgorithm {
protected byte[] KeyValue;
// MACTripleDES.cs: Handles MAC with TripleDES
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// http://www.itl.nist.gov/fipspubs/fip81.htm
// LAMESPEC: MACTripleDES == MAC-CBC using TripleDES (not MAC-CFB).
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class MACTripleDES: KeyedHashAlgorithm {
private TripleDES tdes;
//\r
// Copyright 2001 by Matthew S. Ford.\r
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class MD5 : HashAlgorithm {\r
// Why is it protected when others abstract hash classes are public ?\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
#if NET_1_0
public class MD5CryptoServiceProvider : MD5 {
#else
+ #if NET_2_0
+ [ComVisible (true)]
+ #endif
public sealed class MD5CryptoServiceProvider : MD5 {
#endif
private const int BLOCK_SIZE_BYTES = 64;
// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class MaskGenerationMethod {
protected MaskGenerationMethod ()
{
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract byte[] GenerateMask (byte[] rgbSeed, int cbReturn);
}
}
// PKCS1MaskGenerationMethod.cs: Handles PKCS#1 mask generation.
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
// a. PKCS#1: RSA Cryptography Standard
// http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/index.html
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class PKCS1MaskGenerationMethod : MaskGenerationMethod {
private string hashName;
//
// Copyright 2001 by Matthew S. Ford.
// Portions (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public enum PaddingMode {
None = 0x1,
//
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Text;
namespace System.Security.Cryptography {
// b. IETF RFC2898: PKCS #5: Password-Based Cryptography Specification Version 2.0
// http://www.rfc-editor.org/rfc/rfc2898.txt
+#if NET_2_0
+[ComVisible (true)]
+#endif
public class PasswordDeriveBytes : DeriveBytes {
private string HashNameValue;
// Andrew Birkett (andy@nobugs.org)
// Sebastien Pouliot (sebastien@ximian.com)
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
// a. IETF RFC2286: A Description of the RC2(r) Encryption Algorithm
// http://www.ietf.org/rfc/rfc2268.txt
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class RC2 : SymmetricAlgorithm {
public static new RC2 Create ()
// Sebastien Pouliot (sebastien@ximian.com)
//
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// a. IETF RFC2286: A Description of the RC2(r) Encryption Algorithm
// http://www.ietf.org/rfc/rfc2268.txt
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class RC2CryptoServiceProvider : RC2 {
private bool _useSalt;
// Pieter Philippaerts (Pieter@mentalis.org)
//
// (C) 2003 The Mentalis.org Team (http://www.mentalis.org/)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
/// <summary>
/// Represents the abstract class from which all implementations of the <see cref="RIPEMD160"/> hash algorithm inherit.
/// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class RIPEMD160 : HashAlgorithm {
/// <summary>
/// Initializes a new instance of <see cref="RIPEMD160"/>.
}
}
-#endif
\ No newline at end of file
+#endif
// - http://www.esat.kuleuven.ac.be/~cosicart/ps/AB-9601/
//
// (C) 2003 The Mentalis.org Team (http://www.mentalis.org/)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
/// <summary>
/// Computes the <see cref="RIPEMD160"/> hash for the input data.
/// </summary>
+ [ComVisible (true)]
public class RIPEMD160Managed : RIPEMD160 { // not 'sealed' according to preliminary docs; this may change though
/// <summary>
/// Initializes a new instance of the <see cref="RIPEMD160Managed"/> class. This class cannot be inherited.
// Great Power without form."
// -- The Verrah Rubicon of Verena, Book One
-using System;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Text;
namespace System.Security.Cryptography {
#if NET_1_0
public class RNGCryptoServiceProvider : RandomNumberGenerator {
#else
+ #if NET_2_0
+ [ComVisible (true)]
+ #endif
public sealed class RNGCryptoServiceProvider : RandomNumberGenerator {
#endif
private static object _lock;
//
// (C) 2002
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Text;
using Mono.Xml;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class RSA : AsymmetricAlgorithm {
public static new RSA Create ()
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// Portions (C) 2003 Ben Maurer
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
namespace System.Security.Cryptography {
-#if (NET_2_0)
+#if NET_2_0
+ [ComVisible (true)]
public sealed class RSACryptoServiceProvider : RSA, ICspAsymmetricAlgorithm {
#else
public sealed class RSACryptoServiceProvider : RSA {
//
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter {
private RSA rsa;
//
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAOAEPKeyExchangeFormatter : AsymmetricKeyExchangeFormatter {
private RSA rsa;
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAPKCS1KeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter {
private RSA rsa;
//
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
// LAMESPEC: There seems no way to select a hash algorithm. The default
// algorithm, is SHA1 because the class use the PKCS1MaskGenerationMethod -
// which default to SHA1.
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAPKCS1KeyExchangeFormatter: AsymmetricKeyExchangeFormatter
{
private RSA rsa;
//
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAPKCS1SignatureDeformatter : AsymmetricSignatureDeformatter {
private RSA rsa;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class RSAPKCS1SignatureFormatter : AsymmetricSignatureFormatter {
private RSA rsa;
// Dan Lewis (dihlewis@yahoo.co.uk)\r
//\r
// (C) 2002\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
\r
[Serializable]\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct RSAParameters {\r
[NonSerialized]\r
public byte[] P;\r
// Duco Fijma (duco@lorentz.xs4all.nl)
//
// (C) 2002 Duco Fijma
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class RandomNumberGenerator {
public RandomNumberGenerator ()
#if NET_2_0
+using System.Runtime.InteropServices;
using System.Text;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+ [ComVisible (true)]
public class Rfc2898DeriveBytes : DeriveBytes {
private const int defaultIterations = 1000;
// Andrew Birkett (andy@nobugs.org)\r
//\r
// (C) 2002\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
\r
-using System;\r
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
// a. FIPS PUB 197: Advanced Encryption Standard
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class Rijndael : SymmetricAlgorithm {\r
\r
public static new Rijndael Create () \r
//
// (C) 2002
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
// a. FIPS PUB 197: Advanced Encryption Standard
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class RijndaelManaged : Rijndael {
public RijndaelManaged ()
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
// (and more general) one (RijndaelTransform) located in
// RijndaelManaged.cs.
+ [ComVisible (true)]
public sealed class RijndaelManagedTransform: ICryptoTransform, IDisposable {
private RijndaelTransform _st;
//\r
// Copyright 2001 by Matthew S. Ford.\r
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class SHA1 : HashAlgorithm {\r
protected SHA1 ()\r
// Mono must provide those two class for binary compatibility.
// In our case both class are wrappers around a managed internal class SHA1Internal.
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
internal class SHA1Internal {
}
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class SHA1CryptoServiceProvider : SHA1 {
private SHA1Internal sha;
// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
// Note:
// Mono must provide those two class for binary compatibility.
// In our case both class are wrappers around a managed internal class SHA1Internal.
-public class SHA1Managed : SHA1 {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ public class SHA1Managed : SHA1 {
- private SHA1Internal sha;
+ private SHA1Internal sha;
- public SHA1Managed ()
- {
- sha = new SHA1Internal ();
- }
+ public SHA1Managed ()
+ {
+ sha = new SHA1Internal ();
+ }
- protected override void HashCore (byte[] rgb, int start, int size)
- {
- State = 1;
- sha.HashCore (rgb, start, size);
- }
+ protected override void HashCore (byte[] rgb, int start, int size)
+ {
+ State = 1;
+ sha.HashCore (rgb, start, size);
+ }
- protected override byte[] HashFinal ()
- {
- State = 0;
- return sha.HashFinal ();
- }
+ protected override byte[] HashFinal ()
+ {
+ State = 0;
+ return sha.HashFinal ();
+ }
- public override void Initialize ()
- {
- sha.Initialize ();
+ public override void Initialize ()
+ {
+ sha.Initialize ();
+ }
}
}
-
-}
-
//\r
// Copyright 2001 by Matthew S. Ford.\r
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class SHA256 : HashAlgorithm {\r
public SHA256 () \r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class SHA256Managed : SHA256 {
private const int BLOCK_SIZE_BYTES = 64;
//\r
// Copyright 2001 by Matthew S. Ford.\r
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class SHA384 : HashAlgorithm {\r
public SHA384 () \r
// (C) 2002
// Implementation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
// See bouncycastle.txt for license.
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public class SHA384Managed : SHA384 {
private byte[] xBuf;
//\r
// Copyright 2001 by Matthew S. Ford.\r
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)\r
-// (C) 2004 Novell (http://www.novell.com)
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class SHA512 : HashAlgorithm {\r
public SHA512 () \r
// (C) 2002
// Implementation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
// See bouncycastle.txt for license.
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public class SHA512Managed : SHA512 {
private byte[] xBuf;
//
// System.Security.Cryptography.SHAConstants.cs
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
namespace System.Security.Cryptography {\r
+#if NET_2_0
+ internal static class SHAConstants {
+#else
internal sealed class SHAConstants {
private SHAConstants ()
{
// Never instantiated.\r
}
-
+#endif
// SHA-256 Constants
// Represent the first 32 bits of the fractional parts of the
// cube roots of the first sixty-four prime numbers
// Sebastien Pouliot <sebastien@ximian.com>
//
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// http://www.csharpfriends.com/Members/Main/Classes/get_class.aspx?assembly=mscorlib,%20Version=1.0.3300.0,%20Culture=neutral,%20PublicKeyToken=b77a5c561934e089&namespace=System.Security.Cryptography&class=SignatureDescription
// Those 2 classes are returned by CryptoConfig.CreateFromName and used in XMLDSIG
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Security;
namespace System.Security.Cryptography {
+#if NET_2_0
+[ComVisible (true)]
+#endif
public class SignatureDescription {
private string _DeformatterAlgorithm;
//
using System.Globalization;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract class SymmetricAlgorithm : IDisposable {
protected int BlockSizeValue;
protected int FeedbackSizeValue;
// Sergey Chaban (serge@wildwestsoftware.com)
//
// (C) 2004 Novell (http://www.novell.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Cryptography {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public class ToBase64Transform : ICryptoTransform {
private bool m_disposed;
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Security.Cryptography;
namespace System.Security.Cryptography {
// not free :-(
// http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI+X9%2E52%2D1998
+#if NET_2_0
+[ComVisible (true)]
+#endif
public abstract class TripleDES : SymmetricAlgorithm {
public TripleDES ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography {
// not free :-(
// http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI+X9%2E52%2D1998
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class TripleDESCryptoServiceProvider : TripleDES {
public TripleDESCryptoServiceProvider ()
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * StrongNamePublicKeyBlob.cs: Reduce casts in Equals.
+
+2005-06-09 Sebastien Pouliot <sebastien@ximian.com>
+
+ * all: Added ComVisible(true) and some Obsolete attributes for NET_2_0
+
+2005-06-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * IsolatedStorageFilePermission.cs: Removed unrequired TODO on ctor.
+ Added ComVisible for NET_2_0.
+ * GacIdentityPermissionAttribute.cs: Removed FIXME. Added ComVisible
+ for NET_2_0.
+
2005-05-18 Sebastien Pouliot <sebastien@ximian.com>
* HostProtectionAttribute.cs: Fixes flag cleaning logical
-//------------------------------------------------------------------------------
//
// System.Security.Permissions.SecurityPermissionAttribute.cs
//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
// Author: Nick Drochak, ndrochak@gol.com
// Created: 2002-01-06
//
-//------------------------------------------------------------------------------
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2001 Nick Drochak, All Rights Reserved
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage(
AttributeTargets.Assembly
| AttributeTargets.Class
//
// Copyright (C) 2002, Tim Coleman
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Collections;
+using System.Runtime.InteropServices;
using System.Text;
-
-namespace System.Security.Permissions {
-
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum EnvironmentPermissionAccess {
- /// <summary>
- /// </summary>
NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
Read = 0x00000001,
-
- /// <summary>
- /// </summary>
Write = 0x00000002,
-
- /// <summary>
- /// </summary>
AllAccess = Read | Write,
- } // EnvironmentPermissionAccess
-
-} // System.Security.Permissions
+ }
+}
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
// Author: Duncan Mak (duncan@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
+
+namespace System.Security.Permissions {
-namespace System.Security.Permissions
-{
- [Flags] [Serializable]
- public enum FileDialogPermissionAccess
- {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ [Flags]
+ [Serializable]
+ public enum FileDialogPermissionAccess {
None = 0,
Open = 1,
Save = 2,
//
// Authors
// Duncan Mak <duncan@ximian.com>
-// Sebastien Pouliot <spouliot@motus.com>
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
private bool canSave;
// Constructor
- public FileDialogPermissionAttribute (SecurityAction action) : base (action) {}
+ public FileDialogPermissionAttribute (SecurityAction action)
+ : base (action)
+ {
+ }
// Properties
public bool Open {
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2001 Nick Drochak, All Rights Reserved\r
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
\r
namespace System.Security.Permissions {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]\r
public sealed class FileIOPermission\r
: CodeAccessPermission, IBuiltInPermission, IUnrestrictedPermission {\r
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum FileIOPermissionAccess {
- /// <summary>
- /// </summary>
NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
Read = 0x00000001,
-
- /// <summary>
- /// </summary>
Write = 0x00000002,
-
- /// <summary>
- /// </summary>
Append = 0x00000004,
-
- /// <summary>
- /// </summary>
PathDiscovery = 0x00000008,
-
- /// <summary>
- /// </summary>
AllAccess = Read | Write | Append | PathDiscovery,
- } // FileIOPermissionAccess
-
-} // System.Security.Permissions
+ }
+}
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
using System.Globalization;
-
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+ [ComVisible (true)]
[Serializable]
public sealed class GacIdentityPermission : CodeAccessPermission, IBuiltInPermission {
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
[Serializable]
+ [ComVisible (true)]
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public override IPermission CreatePermission ()
{
-// FIXME: should be "unrestricted aware" but MS version isn't in Fx 2.0 beta 1
return (IPermission) new GacIdentityPermission ();
}
}
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Delegate,
AllowMultiple = true, Inherited = false)]
+ [ComVisible (true)]
[Serializable]
public sealed class HostProtectionAttribute : CodeAccessSecurityAttribute {
}
}
+ [ComVisible (true)]
public bool SecurityInfrastructure {
get { return ((_resources & HostProtectionResource.SecurityInfrastructure) != 0); }
set {
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
[Flags]
[Serializable]
+ [ComVisible (true)]
public enum HostProtectionResource {
None = 0,
Synchronization = 1,
// Nick Drochak(ndrochak@gol.com)\r
//\r
// (C) Nick Drochak\r
-//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+using System.Runtime.InteropServices;
\r
namespace System.Security.Permissions {\r
\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface IUnrestrictedPermission {\r
- bool IsUnrestricted();\r
+ bool IsUnrestricted ();\r
}\r
}\r
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
namespace System.Security.Permissions {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class IsolatedStorageFilePermission : IsolatedStoragePermission, IBuiltInPermission {
private const int version = 1;
// Constructors
- [MonoTODO ("usage/quota calculated from evidences/policy")]
- public IsolatedStorageFilePermission (PermissionState state) : base (state)
+ public IsolatedStorageFilePermission (PermissionState state)
+ : base (state)
{
- if (!IsUnrestricted ()) {
- // TODO
- }
}
// Properties
}
#if NET_2_0
- [MonoTODO]
+ [MonoTODO ("new override - something must have been added ???")]
[ComVisible (false)]
public override SecurityElement ToXml ()
{
- SecurityElement se = base.ToXml ();
- // TODO - something must have been added ???
- return se;
+ return base.ToXml ();
}
#endif
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Dan Lewis (dihlewis@yahoo.co.uk)
//
// (C) 2002
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage ( AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Author
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
[Serializable]
+ [ComVisible (true)]
public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
private KeyContainerPermissionAccessEntryCollection _accessEntries;
// Author
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
using System.Globalization;
+using System.Runtime.InteropServices;
using System.Security.Cryptography;
namespace System.Security.Permissions {
[Serializable]
+ [ComVisible (true)]
public sealed class KeyContainerPermissionAccessEntry {
private KeyContainerPermissionFlags _flags;
// Author
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Collections;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
[Serializable]
+ [ComVisible (true)]
public sealed class KeyContainerPermissionAccessEntryCollection : ICollection, IEnumerable {
private ArrayList _list;
// Author
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
using System.Collections;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
[Serializable]
+ [ComVisible (true)]
public sealed class KeyContainerPermissionAccessEntryEnumerator : IEnumerator {
private IEnumerator e;
// Author
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method,
AllowMultiple = true, Inherited = false)]
+ [ComVisible (true)]
[Serializable]
public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute {
#if NET_2_0
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
[Flags]
[Serializable]
+ [ComVisible (true)]
public enum KeyContainerPermissionFlags {
NoFlags = 0,
Create = 1,
//
using System.IO;
+using System.Runtime.InteropServices;
using System.Security.Policy;
using System.Text;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum PermissionState {
- /// <summary>
- /// </summary>
Unrestricted = 1,
-
- /// <summary>
- /// </summary>
None = 0,
- } // PermissionState
-
-} // System.Security.Permissions
+ }
+}
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class PrincipalPermission : IPermission, IUnrestrictedPermission, IBuiltInPermission {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
[Serializable]
public sealed class PrincipalPermissionAttribute : CodeAccessSecurityAttribute {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using Mono.Security.Cryptography;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class PublisherIdentityPermission : CodeAccessPermission, IBuiltInPermission {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using SSCX = System.Security.Cryptography.X509Certificates;
using Mono.Security.Cryptography;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
//
// Copyright (C) 2002, Tim Coleman
// Portions (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class ReflectionPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
[Flags]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum ReflectionPermissionFlag {
- /// <summary>
- /// </summary>
NoFlags = 0x00000000,
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [Obsolete ("not used anymore")]
+#endif
TypeInformation = 0x00000001,
- /// <summary>
- /// </summary>
MemberAccess = 0x00000002,
- /// <summary>
- /// </summary>
ReflectionEmit = 0x4,
- /// <summary>
- /// </summary>
- AllFlags = TypeInformation | MemberAccess | ReflectionEmit,
- } // ReflectionPermissionFlag
-
-} // System.Security.Permissions
+ AllFlags = TypeInformation | MemberAccess | ReflectionEmit
+ }
+}
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Text;
#if NET_2_0
+using System.Runtime.InteropServices;
using System.Security.AccessControl;
#endif
namespace System.Security.Permissions {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public sealed class RegistryPermission
: CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
public enum RegistryPermissionAccess {
- /// <summary>
- /// </summary>
NoAccess = 0,
-
- /// <summary>
- /// </summary>
Read = 1,
-
- /// <summary>
- /// </summary>
Write = 2,
-
- /// <summary>
- /// </summary>
Create = 4,
-
- /// <summary>
- /// </summary>
AllAccess = 7,
- } // RegistryPermissionAccess
-
-} // System.Security.Permissions
+ }
+}
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions Copyright (C) 2003 Motus Technologies (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-
-namespace System.Security.Permissions {
-
+using System.Runtime.InteropServices;
+\r
+namespace System.Security.Permissions {\r
+\r
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
#if NET_2_0 || BOOTSTRAP_NET_2_0
+ [ComVisible (true)]
[Serializable]
#endif
public enum SecurityAction {
RequestOptional = 9,
RequestRefuse = 10,
#if NET_2_0 || BOOTSTRAP_NET_2_0
+ [Obsolete ("to be removed before 2.0 RTM")]
LinkDemandChoice = 16,
+ [Obsolete ("to be removed before 2.0 RTM")]
InheritanceDemandChoice = 17,
+ [Obsolete ("to be removed before 2.0 RTM")]
DemandChoice = 18
#endif
}
-//------------------------------------------------------------------------------
//
// System.Security.Permissions.SecurityAttribute.cs
//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
// Author: Nick Drochak, ndrochak@gol.com
// Created: 2002-01-06
//
-//------------------------------------------------------------------------------
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2001 Nick Drochak, All Rights Reserved
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage(
AttributeTargets.Assembly
| AttributeTargets.Class
//
// (C) 2002
// Portions (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+
[Serializable]
public sealed class SecurityPermission :
CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
-//------------------------------------------------------------------------------
//
// System.Security.Permissions.SecurityPermissionAttribute.cs
//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
// Author: Nick Drochak, ndrochak@gol.com
// Created: 2002-01-06
//
-//------------------------------------------------------------------------------
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2001 Nick Drochak, All Rights Reserved
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using System.Security;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
- [System.AttributeUsage(
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ [AttributeUsage (
System.AttributeTargets.Assembly
| System.AttributeTargets.Class
| System.AttributeTargets.Struct
}
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public bool Infrastructure {
get {
return ((m_Flags & SecurityPermissionFlag.Infrastructure) != 0);
// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Flags]
[Serializable]
public enum SecurityPermissionFlag {
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class SiteIdentityPermission : CodeAccessPermission, IBuiltInPermission {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Collections;
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class StrongNameIdentityPermission : CodeAccessPermission, IBuiltInPermission {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
using System.Text;
namespace System.Security.Permissions {
+#if NET_2_0
+[ComVisible (true)]
+#endif
[Serializable]
public sealed class StrongNamePublicKeyBlob {
public override bool Equals (object obj)
{
- bool result = (obj is StrongNamePublicKeyBlob);
+ StrongNamePublicKeyBlob snpkb = (obj as StrongNamePublicKeyBlob);
+ if (snpkb == null)
+ return false;
+
+ bool result = (pubkey.Length == snpkb.pubkey.Length);
if (result) {
- StrongNamePublicKeyBlob snpkb = (obj as StrongNamePublicKeyBlob);
- result = (pubkey.Length == snpkb.pubkey.Length);
- if (result) {
- for (int i = 0; i < pubkey.Length; i++) {
- if (pubkey[i] != snpkb.pubkey[i])
- return false;
- }
+ for (int i = 0; i < pubkey.Length; i++) {
+ if (pubkey[i] != snpkb.pubkey[i])
+ return false;
}
}
return result;
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class UIPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
// Duncan Mak <duncan@ximian.com>
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
private UIPermissionWindow window;
// Constructor
- public UIPermissionAttribute (SecurityAction action) : base (action) {}
+ public UIPermissionAttribute (SecurityAction action) : base (action)
+ {
+ }
// Properties
- public UIPermissionClipboard Clipboard
- {
+ public UIPermissionClipboard Clipboard {
get { return clipboard; }
set { clipboard = value; }
}
- public UIPermissionWindow Window
- {
+ public UIPermissionWindow Window {
get { return window; }
set { window = value; }
}
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum UIPermissionClipboard {
- /// <summary>
- /// </summary>
NoClipboard = 0,
-
- /// <summary>
- /// </summary>
OwnClipboard = 1,
-
- /// <summary>
- /// </summary>
AllClipboard = 2,
- } // UIPermissionClipboard
-
-} // System.Security.Permissions
+ }
+}
// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
-
- /// <summary>
- /// </summary>
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum UIPermissionWindow {
- /// <summary>
- /// </summary>
NoWindows = 0,
-
- /// <summary>
- /// </summary>
SafeSubWindows = 1,
-
- /// <summary>
- /// </summary>
SafeTopLevelWindows = 2,
-
- /// <summary>
- /// </summary>
AllWindows = 3,
- } // UIPermissionWindow
-
-} // System.Security.Permissions
+ }
+}
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
using System.Globalization;
+using System.Runtime.InteropServices;
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class ZoneIdentityPermission : CodeAccessPermission, IBuiltInPermission {
//
// (C) 2002 Ximian, Inc. http://www.ximian.com
// Portions (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security.Permissions {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
+2005-06-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * PolicyLevel.cs: Added some missing initialization. More code reuse.
+
2005-06-01 Sebastien Pouliot <sebastien@ximian.com>
* DefaultPolicies.cs: Added a method to create the default FullTrust
IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
isfp.UsageAllowed = IsolatedStorageContainment.DomainIsolationByUser;
+#if NET_2_0
+ isfp.UserQuota = 512000;
+#else
isfp.UserQuota = 10240;
+#endif
nps.AddPermission (isfp);
nps.AddPermission (new SecurityPermission (SecurityPermissionFlag.Execution));
public static PolicyLevel CreateAppDomainLevel ()
{
- NamedPermissionSet fullTrust = new NamedPermissionSet ("FullTrust", PermissionState.Unrestricted);
- UnionCodeGroup cg = new UnionCodeGroup (new AllMembershipCondition (), new PolicyStatement (fullTrust));
+ UnionCodeGroup cg = new UnionCodeGroup (new AllMembershipCondition (), new PolicyStatement (DefaultPolicies.FullTrust));
cg.Name = "All_Code";
PolicyLevel pl = new PolicyLevel ("AppDomain", PolicyLevelType.AppDomain);
pl.RootCodeGroup = cg;
{
if (fullNames != null)
fullNames.Clear ();
- full_trust_assemblies.Clear ();
- named_permission_sets.Clear ();
if (_type != PolicyLevelType.AppDomain) {
+ full_trust_assemblies.Clear ();
+ named_permission_sets.Clear ();
+
// because the policy doesn't exist LoadFromFile will try to
// 1. use the .default file if existing (like Fx 2.0 does); or
// 2. use the hard-coded default values
catch {}
}
LoadFromFile (_location);
- }
- else {
- named_permission_sets.Add (DefaultPolicies.LocalIntranet);
- named_permission_sets.Add (DefaultPolicies.Internet);
- named_permission_sets.Add (DefaultPolicies.SkipVerification);
- named_permission_sets.Add (DefaultPolicies.Execution);
- named_permission_sets.Add (DefaultPolicies.Nothing);
- named_permission_sets.Add (DefaultPolicies.Everything);
- named_permission_sets.Add (DefaultPolicies.FullTrust);
+ } else {
+ CreateDefaultFullTrustAssemblies ();
+ CreateDefaultNamedPermissionSets ();
}
}
CodeGroup cg = root_code_group.ResolveMatchingCodeGroups (evidence);
// TODO
return ((cg != null) ? cg : null);
-
}
public SecurityElement ToXml ()
break;
}
+ CreateDefaultFullTrustAssemblies ();
+ }
+
+ internal void CreateDefaultFullTrustAssemblies ()
+ {
// (default) assemblies that are fully trusted during policy resolution
full_trust_assemblies.Clear ();
full_trust_assemblies.Add (DefaultPolicies.FullTrustMembership ("mscorlib", DefaultPolicies.Key.Ecma));
throw new ArgumentNullException ("name");
if (version == null)
throw new ArgumentNullException ("version");
+ if (name.Length == 0)
+ throw new ArgumentException (Locale.GetText ("Empty"), "name");
publickey = blob;
this.name = name;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Collections;
using System.Globalization;
using System.Security.Permissions;
using System.Runtime.InteropServices;
+using System.Text;
namespace System.Security.Policy {
this.blob = blob;
this.name = name;
- assemblyVersion = version;
+ if (version != null)
+ assemblyVersion = (Version) version.Clone ();
}
// for PolicyLevel (to avoid validation duplication)
get { return blob; }
set {
if (value == null)
- throw new ArgumentNullException (
- Locale.GetText ("The argument is null."));
+ throw new ArgumentNullException ("PublicKey");
blob = value;
}
}
if (evidence == null)
return false;
- foreach (object o in evidence) {
- if (o is StrongName) {
- StrongName sn = (o as StrongName);
- /* ??? partial match ??? */
- if (sn.PublicKey.Equals (blob) && (sn.Name == name) && (sn.Version.Equals (assemblyVersion)))
- return true;
+ IEnumerator e = evidence.GetHostEnumerator ();
+ while (e.MoveNext ()) {
+ StrongName sn = (e.Current as StrongName);
+ if (sn != null) {
+ if (!sn.PublicKey.Equals (blob))
+ return false;
+ if ((name != null) && (name != sn.Name))
+ return false;
+ if ((assemblyVersion != null) && !assemblyVersion.Equals (sn.Version))
+ return false;
+ return true;
}
}
return false;
}
public override bool Equals (object o)
- {
- if (o is StrongNameMembershipCondition == false)
+ {
+ StrongNameMembershipCondition snmc = (o as StrongNameMembershipCondition);
+ if (snmc == null)
return false;
- else {
- StrongNameMembershipCondition snmc = (StrongNameMembershipCondition) o;
- return (snmc.Name == Name && snmc.Version == Version && snmc.PublicKey == PublicKey);
- }
+ if (!snmc.PublicKey.Equals (PublicKey))
+ return false;
+ if (name != snmc.Name)
+ return false;
+ if (assemblyVersion != null)
+ return assemblyVersion.Equals (snmc.Version);
+ return (snmc.Version == null);
}
public override int GetHashCode ()
{
+ // name and version aren't part of the calculation
return blob.GetHashCode ();
}
name = e.Attribute ("Name");
string v = (string) e.Attribute ("AssemblyVersion");
if (v == null)
- assemblyVersion = new Version ();
+ assemblyVersion = null;
else
assemblyVersion = new Version (v);
}
public override string ToString ()
{
- // ??? missing informations ???
- return String.Format ( "Strong Name - {0} name = {1} version {2}",
- blob, name, assemblyVersion);
+ StringBuilder sb = new StringBuilder ("StrongName - ");
+ sb.Append (blob);
+ if (name != null)
+ sb.AppendFormat (" name = {0}", name);
+ if (assemblyVersion != null)
+ sb.AppendFormat (" version = {0}", assemblyVersion);
+ return sb.ToString ();
}
public SecurityElement ToXml ()
return new ZoneMembershipCondition (zone);
}
- public override bool Equals (Object o)
- {
- if (o is ZoneMembershipCondition == false)
- return false;
- else
- return ((ZoneMembershipCondition) o).SecurityZone == zone;
- }
+ public override bool Equals (object o)
+ {
+ ZoneMembershipCondition zmc = (o as ZoneMembershipCondition);
+ if (zmc == null)
+ return false;
+ return (zmc.SecurityZone == zone);
+ }
public void FromXml (SecurityElement element)
{
// System.Security.AllowPartiallyTrustedCallersAttribute implementation
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003, 2004 Motus Technologies Inc. (http://www.motus.com)
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed class AllowPartiallyTrustedCallersAttribute : Attribute {
+2005-06-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AllowPartiallyTrustedCallersAttribute.cs, HostSecurityManagerFlags.cs
+ IEvidenceFactory.cs, IPermission.cs, ISecurityEncodable.cs,
+ ISecurityPolicyEncodable.cs, IStackWalk.cs, NamedPermissionSet.cs,
+ PolicyLevelType.cs, SecureString.cs, SecurityElement.cs,
+ SecurityZone.cs, UnverifiableCodeAttribute.cs, VerificationException.cs
+ XmlSyntaxException.cs: Fix 2.0 beta2 API changes (which is mostly
+ adding ComVisible attributes to classes).
+
2005-06-01 Sebastien Pouliot <sebastien@ximian.com>
* PermissionBuilder.cs: Removed unification stuff. This is done at a
#if NET_2_0
+using System.Runtime.InteropServices;
+
namespace System.Security {
[Flags]
+ [ComVisible (true)]
[Serializable]
public enum HostSecurityManagerOptions {
None = 0,
// Sean MacIsaac (macisaac@ximian.com)
//
// (C) Ximian, Inc. 2001
-
-//
-// 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.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using System.Security.Policy;
-namespace System.Security
-{
- public interface IEvidenceFactory
- {
+namespace System.Security {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
+ public interface IEvidenceFactory {
Evidence Evidence { get; }
}
}
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// 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.Runtime.InteropServices;
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface IPermission : ISecurityEncodable {
IPermission Copy ();
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// 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.Runtime.InteropServices;
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface ISecurityEncodable {
void FromXml (SecurityElement e);
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-//
-
-//
-// 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.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
using System.Security.Policy;
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface ISecurityPolicyEncodable {
void FromXml (SecurityElement e, PolicyLevel level);
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// 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.Runtime.InteropServices;
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public interface IStackWalk {
void Assert ();
//
// (C) 2002
// Portions (C) 2003, 2004 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Security.Permissions;
namespace System.Security {
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class NamedPermissionSet : PermissionSet {
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Runtime.InteropServices;
+
namespace System.Security {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum PolicyLevelType {
User = 0x0,
Machine,
// Authors
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
-using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
namespace System.Security {
[MonoTODO ("current version ISN'T encrypted")]
- [ComVisible (false)]
public sealed class SecureString : CriticalFinalizerObject, IDisposable {
static private SymmetricAlgorithm _cipher;
Encrypt ();
}
- ~SecureString ()
- {
- Dispose ();
- }
-
// properties
public int Length {
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using Mono.Xml;
-namespace System.Security
-{
+namespace System.Security {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[Serializable]
public sealed class SecurityElement
{
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// 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.Runtime.InteropServices;
namespace System.Security {
[Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public enum SecurityZone {
MyComputer = 0x0,
Intranet,
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// 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.Runtime.InteropServices;
namespace System.Security {
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[AttributeUsage (AttributeTargets.Module, AllowMultiple=true, Inherited=false)]
- public sealed class UnverifiableCodeAttribute : Attribute {}
+ public sealed class UnverifiableCodeAttribute : Attribute {
+ }
}
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
[Serializable]
#if NET_2_0
- public class VerificationException : SystemException, _Exception {
-#else
- public class VerificationException : SystemException {
+ [ComVisible (true)]
#endif
+ public class VerificationException : SystemException {
// Constructors
public VerificationException ()
// Nick Drochak(ndrochak@gol.com)
//
// (C) Nick Drochak
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
[Serializable]
#if NET_2_0
- public sealed class XmlSyntaxException : SystemException, _Exception {
-#else
- public sealed class XmlSyntaxException : SystemException {
+ [ComVisible (true)]
#endif
+ public sealed class XmlSyntaxException : SystemException {
+
// Constructors
public XmlSyntaxException ()
{
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Thread.cs: check that the culture is valid for formatting
+ (ie, (!neutral || invariant)).
+
+2005-06-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Thread.cs: Added _Thread interface (and members) and a few missing
+ attributes (for both 1.1 and 2.0).
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Thread.cs Mutex.cs Monitor.cs: Add some missing 2.0 attributes.
+
2005-05-29 Sebastien Pouliot <sebastien@ximian.com>
* Timer.cs: Added new constructor for 2.0 and ComVisible attribute.
private extern static void Monitor_exit(object obj);
#if NET_2_0
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
#endif
public static void Exit(object obj) {
if(obj==null) {
using System.Runtime.CompilerServices;
using System.Security.Permissions;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System.Threading
{
public sealed class Mutex : WaitHandle
{
Handle = CreateMutex_internal (initiallyOwned, name, out createdNew);
}
-
+
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public void ReleaseMutex() {
ReleaseMutex_internal(Handle);
}
using System.Security.Principal;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.IO;
using System.Collections;
using System.Security;
#if NET_2_0
using System.Runtime.ConstrainedExecution;
-using System.Runtime.InteropServices;
#endif
-namespace System.Threading
-{
- public sealed class Thread
- {
+namespace System.Threading {
+
+ [ClassInterface (ClassInterfaceType.None)]
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterface (typeof (_Thread))]
+#endif
+ public sealed class Thread : _Thread {
+
#region Sync with metadata/object-internals.h
int lock_thread_id;
// stores a thread handle
if (value == null)
throw new ArgumentNullException ("value");
+ value.CheckNeutral ();
in_currentculture = true;
try {
BinaryFormatter bf = new BinaryFormatter();
}
[MonoTODO]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public static void SpinWait (int iterations)
{
throw new NotImplementedException ();
}
public int ManagedThreadId {
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
get { return thread_id; }
}
}
[MonoTODO]
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
public static void BeginThreadAffinity ()
{
throw new NotImplementedException ();
}
[MonoTODO]
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
public static void EndThreadAffinity ()
{
throw new NotImplementedException ();
{
ExecutionContext.SecurityContext.CompressedStack = stack;
}
+
+#if NET_1_1
+ void _Thread.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Thread.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Thread.GetTypeInfoCount (out uint pcTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Thread.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
+ IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
using System.Runtime.Remoting;
using System.Runtime.Remoting.Activation;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Security.Policy;
using System.Configuration.Assemblies;
namespace System
{
- public sealed class Activator
+ [ClassInterface (ClassInterfaceType.None)]
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterface (typeof (_Activator))]
+#endif
+ public sealed class Activator : _Activator
{
const BindingFlags _flags = BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance;
const BindingFlags _accessFlags = BindingFlags.DeclaredOnly | BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase |
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern object CreateInstanceInternal (Type type);
+
+#if NET_1_1
+ void _Activator.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Activator.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Activator.GetTypeInfoCount (out uint pcTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _Activator.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
+ IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
using System.Security.Principal;
using System.Configuration.Assemblies;
-namespace System
-{
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
+namespace System {
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[ClassInterface(ClassInterfaceType.None)]
public sealed class AppDomain : MarshalByRefObject , _AppDomain , IEvidenceFactory
{
}
[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.MayCorruptAppDomain, Cer.MayFail)]
+#endif
public static void Unload (AppDomain domain)
{
if (domain == null)
}
public int Id {
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
get { return getDomainID (); }
}
return GetAssemblies (true);
}
#endif
+
+#if NET_1_1
+ void _AppDomain.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _AppDomain.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _AppDomain.GetTypeInfoCount (out uint pcTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _AppDomain.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
+ IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Reflection;
using System.Runtime.Hosting;
+using System.Runtime.InteropServices;
using System.Security;
+using System.Security.Permissions;
using System.Security.Policy;
using System.Threading;
namespace System {
+ [ComVisible (true)]
+ [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
+ [SecurityPermission (SecurityAction.InheritanceDemand, Infrastructure = true)]
public class AppDomainManager : MarshalByRefObject {
private ApplicationActivator _activator;
private Assembly _entry;
private HostExecutionContextManager _host_context;
private HostSecurityManager _host_security;
- private DomainManagerInitializationFlags _flags;
+ private AppDomainManagerInitializationOptions _flags;
public AppDomainManager ()
{
- _flags = DomainManagerInitializationFlags.None;
+ _flags = AppDomainManagerInitializationOptions.None;
}
public virtual ApplicationActivator ApplicationActivator {
}
}
- public DomainManagerInitializationFlags InitializationFlags {
+ public AppDomainManagerInitializationOptions InitializationFlags {
get { return _flags; }
set { _flags = value; }
}
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Convert.cs: FromBase64String and FromBase64CharArray are now internal
+ calls to avoid extra allocations.
+
+2005-06-09 Kamil Skalski <nazgul@nemerle.org>
+
+ * Type.cs: Add MakeGenericType method form .NET 2.0 beta 2 API
+
+ * Type.cs MonoType.cs: Add internal virtual
+ Get{Method,Constructor,Field} for obtaining instanciated *Info objects
+ from non-instanciated counterparts
+
+2005-06-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * ModuleHandle RuntimeMethodHandle.cs RuntimeTypeHandle.cs RuntimeFieldHandle.cs RuntimeArgumentHandle.cs: Add missing 2.0 attributes.
+
+2005-06-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * Type.cs: Add missing 2.0 attributes.
+
+2005-06-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * MonoCustomAttrs.cs: Added GetCustomAttributesDataInternal icall, and
+ also internal method GetCustomAttributesData, used by
+ System.Reflection.CustomAttributeData.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Activator.cs: Added _Activator interface (and members) for 1.1 and
+ missing attributes (for both 1.1 and 2.0).
+ * String.cs: Made internal To[Lower|Upper]Invariant methods public for
+ 2.0. Reworked Trim() to skip a useless call. Added missing attribute
+ for 2.0.
+ * Type.cs: Added _Type, _MemberInfo interfaces (1.1/2.0). Added
+ missing attribute for 2.0. Hided some public/protected methods.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * ModuleHandle.cs: Update after PortableExecutableKinds name change.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * _AppDomain.cs: Added new members in the interface (added in 1.1 SP1)
+ * AppDomain.cs: Added new members from _AppDomain interface.
+ * AppDomainManager.cs: Fixed flags and added attributes.
+ * DomainManagerInitializationFlags.cs: The flag has been renamed to
+ AppDomainManagerInitializationOptions in beta2.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Type.cs MonoCustomAttrs.cs: Return SerializableAttribute for types as well.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Exception.cs: Implements _Exception only for 2.0.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * GC.cs: Fix build.
+
+ * GC.cs UnhandledExceptionEventArgs.cs IntPtr.cs RuntimeFieldHandle.cs
+ String.cs Object.cs Math.cs RuntimeMethodHandle.cs ModuleHandle.cs
+ RuntimeTypeHandle.cs AppDomain.cs: Add some missing 2.0 methods/attributes.
+
2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Environment.cs:
* Decimal.cs: Changed to use NumberFormatter in ToString.
* NumberFormatter.cs: Implemented decimal formatter.
-2005-06-03 Martin Baulig <martin@ximian.com>
-
- * CharEnumerator.cs: Reverting Ben's latest change (r45312/45313)
- for the moment since it breaks the build; see #75136.
-
2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Type.cs: reverted wrong fix for bug #71300 in r45150. This makes SSL
//
using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
namespace System
{
[Serializable]
public sealed class CharEnumerator : IEnumerator, ICloneable
+#if NET_2_0
+ , IEnumerator <char>
+#endif
{
private string str;
private int index;
{
index = -1;
}
+#if NET_2_0
+ void IDisposable.Dispose ()
+ {
+ // nop
+ }
+#endif
}
}
using System.IO;
using System.Security.Cryptography;\r
using System.Text;\r
+using System.Runtime.CompilerServices;
\r
namespace System {\r
\r
private Convert ()\r
{\r
}\r
-\r
- // ========== BASE 64 Conversions ========== //\r
- // the BASE64 convert methods are using the Base64 converting methods\r
- // from System.Security.Cryptography.ToBase64Transform and\r
- // System.Security.Cryptography.FromBase64Transform\r
- //\r
- // should be changed to a stand-alone class Base64Encoder & Base64Decoder\r
- \r
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static byte [] InternalFromBase64String (string str);
+
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ extern static byte [] InternalFromBase64CharArray (char [] arr, int offset, int length);
+
public static byte[] FromBase64CharArray (char[] inArray, int offset, int length)\r
{\r
if (inArray == null)\r
// avoid integer overflow\r
if (offset > inArray.Length - length)\r
throw new ArgumentOutOfRangeException ("offset + length > array.Length");\r
- // do not check length here (multiple of 4) because the\r
- // string can contain ignored characters\r
-\r
- return FromBase64 (inArray, offset, length);\r
- }\r
- \r
- public static byte[] FromBase64String (string s)\r
- {\r
- if (s == null)\r
- throw new ArgumentNullException ("s");\r
- // do not check length here (multiple of 4) because the\r
- // string can contain ignored characters\r
-\r
- char[] chars = s.ToCharArray ();\r
- return FromBase64 (chars, 0, chars.Length);\r
- }\r
- \r
- private static byte[] FromBase64 (char[] chars, int index, int count) \r
- {\r
- byte[] data = new byte [count];\r
- int n = 0;\r
- for (int i=0; i < count; i++) {\r
- char c = chars [i];\r
- // drop ignored characters\r
- if (c == '\t' || c == '\r' || c == '\n' || c == ' ')\r
- continue;\r
- // wide chars (16 bits)\r
- if ((int)c > Byte.MaxValue)\r
- continue;\r
- data [n++] = (byte) c;\r
- }\r
- // now the length must be a multiple of 4 bytes (same as % 4)\r
- if ((n & 3) != 0)\r
- throw new FormatException ("invalid base64 length");\r
- // and we do not need to ignore whitespace this time (which is a little faster)\r
- FromBase64Transform t = new FromBase64Transform (FromBase64TransformMode.DoNotIgnoreWhiteSpaces);\r
- return t.TransformFinalBlock (data, 0, n);\r
- }\r
-\r
+
+ return InternalFromBase64CharArray (inArray, offset, length);
+ }
+
+ public static byte[] FromBase64String (string s)
+ {
+ if (s == null)
+ throw new ArgumentNullException ("s");
+
+ return InternalFromBase64String (s);
+ }
+
public static TypeCode GetTypeCode (object value)\r
{\r
if (value == null)\r
//
-// System.DomainManagerInitializationFlags enum
+// System.AppDomainManagerInitializationOptions flags
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
#if NET_2_0
+using System.Runtime.InteropServices;
+
namespace System {
[Flags]
[Serializable]
- public enum DomainManagerInitializationFlags {
+ [ComVisible (true)]
+ public enum AppDomainManagerInitializationOptions {
None = 0,
RegisterWithHost = 1,
- Activate = 2
}
}
[Serializable]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class Exception : ISerializable
-#if NET_1_1
+#if NET_2_0
, _Exception
#endif
{
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static void WaitForPendingFinalizers ();
-
+
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+ [MonoTODO]
+ public static int CollectionCount (int generation) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void AddMemoryPressure (long bytesAllocated) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static void RemoveMemoryPressure (long bytesAllocated) {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
}
public static int Size {
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
get {
return sizeof (void *);
}
}
[CLSCompliant (false)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
unsafe public void *ToPointer ()
{
return value;
public extern static double Pow (double x, double y);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public extern static double Sqrt (double x);
}
}
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+
namespace System
{
- [CLSCompliant (false)]
+ [ComVisible (true)]
public struct ModuleHandle
{
IntPtr value;
}
}
- public void GetPEKind (out PortableExecutableKind peKind, out ImageFileMachine machine)
+ public void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine)
{
if (value == IntPtr.Zero)
throw new ArgumentNullException (String.Empty, "Invalid handle");
return ResolveTypeHandle (typeToken);
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public override bool Equals (object obj)
{
if (obj == null || GetType () != obj.GetType ())
return value == ((ModuleHandle)obj).Value;
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public bool Equals (ModuleHandle handle)
{
return value == handle.Value;
using System.Collections;
using System.Runtime.CompilerServices;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
namespace System
{
internal class MonoCustomAttrs
pseudoAttrs = ((FieldInfo)obj).GetPseudoCustomAttributes ();
else if (obj is ParameterInfo)
pseudoAttrs = ((ParameterInfo)obj).GetPseudoCustomAttributes ();
+ else if (obj is Type)
+ pseudoAttrs = ((Type)obj).GetPseudoCustomAttributes ();
if (pseudoAttrs != null) {
object[] res = new object [attrs.Length + pseudoAttrs.Length];
return GetCustomAttributes (obj, null, inherit);
}
+#if NET_2_0
+ [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ static extern CustomAttributeData [] GetCustomAttributesDataInternal (ICustomAttributeProvider obj);
+
+ internal static IList<CustomAttributeData> GetCustomAttributesData (ICustomAttributeProvider obj)
+ {
+ if (obj == null)
+ throw new ArgumentNullException ("obj");
+
+ CustomAttributeData [] attrs = GetCustomAttributesDataInternal (obj);
+ return Array.AsReadOnly<CustomAttributeData> (attrs);
+ }
+#endif
+
internal static bool IsDefined (ICustomAttributeProvider obj, Type attributeType, bool inherit)
{
object [] res = GetCustomAttributesBase (obj);
return (MethodInfo) CheckMethodSecurity (binder.SelectMethod (bindingAttr, match, types, modifiers));
}
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern MethodInfo GetCorrespondingInflatedMethod (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern ConstructorInfo GetCorrespondingInflatedConstructor (IntPtr generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern FieldInfo GetCorrespondingInflatedField (IntPtr generic);
+
+
+ internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+ {
+ return GetCorrespondingInflatedMethod (fromNoninstanciated.MethodHandle.Value);
+ }
+
+ internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+ return GetCorrespondingInflatedConstructor (fromNoninstanciated.MethodHandle.Value);
+ }
+
+ internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+ return GetCorrespondingInflatedField (fromNoninstanciated.FieldHandle.Value);
+ }
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern override Type GetNestedType (string name, BindingFlags bindingAttr);
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System {
[Serializable]
// <summary>
// Object destructor.
// </summary>
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
~Object ()
{
}
// Tests whether a is equal to b.
// Can not figure out why this even exists
// </summary>
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public static bool ReferenceEquals (object a, object b)
{
return (a == b);
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
+using System.Runtime.InteropServices;
+
namespace System
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public struct RuntimeArgumentHandle
{
internal IntPtr args;
using System.Reflection;
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
+
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
namespace System
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO ("Serialization needs tests")]
[Serializable]
public struct RuntimeFieldHandle : ISerializable
info.AddValue ("FieldObj", (MonoField) FieldInfo.GetFieldFromHandle (this), typeof (MonoField));
}
-
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public override bool Equals (object obj)
{
if (obj == null || GetType () != obj.GetType ())
return value == ((RuntimeFieldHandle)obj).Value;
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public bool Equals (RuntimeFieldHandle handle)
{
return value == handle.Value;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Security.Permissions;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO ("Serialization needs tests")]
[Serializable]
public struct RuntimeMethodHandle : ISerializable
return GetFunctionPointer (value);
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public override bool Equals (object obj)
{
if (obj == null || GetType () != obj.GetType ())
return value == ((RuntimeMethodHandle)obj).Value;
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public bool Equals (RuntimeMethodHandle handle)
{
return value == handle.Value;
//
using System.Runtime.Serialization;
+using System.Runtime.InteropServices;
+
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
namespace System
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[MonoTODO ("Serialization needs tests")]
[Serializable]
public struct RuntimeTypeHandle : ISerializable
info.AddValue ("TypeObj", Type.GetTypeHandle (this), typeof (MonoType));
}
-
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public override bool Equals (object obj)
{
if (obj == null || GetType () != obj.GetType ())
return value == ((RuntimeTypeHandle)obj).Value;
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
public bool Equals (RuntimeTypeHandle handle)
{
return value == handle.Value;
#if NET_2_0
[CLSCompliant (false)]
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
public ModuleHandle GetModuleHandle () {
return Type.GetTypeFromHandle (this).Module.ModuleHandle;
}
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell (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
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Text;
using System.Collections;
using System.Globalization;
using System.Runtime.CompilerServices;
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+using System.Runtime.InteropServices;
+#endif
+
namespace System
{
[Serializable]
- public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable
#if NET_2_0
- , IComparable<String>, IEquatable <String>
+ [ComVisible (true)]
+ public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable, IComparable<String>, IEquatable <String>
+#else
+ public sealed class String : IConvertible, ICloneable, IEnumerable, IComparable
#endif
{
[NonSerialized] private int length;
return !Equals (a, b);
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public override bool Equals (Object obj)
{
return Equals (this, obj as String);
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public bool Equals (String value)
{
return Equals (this, value);
(char) 0x2005, (char) 0x2006, (char) 0x2007, (char) 0x2008, (char) 0x2009, (char) 0x200A, (char) 0x200B,
(char) 0x3000, (char) 0xFEFF };
+ public String Trim ()
+ {
+ return InternalTrim (WhiteChars, 0);
+ }
+
public String Trim (params char[] trimChars)
{
if (trimChars == null || trimChars.Length == 0)
return culture.TextInfo.ToLower (this);
}
+#if NET_2_0
+ public unsafe String ToLowerInvariant ()
+#else
internal unsafe String ToLowerInvariant ()
+#endif
{
string tmp = InternalAllocateStr (length);
fixed (char* source = &start_char, dest = tmp) {
return culture.TextInfo.ToUpper (this);
}
+#if NET_2_0
+ public unsafe String ToUpperInvariant ()
+#else
internal unsafe String ToUpperInvariant ()
+#endif
{
string tmp = InternalAllocateStr (length);
fixed (char* source = &start_char, dest = tmp) {
return this;
}
- public String Trim ()
- {
- return Trim (null);
- }
-
public static String Format (String format, Object arg0)
{
return Format (null, format, new Object[] {arg0});
}
}
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
+#endif
public unsafe override int GetHashCode ()
{
fixed (char * c = this) {
[Serializable]
[ClassInterface (ClassInterfaceType.None)]
- public abstract class Type : MemberInfo, IReflect {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterface (typeof (_Type))]
+#endif
+ public abstract class Type : MemberInfo, IReflect, _Type, _MemberInfo {
internal RuntimeTypeHandle _impl;
public static readonly MemberFilter FilterNameIgnoreCase = new MemberFilter (FilterNameIgnoreCase_impl);
public static readonly object Missing;
- protected const BindingFlags DefaultBindingFlags =
+ internal const BindingFlags DefaultBindingFlags =
BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
/* implementation of the delegates for MemberFilter */
public abstract RuntimeTypeHandle TypeHandle {get;}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo TypeInitializer {
get {
return GetConstructorImpl (
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static TypeCode GetTypeCodeInternal (Type type);
+ internal extern static TypeCode GetTypeCodeInternal (Type type);
public static TypeCode GetTypeCode (Type type) {
type = type.UnderlyingSystemType;
return type_is_subtype_of (a, b, check_interfaces);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual bool IsSubclassOf (Type c)
{
if (c == null)
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void GetInterfaceMapData (Type t, Type iface, out MethodInfo[] targets, out MethodInfo[] methods);
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual InterfaceMapping GetInterfaceMap (Type interfaceType) {
InterfaceMapping res;
if (interfaceType == null)
return GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
}
+ internal virtual MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+ internal virtual ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+ internal virtual FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+
public MethodInfo[] GetMethods ()
{
return GetMethods (DefaultBindingFlags);
return typeof (MarshalByRefObject).IsAssignableFrom (this);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (Type[] types)
{
return GetConstructorImpl (
DefaultBindingFlags, null, CallingConventions.Any, types, null);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
Type[] types, ParameterModifier[] modifiers)
{
bindingAttr, binder, CallingConventions.Any, types, modifiers);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
CallingConventions callConvention,
Type[] types, ParameterModifier[] modifiers)
return GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo[] GetConstructors ()
{
return GetConstructors (BindingFlags.Public | BindingFlags.Instance);
}
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract ConstructorInfo[] GetConstructors (BindingFlags bindingAttr);
public virtual MemberInfo[] GetDefaultMembers ()
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern Type BindGenericParameters (Type gt, Type [] types);
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public Type BindGenericParameters (Type [] types)
{
if (types == null)
return res;
}
+ public Type MakeGenericType (Type[] types)
+ {
+ return BindGenericParameters (types);
+ }
+
public abstract bool IsGenericParameter {
get;
}
return attr;
}
}
+
+ internal object[] GetPseudoCustomAttributes () {
+ int count = 0;
+
+ if (IsSerializable)
+ count ++;
+
+ if (count == 0)
+ return null;
+ object[] attrs = new object [count];
+ count = 0;
+
+ if (IsSerializable)
+ attrs [count ++] = new SerializableAttribute ();
+
+ return attrs;
+ }
+
#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
namespace System
{
[Serializable]
}
public object ExceptionObject {
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
get {
return exception;
}
}
public bool IsTerminating {
+#if NET_2_0
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
get {
return m_isTerminating;
}
namespace System
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
[CLSCompliant (false)]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
[Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
[method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
event UnhandledExceptionEventHandler UnhandledException;
#endif
+
+#if NET_1_1
+ void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
+
+ void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
+
+ void GetTypeInfoCount (out uint pcTInfo);
+
+ void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
+ IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);
+#endif
}
}
+2005-06-07 Ankit Jain <ankit@corewars.org>
+
+ * DictionaryTest.cs (KeyValueEnumeratorTest): Added new test.
+
2005-05-19 Raja R Harinath <rharinath@novell.com>
* ListTest.cs (TestGetRange): Add missing ';'. Actually compare
}
Assert.AreEqual(4, i);
}
+
+ [Test]
+ public void KeyValueEnumeratorTest ()
+ {
+ IDictionary<int, int> d = new Dictionary<int, int>();
+
+ d [9] = 1;
+ d [10] = 2;
+ d [19] = 3;
+
+ ICollection <int> vs = d.Values;
+
+ int count = 0;
+ foreach (int i in vs)
+ count++;
+
+ Assert.AreEqual (count, vs.Count);
+
+ vs = d.Keys;
+
+ count = 0;
+ foreach (int i in vs)
+ count++;
+
+ Assert.AreEqual (count, vs.Count);
+ }
+
}
}
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * StackTraceTest.cs: Mono does not support StraceTrace for
+ thread. Test passes on MS.NET 2.x.
+
2005-03-14 Sebastien Pouliot <sebastien@ximian.com>
* StackFrameCas.cs: Fixed failures under MS for NET_1_1.
}
[Test]
- [Ignore ("Exception documented but not thrown on MS runtime")]
+#if !NET_2_0
+ // on MS .NET 1.x, ThreadState after Start() is Unstarted
+ [Category ("NotDotNet")]
+#endif
[ExpectedException (typeof (ThreadStateException))]
+ [Ignore ("Not supported in Mono")]
public void StackTrace_Thread_NotSuspended ()
{
Thread t = new Thread (new ThreadStart (EmptyThread));
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * CultureInfoTest.cs: added test that tries setting the culture to a
+ neutral culture that is not the InvariantCulture.
+
2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* CultureInfoTest.cs: added new test.
using System.IO;
using System;
using System.Globalization;
+using System.Threading;
namespace MonoTests.System.Globalization
{
Assert ("InvariantCulture not found in the array from GetCultures()", false);
}
+
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
+ public void TrySetNeutralCultureNotInvariant ()
+ {
+ Thread.CurrentThread.CurrentCulture = new CultureInfo ("ar");
+ }
}
}
+2005-06-10 Ben Maurer <bmaurer@ximian.com>
+
+ * FileTest.cs: Fix gonz's typo. Also, clean stuff up by using the
+ temp file api, rather than our own hack.
+
2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* FileTest.cs: yet more invalid array accesses removed.
public void CreationTime ()
{
int platform = (int) Environment.OSVersion.Platform;
- if ((platform != 4) && (platform != 128))
+ if ((platform == 4) || (platform == 128))
return;
- string path = TempFolder + Path.DirectorySeparatorChar + "creationTime";
- if (File.Exists (path))
- File.Delete (path);
- FileStream stream = null;
+ string path = Path.GetTempFileName ();
try {
- stream = File.Create (path);
- stream.Close ();
-
File.SetCreationTime (path, new DateTime (2002, 4, 6, 4, 6, 4));
DateTime time = File.GetCreationTime (path);
Assertion.AssertEquals ("test#01", 2002, time.Year);
Assertion.AssertEquals ("test#19", 4, time.Hour);
Assertion.AssertEquals ("test#20", 4, time.Second);
} finally {
- if (stream != null)
- stream.Close ();
DeleteFile (path);
}
}
using System;
+using System.Globalization;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
{
[TestFixture]
-public class AssemblyBuilderTest : Assertion
+public class AssemblyBuilderTest
{
[AttributeUsage (AttributeTargets.Assembly)]
public sealed class FooAttribute : Attribute
}
public void TestEntryPoint () {
- AssertEquals ("EntryPoint defaults to null",
- null, ab.EntryPoint);
+ Assert.AreEqual (null, ab.EntryPoint, "EntryPoint defaults to null");
MethodInfo mi = genEntryFunction (ab);
ab.SetEntryPoint (mi);
- AssertEquals ("EntryPoint works", mi, ab.EntryPoint);
+ Assert.AreEqual (mi, ab.EntryPoint, "EntryPoint works");
}
public void TestSetEntryPoint () {
// Check invalid arguments
try {
ab.SetEntryPoint (null);
- Fail ();
+ Assert.Fail ();
}
catch (ArgumentNullException) {
}
// Check method from other assembly
try {
ab.SetEntryPoint (typeof (AssemblyBuilderTest).GetMethod ("TestSetEntryPoint"));
- Fail ();
+ Assert.Fail ();
}
catch (InvalidOperationException) {
}
CustomAttributeBuilder cab = new CustomAttributeBuilder (typeof (FooAttribute).GetConstructor (new Type [1] {typeof (string)}), new object [1] { "A" });
ab.SetCustomAttribute (cab);
- AssertEquals ("IsDefined works",
- true, ab.IsDefined (typeof (FooAttribute), false));
- AssertEquals ("IsDefined works",
- false, ab.IsDefined (typeof (AssemblyVersionAttribute), false));
+ Assert.IsTrue (ab.IsDefined (typeof (FooAttribute), false),
+ "IsDefined works");
+ Assert.IsFalse (ab.IsDefined (typeof (AssemblyVersionAttribute), false),
+ "IsDefined works");
}
[ExpectedException (typeof (NotSupportedException))]
}
public void TestGetDynamicModule3 () {
- AssertNull (ab.GetDynamicModule ("FOO2"));
+ Assert.IsNull (ab.GetDynamicModule ("FOO2"));
ModuleBuilder mb = ab.DefineDynamicModule ("FOO");
- AssertEquals (mb, ab.GetDynamicModule ("FOO"));
+ Assert.AreEqual (mb, ab.GetDynamicModule ("FOO"));
- AssertNull (ab.GetDynamicModule ("FOO4"));
+ Assert.IsNull (ab.GetDynamicModule ("FOO4"));
}
#if NET_1_1
public void TestImageRuntimeVersion () {
string version = ab.ImageRuntimeVersion;
- Assert (version.Length > 0);
+ Assert.IsTrue (version.Length > 0);
}
#endif
ab.DefineDynamicModule (name);
}
catch (Exception) {
- Fail ();
+ Assert.Fail ();
}
name = name + "A";
AssemblyName check = AssemblyName.GetAssemblyName (filename);
// no exception is thrown (file not found)
// because it's not AssemblyBuilder.Save job to do the signing :-/
- AssertNull ("Token", check.GetPublicKeyToken ());
+ Assert.IsNull (check.GetPublicKeyToken (), "Token");
}
[Test]
AssemblyName check = AssemblyName.GetAssemblyName (filename);
// no public key is inserted into the assembly
// because it's not AssemblyBuilder.Save job to do the signing :-/
- AssertNull ("Token", check.GetPublicKeyToken ());
+ Assert.IsNull (check.GetPublicKeyToken (), "Token");
}
[Test]
string filename = Path.Combine (tempDir, "StrongName_WithoutAttributes.dll");
AssemblyName check = AssemblyName.GetAssemblyName (filename);
- AssertEquals ("Token", "0E-EA-7C-E6-5F-35-F2-D8", BitConverter.ToString (check.GetPublicKeyToken ()));
+ Assert.AreEqual ("0E-EA-7C-E6-5F-35-F2-D8", BitConverter.ToString (check.GetPublicKeyToken ()), "Token");
}
[Test]
Module[] m;
m = ab.GetModules ();
- Assert (m.Length >= 2);
+ Assert.IsTrue (m.Length >= 2);
// Test with no modules
AssemblyBuilder ab2 = genAssembly ();
m = ab2.GetModules ();
}
+
+ [Test]
+ [Category ("NotWorking")]
+ public void AssemblyName_Culture ()
+ {
+ AssemblyName assemblyName = new AssemblyName ();
+ assemblyName.Name = "AssemblyNameTest";
+ assemblyName.Version = new Version ("1.0.0.0");
+ assemblyName.CultureInfo = new CultureInfo ("en-US");
+
+ const string fullName = "AssemblyNameTest, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null";
+ const string abName = "AssemblyNameTest, Version=1.0.0.0, Culture=en-US";
+
+ AssertAssemblyName (tempDir, assemblyName, abName, fullName);
+ }
+
+ [Test]
+ [Category ("NotWorking")] // bug #75246
+ public void AssemblyName_PublicKey ()
+ {
+ AssemblyName assemblyName = new AssemblyName ();
+ assemblyName.Name = "AssemblyNameTest";
+ assemblyName.Version = new Version ("1.2.3.4");
+ assemblyName.KeyPair = new StrongNameKeyPair (strongName);
+
+ Assert.IsNull (assemblyName.CultureInfo, "#1");
+ Assert.AreEqual ("AssemblyNameTest, Version=1.2.3.4", assemblyName.FullName, "#2");
+
+ const string fullName = "AssemblyNameTest, Version=1.2.3.4, Culture=neutral, PublicKeyToken=0eea7ce65f35f2d8";
+
+ AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (
+ assemblyName, AssemblyBuilderAccess.Save, tempDir);
+
+ AssemblyName abName = ab.GetName ();
+ Assert.IsNotNull (abName.GetPublicKeyToken (), "#3");
+ Assert.IsTrue (abName.GetPublicKeyToken ().Length > 0, "#4");
+ Assert.IsNotNull (abName.GetPublicKey () != null, "#5");
+ Assert.IsTrue (abName.GetPublicKey ().Length > 0, "#6");
+ Assert.IsNotNull (abName.CultureInfo != null, "#7");
+#if NET_2_0
+ Assert.IsTrue (abName.CultureInfo != CultureInfo.InvariantCulture, "#8");
+ Assert.AreEqual (CultureInfo.InvariantCulture.LCID, abName.CultureInfo.LCID, "#9");
+ Assert.AreEqual (fullName, abName.FullName, "#10");
+#else
+ Assert.AreEqual (CultureInfo.InvariantCulture, abName.CultureInfo, "#11");
+ Assert.AreEqual ("AssemblyNameTest, Version=1.2.3.4, PublicKeyToken=0eea7ce65f35f2d8", abName.FullName, "#12");
+#endif
+
+ ab.Save ("AssemblyNameTest.dll");
+
+ AssemblyName bakedName = AssemblyName.GetAssemblyName (Path.Combine(
+ tempDir, "AssemblyNameTest.dll"));
+
+ Assert.IsNotNull (bakedName.GetPublicKeyToken (), "#13");
+ Assert.IsNotNull (bakedName.GetPublicKey (), "#14");
+ Assert.IsNotNull (bakedName.CultureInfo, "#15");
+
+#if NET_2_0
+ Assert.IsTrue (abName.CultureInfo != CultureInfo.InvariantCulture, "#16");
+ Assert.AreEqual (CultureInfo.InvariantCulture.LCID, abName.CultureInfo.LCID, "#17");
+#else
+ Assert.AreEqual (CultureInfo.InvariantCulture, bakedName.CultureInfo, "#18");
+#endif
+
+ Assert.AreEqual (fullName, bakedName.FullName, "#19");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void AssemblyName_NoVersion ()
+ {
+ AssemblyName assemblyName = new AssemblyName ();
+ assemblyName.Name = "AssemblyNameTest";
+
+ const string fullName = "AssemblyNameTest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null";
+ const string abName = "AssemblyNameTest, Version=0.0.0.0";
+
+ AssertAssemblyName (tempDir, assemblyName, abName, fullName);
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void AssemblyName_Version ()
+ {
+ AssemblyName assemblyName = new AssemblyName ();
+ assemblyName.Name = "AssemblyNameTest";
+ assemblyName.Version = new Version (1, 2, 3, 4);
+
+ const string fullName = "AssemblyNameTest, Version=1.2.3.4, Culture=neutral, PublicKeyToken=null";
+ const string abName = "AssemblyNameTest, Version=1.2.3.4";
+
+ AssertAssemblyName (tempDir, assemblyName, abName, fullName);
+ }
+
+ private static void AssertAssemblyName (string tempDir, AssemblyName assemblyName, string abName, string fullName)
+ {
+ AppDomain currentDomain = AppDomain.CurrentDomain;
+ AppDomain newDomain = null;
+
+ try {
+ AssemblyBuilder ab = currentDomain.DefineDynamicAssembly (
+ assemblyName, AssemblyBuilderAccess.Save, tempDir);
+ ab.Save (assemblyName.Name + ".dll");
+
+#if NET_2_0
+ // on .NET 2.0, the full name of the AssemblyBuilder matches the
+ // fully qualified assembly name
+ Assert.AreEqual (fullName, ab.FullName);
+#else
+ Assert.AreEqual (abName, ab.FullName);
+#endif
+
+ // load assembly in separate domain, so we can clean-up after the
+ // test
+ newDomain = AppDomain.CreateDomain ("test2", currentDomain.Evidence,
+ currentDomain.SetupInformation);
+
+ Helper helper = new Helper (Path.Combine (tempDir, assemblyName.Name + ".dll"),
+ fullName);
+ newDomain.DoCallBack (new CrossAppDomainDelegate (helper.Test));
+ } finally {
+ if (newDomain != null) {
+ AppDomain.Unload (newDomain);
+ }
+ }
+ }
+
+ [Serializable ()]
+ private class Helper
+ {
+ private readonly string _assemblyPath;
+ private readonly string _assemblyName;
+
+ public Helper (string assemblyPath, string assemblyName)
+ {
+ _assemblyPath = assemblyPath;
+ _assemblyName = assemblyName;
+ }
+ public void Test ()
+ {
+ AssemblyName assemblyName = AssemblyName.GetAssemblyName (_assemblyPath);
+ Assert.AreEqual (_assemblyName, assemblyName.ToString ());
+ }
+ }
}
}
+2005-06-13 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * AssemblyBuilderTest.cs: Setting KeyPair of AssemblyName has
+ currently no effect on PublicKey(Token) and FullName of AssemblyName
+ of the AssemblyBuilder. Test for bug #75246.
+
+2005-06-13 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * AssemblyBuilderTest.cs: Removed inheritance from deprecated
+ Assertion class. Use Assert class instead.
+
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * AssemblyBuilderTest.cs: Added AssemblyName tests that currently
+ fail on Mono.
+
+2005-06-12 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * FieldBuilderTest.cs: Enabled tests for FieldHandle again after
+ fixing regression.
+ * ConstructorBuilderTest.cs: MethodHandle should not throw
+ NotSupportedException.
+ * MethodBuilderTest.cs: Enabled test for MethodHandle again after
+ fixing regression, and added additional test.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * MethodBuilderTest.cs: Add tests for setting DllImportAttribute.
+
2005-05-12 Zoltan Varga <vargaz@freemail.hu>
* TypeBuilderTest.cs: Add tests for bug #74906.
AssertEquals ("InitLocals defaults to true", cb.InitLocals, true);\r
cb.InitLocals = false;\r
AssertEquals ("InitLocals is settable", cb.InitLocals, false);\r
- }\r
-\r
+ }
+ \r
+ [Test]
public void TestMethodHandle () {\r
ConstructorBuilder cb = genClass.DefineConstructor (\r
0, 0, new Type [0]);\r
\r
- try {\r
- RuntimeMethodHandle handle = cb.MethodHandle;\r
- Fail ();\r
- } catch (NotSupportedException) {\r
- }\r
+ RuntimeMethodHandle handle = cb.MethodHandle;\r
}\r
\r
public void TestName () {\r
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
+using System.Runtime.InteropServices;
using NUnit.Framework;
return "class" + (typeIndexer ++);
}
+ [Test]
public void TestAttributes () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), MethodAttributes.Public, typeof (void), new Type [0]);
MethodAttributes.Public, mb.Attributes);
}
+ [Test]
public void TestCallingConvention () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type[0]);
mb4.CallingConvention);
}
+ [Test]
public void TestDeclaringType () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type[0]);
genClass, mb.DeclaringType);
}
+ [Test]
public void TestInitLocals () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type[0]);
mb.InitLocals = false;
Assert ("InitLocals is settable", !mb.InitLocals);
}
+
+ [Test]
+ [ExpectedException (typeof(NotSupportedException))]
+ public void TestMethodHandleIncomplete () {
+ MethodBuilder mb = genClass.DefineMethod (
+ genMethodName (), 0, typeof (void), new Type [0]);
- public void TestMethodHandle () {
+ RuntimeMethodHandle handle = mb.MethodHandle;
+ }
+
+ [Test]
+ [ExpectedException (typeof(NotSupportedException))]
+ public void TestMethodHandleComplete () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
+ mb.CreateMethodBody (new byte[2], 0);
+ genClass.CreateType ();
- try {
- RuntimeMethodHandle handle = mb.MethodHandle;
- Fail ();
- } catch (NotSupportedException) {
- }
+ RuntimeMethodHandle handle = mb.MethodHandle;
}
+ [Test]
public void TestName () {
string name = genMethodName ();
MethodBuilder mb = genClass.DefineMethod (
AssertEquals ("Name works", name, mb.Name);
}
+ [Test]
public void TestReflectedType () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
genClass, mb.ReflectedType);
}
+ [Test]
public void TestReturnType () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (Console), new Type [0]);
Assert ("void ReturnType works", (mb2.ReturnType == null) || (mb2.ReturnType == typeof (void)));
}
+ [Test]
public void TestReturnTypeCustomAttributes () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (Console), new Type [0]);
}
*/
+ [Test]
public void TestCreateMethodBody () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
new Type[2] {
typeof(int), typeof(int)
});
+ mb.CreateMethodBody (new byte[2], 0);
tb.CreateType ();
mb.DefineParameter (-5, ParameterAttributes.None, "param1");
}
new Type[2] {
typeof(int), typeof(int)
});
+ mb.CreateMethodBody (new byte[2], 0);
tb.CreateType ();
mb.DefineParameter (1, ParameterAttributes.None, "param1");
}
+ [Test]
public void TestDefineParameter () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
MethodBuilder mb = tb.DefineMethod (
methodName.GetHashCode (), mb.GetHashCode ());
}
+ [Test]
public void TestGetBaseDefinition () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
mb.GetBaseDefinition (), mb);
}
+ [Test]
public void TestGetILGenerator () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
}
}
+ [Test]
public void TestMethodImplementationFlags () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
MethodBuilder mb = tb.DefineMethod (
}
}
+ [Test]
public void TestGetModule () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void), new Type [0]);
mb.GetModule ());
}
+ [Test]
public void TestGetParameters () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
MethodBuilder mb = tb.DefineMethod (
*/
}
+ [Test]
public void TestGetToken () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
MethodBuilder mb = tb.DefineMethod (
mb.GetToken ();
}
+ [Test]
public void TestInvoke () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void),
}
}
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
public void TestIsDefined () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void),
new Type [1] {typeof(int)});
-
- try {
- mb.IsDefined (null, true);
- Fail ();
- } catch (NotSupportedException) {
- }
+ mb.IsDefined (null, true);
}
+ [Test]
public void TestGetCustomAttributes () {
MethodBuilder mb = genClass.DefineMethod (
genMethodName (), 0, typeof (void),
new Type [1] {typeof(int)});
-
+
try {
mb.GetCustomAttributes (true);
Fail ();
}
}
+ [Test]
public void TestSetCustomAttribute () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
string name = genMethodName ();
AssertEquals (typeof (ParamAttribute), cattrs [0].GetType ());
*/
}
+
+#if NET_2_0
+ [Test]
+ public void SetCustomAttribute_DllImport1 () {
+ string mname = genMethodName ();
+
+ TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
+ MethodBuilder mb = tb.DefineMethod (
+ mname, MethodAttributes.Public, typeof (void),
+ new Type [] { typeof (int), typeof (string) });
+
+ // Create an attribute with default values
+ mb.SetCustomAttribute (new CustomAttributeBuilder(typeof(DllImportAttribute).GetConstructor(new Type[] { typeof(string) }), new object[] { "kernel32" }));
+
+ Type t = tb.CreateType ();
+
+ DllImportAttribute attr = (DllImportAttribute)((t.GetMethod (mname).GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
+
+ AssertEquals (CallingConvention.Winapi, attr.CallingConvention);
+ AssertEquals (mname, attr.EntryPoint);
+ AssertEquals ("kernel32", attr.Value);
+ AssertEquals (false, attr.ExactSpelling);
+ AssertEquals (true, attr.PreserveSig);
+ AssertEquals (false, attr.SetLastError);
+ AssertEquals (false, attr.BestFitMapping);
+ AssertEquals (false, attr.ThrowOnUnmappableChar);
+ }
+
+ [Test]
+ public void SetCustomAttribute_DllImport2 () {
+ string mname = genMethodName ();
+
+ TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
+ MethodBuilder mb = tb.DefineMethod (
+ mname, MethodAttributes.Public, typeof (void),
+ new Type [] { typeof (int), typeof (string) });
+
+ CustomAttributeBuilder cb = new CustomAttributeBuilder (typeof (DllImportAttribute).GetConstructor (new Type [] {typeof (String)}), new object [] { "foo" }, new FieldInfo [] {typeof (DllImportAttribute).GetField ("EntryPoint"), typeof (DllImportAttribute).GetField ("CallingConvention"), typeof (DllImportAttribute).GetField ("CharSet"), typeof (DllImportAttribute).GetField ("ExactSpelling"), typeof (DllImportAttribute).GetField ("PreserveSig")}, new object [] { "bar", CallingConvention.StdCall, CharSet.Unicode, true, false });
+ mb.SetCustomAttribute (cb);
+
+ Type t = tb.CreateType ();
+
+ DllImportAttribute attr = (DllImportAttribute)((t.GetMethod (mname).GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
+
+ AssertEquals (CallingConvention.StdCall, attr.CallingConvention);
+ AssertEquals (CharSet.Unicode, attr.CharSet);
+ AssertEquals ("bar", attr.EntryPoint);
+ AssertEquals ("foo", attr.Value);
+ AssertEquals (true, attr.ExactSpelling);
+ AssertEquals (false, attr.PreserveSig);
+ AssertEquals (false, attr.SetLastError);
+ AssertEquals (false, attr.BestFitMapping);
+ AssertEquals (false, attr.ThrowOnUnmappableChar);
+ }
+
+ [Test]
+ public void SetCustomAttribute_DllImport3 () {
+ string mname = genMethodName ();
+
+ TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
+ MethodBuilder mb = tb.DefineMethod (
+ mname, MethodAttributes.Public, typeof (void),
+ new Type [] { typeof (int), typeof (string) });
+
+ // Test attributes with three values (on/off/missing)
+ CustomAttributeBuilder cb = new CustomAttributeBuilder (typeof (DllImportAttribute).GetConstructor (new Type [] {typeof (String)}), new object [] { "foo" }, new FieldInfo [] { typeof (DllImportAttribute).GetField ("BestFitMapping"), typeof (DllImportAttribute).GetField ("ThrowOnUnmappableChar")}, new object [] { false, false });
+ mb.SetCustomAttribute (cb);
+
+ Type t = tb.CreateType ();
+
+ DllImportAttribute attr = (DllImportAttribute)((t.GetMethod (mname).GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
+
+ AssertEquals (false, attr.BestFitMapping);
+ AssertEquals (false, attr.ThrowOnUnmappableChar);
+ }
+
+ [Test]
+ public void SetCustomAttribute_DllImport4 () {
+ string mname = genMethodName ();
+
+ TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
+ MethodBuilder mb = tb.DefineMethod (
+ mname, MethodAttributes.Public, typeof (void),
+ new Type [] { typeof (int), typeof (string) });
+
+ CustomAttributeBuilder cb = new CustomAttributeBuilder (typeof (DllImportAttribute).GetConstructor (new Type [] {typeof (String)}), new object [] { "foo" }, new FieldInfo [] { typeof (DllImportAttribute).GetField ("SetLastError"), typeof (DllImportAttribute).GetField ("BestFitMapping"), typeof (DllImportAttribute).GetField ("ThrowOnUnmappableChar")}, new object [] { true, true, true });
+ mb.SetCustomAttribute (cb);
+
+ Type t = tb.CreateType ();
+
+ DllImportAttribute attr = (DllImportAttribute)((t.GetMethod (mname).GetCustomAttributes (typeof (DllImportAttribute), true)) [0]);
+
+ AssertEquals (true, attr.SetLastError);
+ AssertEquals (true, attr.BestFitMapping);
+ AssertEquals (true, attr.ThrowOnUnmappableChar);
+ }
+#endif
}
}
using System.Threading;
using System.Globalization;
using System.Runtime.Serialization.Formatters.Binary;
+using System.Security;
namespace MonoTests.System.Reflection {
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void EmptyAssembly ()
{
an = new AssemblyName ();
Assert.IsNull (an.CultureInfo, "CultureInfo");
Assert.IsNull (an.EscapedCodeBase, "EscapedCodeBase");
Assert.AreEqual (AssemblyNameFlags.None, an.Flags, "Flags");
+#if NET_2_0
+ Assert.AreEqual (String.Empty, an.FullName, "FullName");
+#else
Assert.IsNull (an.FullName, "FullName");
+#endif
Assert.AreEqual (AssemblyHashAlgorithm.None, an.HashAlgorithm, "HashAlgorithm");
Assert.IsNull (an.KeyPair, "KeyPair");
Assert.IsNull (an.Name, "Name");
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+ [ExpectedException (typeof (SecurityException))]
+#endif
public void PublicKey ()
{
an = new AssemblyName ();
// !!! this assembly MUST NOT use a StrongName !!!
[Test]
+ [Category ("NotWorking")] // in other cases null is returned
public void Self ()
{
Assembly a = Assembly.GetExecutingAssembly ();
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+ [ExpectedException (typeof (SecurityException))]
+#endif
public void FullName5 ()
{
const string assemblyName = "TestAssembly";
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+ [ExpectedException (typeof (SecurityException))]
+#endif
public void FullName7 ()
{
const string assemblyName = "TestAssembly";
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+ [ExpectedException (typeof (SecurityException))]
+#endif
public void FullName8 ()
{
const string assemblyName = "TestAssembly";
return Assembly.LoadFrom (Path.Combine (tempDir, name.Name + ".dll"));
}
+ private AssemblyBuilder GenerateDynamicAssembly (AssemblyName name)
+ {
+ AssemblyBuilder ab = domain.DefineDynamicAssembly (
+ name,
+ AssemblyBuilderAccess.Run);
+
+ return ab;
+ }
+
[Test]
public void TestCultureInfo ()
{
name.Version = new Version (1, 2, 3, 4);
Assembly a = GenerateAssembly (name);
- Assert.AreEqual ("1.2.3.4", a.GetName ().Version.ToString ());
+ Assert.AreEqual ("1.2.3.4", a.GetName ().Version.ToString (), "1.2.3.4 normal");
name = GenAssemblyName ();
name.Version = new Version (1, 2, 3);
a = GenerateAssembly (name);
- Assert.AreEqual ("1.2.3.0", a.GetName ().Version.ToString ());
+ Assert.AreEqual ("1.2.3.0", a.GetName ().Version.ToString (), "1.2.3.0 normal");
name = GenAssemblyName ();
name.Version = new Version (1, 2);
a = GenerateAssembly (name);
- Assert.AreEqual ("1.2.0.0", a.GetName ().Version.ToString ());
+ Assert.AreEqual ("1.2.0.0", a.GetName ().Version.ToString (), "1.2.0.0 normal");
+ }
+
+ [Test]
+ [Category ("NotWorking")]
+ public void Version_Dynamic ()
+ {
+ AssemblyName name = GenAssemblyName ();
+ name.Version = new Version (1, 2, 3, 4);
+
+ AssemblyBuilder ab = GenerateDynamicAssembly (name);
+ Assert.AreEqual ("1.2.3.4", ab.GetName ().Version.ToString (), "1.2.3.4 dynamic");
+
+ name = GenAssemblyName ();
+ name.Version = new Version (1, 2, 3);
+
+ ab = GenerateDynamicAssembly (name);
+#if NET_2_0
+ Assert.AreEqual ("1.2.3.0", ab.GetName ().Version.ToString (), "1.2.3.0 dynamic");
+#else
+ Assert.AreEqual ("1.2.3.65535", ab.GetName ().Version.ToString (), "1.2.3.0 dynamic");
+#endif
+
+ name = GenAssemblyName ();
+ name.Version = new Version (1, 2);
+
+ ab = GenerateDynamicAssembly (name);
+#if NET_2_0
+ Assert.AreEqual ("1.2.0.0", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
+#else
+ Assert.AreEqual ("1.2.65535.65535", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
+#endif
}
[Test]
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void Clone_Empty ()
{
an = new AssemblyName ();
Assert.IsNull (clone.CultureInfo, "CultureInfo");
Assert.IsNull (clone.EscapedCodeBase, "EscapedCodeBase");
Assert.AreEqual (AssemblyNameFlags.None, clone.Flags, "Flags");
+#if NET_2_0
+ Assert.AreEqual (String.Empty, clone.FullName, "FullName");
+#else
Assert.IsNull (clone.FullName, "FullName");
+#endif
Assert.AreEqual (AssemblyHashAlgorithm.None, clone.HashAlgorithm, "HashAlgorithm");
Assert.IsNull (clone.KeyPair, "KeyPair");
Assert.IsNull (clone.Name, "Name");
typeof (int).Assembly.GetType ("&blabla", true, true);
}
+ [Test]
+ public void GetEntryAssembly ()
+ {
+ // note: only available in default appdomain
+ // http://weblogs.asp.net/asanto/archive/2003/09/08/26710.aspx
+ // Not sure we should emulate this behavior.
+ string fname = AppDomain.CurrentDomain.FriendlyName;
+ if (fname.EndsWith (".dll")) { // nunit-console
+ Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+#if NET_2_0
+ Assert.IsFalse (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#endif
+ } else { // gnunit
+ Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
+#if NET_2_0
+ Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
+#endif
+ }
+ }
#if NET_2_0
[Category ("NotWorking")]
#endif
Assert.IsTrue (corlib.GlobalAssemblyCache, "GlobalAssemblyCache");
Assert.AreEqual (0, corlib.HostContext, "HostContext");
Assert.AreEqual ("v2.0.50215", corlib.ImageRuntimeVersion, "ImageRuntimeVersion");
- Assert.AreEqual (PortableExecutableKind.ILOnly | PortableExecutableKind.Required32Bit, corlib.PortableExecutableKind, "PortableExecutableKind");
Assert.IsFalse (corlib.ReflectionOnly, "ReflectionOnly");
Assert.AreEqual (0x20000001, corlib.MetadataToken);
Assert.AreEqual (0x1, corlib.ManifestModule.MetadataToken);
Assert.AreEqual (0, corlib_test.HostContext, "HostContext");
Assert.AreEqual ("v2.0.50215", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
- Assert.AreEqual (PortableExecutableKind.ILOnly, corlib_test.PortableExecutableKind, "PortableExecutableKind");
Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
#elif NET_1_1
Assert.AreEqual ("v1.1.4322", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
+2005-06-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyNameTest.cs: "Fixed" tests so they execute without errors on
+ both Fx 1.1 SP1 and Fx 2.0 beta 2. Added corresponding NotWorking.
+
+2005-06-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyNameTest.cs: Added distinctive names for all asserts in
+ Version. Changed Self to NotWorking as other cases returns null. It
+ will re-activated once we know the logic behind it.
+
+2005-06-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * AssemblyNameTest.cs: Added tests to Version method,
+ in order to do additional checks with AssemblyBuilder
+ version.
+
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * AssemblyTest.cs: put back GetEntryAssembly, but this one is working.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyTest.cs: Removed asserts using PortableExecutableKind -
+ because (1) it was renamed to PortableExecutableKinds *and* (2)
+ it's documented as obsolete and will be removed for 2.0 RTM.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * MethodInfoTest.cs: Disable pseudo custom attribute test.
+
2005-06-05 Gert Driesen <drieseng@users.sourceforge.net>
* AssemblyTest.cs: Enabled test for bug #74958.
#if NET_2_0
[Test]
+ [Category ("NotWorking")] // Needs merge of attribute code into gmcs
public void PseudoCustomAttributes ()
{
Type t = typeof (MethodInfoTest);
+2005-06-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RuntimeEnvironmentTest.cs: Commented an assert than wasn't true when
+ doing a "make distcheck".
+
+2005-06-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RuntimeEnvironmentTest.cs: New. Unit tests for RuntimeEnvironment.
+ * RuntimeEnvironmentCas.cs: New. CAS unit tests for RuntimeEnvironment
+
2005-04-23 Zoltan Varga <vargaz@freemail.hu>
* MarshalTest.cs: Add test for OffsetOf and static fields.
--- /dev/null
+//
+// RuntimeEnvironmentCas.cs - CAS Unit Tests for RuntimeEnvironment
+//
+// Author:
+// Sebastien Pouliot (sebastien@ximian.com)
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.Permissions;
+
+using NUnit.Framework;
+
+namespace MonoCasTests.System.Runtime.InteropServices {
+
+ [TestFixture]
+ [Category ("CAS")]
+ public class RuntimeEnvironmentCas {
+
+ [SetUp]
+ public void SetUp ()
+ {
+ if (!SecurityManager.SecurityEnabled)
+ Assert.Ignore ("SecurityManager isn't enabled");
+ }
+
+ // Partial Trust Tests - i.e. call "normal" unit with reduced privileges
+
+ [Test]
+ [PermissionSet (SecurityAction.Deny, Unrestricted = true)]
+ public void PartialTrust_DenyUnrestricted_Success ()
+ {
+ Assembly corlib = typeof (int).Assembly;
+#if NET_2_0
+ Assert.IsTrue (RuntimeEnvironment.FromGlobalAccessCache (corlib), "corlib");
+#else
+ // note: mscorlib.dll wasn't in the GAC for 1.x
+ Assert.IsFalse (RuntimeEnvironment.FromGlobalAccessCache (corlib), "corlib");
+#endif
+ Assembly corlib_test = Assembly.GetExecutingAssembly ();
+ Assert.IsFalse (RuntimeEnvironment.FromGlobalAccessCache (corlib_test), "corlib_test");
+ }
+
+ // test Demand by denying the caller of the required privileges
+ // (note: is should only be PathDiscovery but that's not easy to test)
+
+ [Test]
+ [FileIOPermission (SecurityAction.Deny, Unrestricted = true)]
+ [ExpectedException (typeof (SecurityException))]
+ public void Deny_GetRuntimeDirectory ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.GetRuntimeDirectory ());
+ }
+
+ [Test]
+ [FileIOPermission (SecurityAction.Deny, Unrestricted = true)]
+ [ExpectedException (typeof (SecurityException))]
+ public void Deny_SystemConfigurationFile ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.SystemConfigurationFile);
+ }
+
+ [Test]
+ [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
+ [ExpectedException (typeof (SecurityException))]
+ public void Deny_GetSystemVersion ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.GetSystemVersion ());
+ }
+
+ // test Demand by permiting only the required privileges
+ // (note: is should only be PathDiscovery but that's not easy to test)
+
+ [Test]
+ [FileIOPermission (SecurityAction.PermitOnly, Unrestricted = true)]
+ public void PermitOnly_GetRuntimeDirectory ()
+ {
+ RuntimeEnvironment.GetRuntimeDirectory ();
+ }
+
+ [Test]
+ [FileIOPermission (SecurityAction.PermitOnly, Unrestricted = true)]
+ public void PermitOnly_SystemConfigurationFile ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.SystemConfigurationFile);
+ }
+
+ [Test]
+ [SecurityPermission (SecurityAction.PermitOnly, UnmanagedCode = true)]
+ public void PermitOnly_GetSystemVersion ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.GetSystemVersion ());
+ }
+ }
+}
--- /dev/null
+//
+// RuntimeEnvironmentTest.cs - NUnit tests for RuntimeEnvironment
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Runtime.InteropServices {
+
+ [TestFixture]
+ public class RuntimeEnvironmentTest {
+
+ [Test]
+ public void SystemConfigurationFile ()
+ {
+ string fname = RuntimeEnvironment.SystemConfigurationFile;
+ Assert.IsNotNull (fname, "SystemConfigurationFile");
+ Assert.IsTrue (File.Exists (fname), "Exists");
+ }
+
+ [Test]
+ [ExpectedException (typeof (NullReferenceException))]
+ public void FromGlobalAccessCache_Null ()
+ {
+ RuntimeEnvironment.FromGlobalAccessCache (null);
+ }
+
+ [Test]
+ public void FromGlobalAccessCache ()
+ {
+ Assembly corlib = typeof (int).Assembly;
+#if NET_2_0
+ // FIXME: This doesn't work when doing make distcheck (probably because the corlib used isn't the GAC)
+// Assert.IsTrue (RuntimeEnvironment.FromGlobalAccessCache (corlib), "corlib");
+#else
+ // note: mscorlib.dll wasn't in the GAC for 1.x
+ Assert.IsFalse (RuntimeEnvironment.FromGlobalAccessCache (corlib), "corlib");
+#endif
+ Assembly corlib_test = Assembly.GetExecutingAssembly ();
+ Assert.IsFalse (RuntimeEnvironment.FromGlobalAccessCache (corlib_test), "corlib_test");
+ }
+
+ [Test]
+ public void GetRuntimeDirectory ()
+ {
+ string dirname = RuntimeEnvironment.GetRuntimeDirectory ();
+ Assert.IsNotNull (dirname, "GetRuntimeDirectory");
+ Assert.IsTrue (Directory.Exists (dirname), "Exists");
+ }
+
+ [Test]
+ public void GetSystemVersion ()
+ {
+ Assert.IsNotNull (RuntimeEnvironment.GetSystemVersion (), "GetSystemVersion");
+ }
+ }
+}
\r
[TestFixture]
// http://bugzilla.ximian.com/show_bug.cgi?id=72576
+ [Category ("NotWorking")]
public class SynchronizationAttributeTest: Assertion\r
{\r
SincroRequiresNew sincob = new SincroRequiresNew ();\r
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * StrongNameMembershipConditionTest.cs: New. Unit tests for
+ StrongNameMembershipCondition.
+ * StrongNameTest.cs: Added test case for empty name.
+
2005-05-26 Sebastien Pouliot <sebastien@ximian.com>
* PolicyLevelTest.cs: Added unit tests for RemovePermissionSet and
}
[Test]
+ // Makes distcheck fail because there is no Mono installed into the prefix
+ // thus making the GAC not work...
+ [Category ("NotWorking")]
public void FromXml ()
{
PolicyLevel pl = PolicyLevel.CreateAppDomainLevel ();
}
[Test]
+ // Makes distcheck fail because there is no Mono installed into the prefix
+ // thus making the GAC not work...
+ [Category ("NotWorking")]
[ExpectedException (typeof (ArgumentException))]
public void FromXml_Invalid ()
{
--- /dev/null
+//
+// StrongNameMembershipConditionTest.cs -
+// NUnit Test Cases for StrongNameMembershipCondition
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Security;
+using System.Security.Permissions;
+using System.Security.Policy;
+
+namespace MonoTests.System.Security.Policy {
+
+ [TestFixture]
+ public class StrongNameMembershipConditionTest {
+
+ static Evidence allEmpty;
+ static Evidence hostEcmaCorlibVersion;
+ static Evidence hostEcmaVersion;
+ static Evidence hostMsSystemSecurityVersion;
+ static Evidence hostMsVersion;
+ static Evidence hostOther;
+ static Evidence assemblyEcmaCorlibVersion;
+ static Evidence assemblyEcmaVersion;
+ static Evidence assemblyMsSystemSecurityVersion;
+ static Evidence assemblyMsVersion;
+ static Evidence assemblyOther;
+ static object wrongEvidence;
+
+ static string name;
+ static Version version;
+ static StrongNamePublicKeyBlob blob;
+ static StrongNamePublicKeyBlob ms;
+ private static byte[] _msFinalKey = new byte[160] {
+ 0x00, 0x24, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00,
+ 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x07, 0xD1, 0xFA, 0x57, 0xC4, 0xAE, 0xD9, 0xF0, 0xA3, 0x2E, 0x84, 0xAA, 0x0F, 0xAE, 0xFD, 0x0D,
+ 0xE9, 0xE8, 0xFD, 0x6A, 0xEC, 0x8F, 0x87, 0xFB, 0x03, 0x76, 0x6C, 0x83, 0x4C, 0x99, 0x92, 0x1E,
+ 0xB2, 0x3B, 0xE7, 0x9A, 0xD9, 0xD5, 0xDC, 0xC1, 0xDD, 0x9A, 0xD2, 0x36, 0x13, 0x21, 0x02, 0x90,
+ 0x0B, 0x72, 0x3C, 0xF9, 0x80, 0x95, 0x7F, 0xC4, 0xE1, 0x77, 0x10, 0x8F, 0xC6, 0x07, 0x77, 0x4F,
+ 0x29, 0xE8, 0x32, 0x0E, 0x92, 0xEA, 0x05, 0xEC, 0xE4, 0xE8, 0x21, 0xC0, 0xA5, 0xEF, 0xE8, 0xF1,
+ 0x64, 0x5C, 0x4C, 0x0C, 0x93, 0xC1, 0xAB, 0x99, 0x28, 0x5D, 0x62, 0x2C, 0xAA, 0x65, 0x2C, 0x1D,
+ 0xFA, 0xD6, 0x3D, 0x74, 0x5D, 0x6F, 0x2D, 0xE5, 0xF1, 0x7E, 0x5E, 0xAF, 0x0F, 0xC4, 0x96, 0x3D,
+ 0x26, 0x1C, 0x8A, 0x12, 0x43, 0x65, 0x18, 0x20, 0x6D, 0xC0, 0x93, 0x34, 0x4D, 0x5A, 0xD2, 0x93 };
+
+ private Evidence CreateHostEvidence (object o)
+ {
+ Evidence e = new Evidence ();
+ e.AddHost (o);
+ return e;
+ }
+
+ private Evidence CreateAssemblyEvidence (object o)
+ {
+ Evidence e = new Evidence ();
+ e.AddAssembly (o);
+ return e;
+ }
+
+ [TestFixtureSetUp]
+ public void FixtureSetUp ()
+ {
+ wrongEvidence = new Site ("test");
+ allEmpty = new Evidence ();
+
+ AssemblyName an = typeof (int).Assembly.GetName ();
+ name = an.Name;
+ version = an.Version;
+ blob = new StrongNamePublicKeyBlob (an.GetPublicKey ());
+
+ ms = new StrongNamePublicKeyBlob (_msFinalKey);
+
+ hostEcmaCorlibVersion = CreateHostEvidence (new StrongName (blob, name, version));
+ hostEcmaVersion = CreateHostEvidence (new StrongName (blob, " ", version));
+ hostMsSystemSecurityVersion = CreateHostEvidence (new StrongName (ms, "System.Security", version));
+ hostMsVersion = CreateHostEvidence (new StrongName (ms, " ", version));
+ hostOther = CreateHostEvidence (wrongEvidence);
+
+ assemblyEcmaCorlibVersion = CreateAssemblyEvidence (new StrongName (blob, name, version));
+ assemblyEcmaVersion = CreateAssemblyEvidence (new StrongName (blob, " ", version));
+ assemblyMsSystemSecurityVersion = CreateAssemblyEvidence (new StrongName (ms, "System.Security", version));
+ assemblyMsVersion = CreateAssemblyEvidence (new StrongName (ms, " ", version));
+ assemblyOther = CreateAssemblyEvidence (wrongEvidence);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void StrongNameMembershipCondition_NullBlob ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (null, name, version);
+ }
+
+ private void Common (StrongNameMembershipCondition snmc)
+ {
+ Assert.IsFalse (snmc.Check (allEmpty), "Check(allEmpty)");
+ Assert.IsFalse (snmc.Check (hostOther), "Check(hostOther)");
+ Assert.IsFalse (snmc.Check (assemblyEcmaCorlibVersion), "Check(assemblyEcmaCorlibVersion)");
+ Assert.IsFalse (snmc.Check (assemblyEcmaVersion), "Check(assemblyEcmaVersion)");
+ Assert.IsFalse (snmc.Check (assemblyMsSystemSecurityVersion), "Check(assemblyMsSystemSecurityVersion)");
+ Assert.IsFalse (snmc.Check (assemblyMsVersion), "Check(assemblyMsVersion)");
+ Assert.IsFalse (snmc.Check (assemblyOther), "Check(assemblyOther)");
+
+ StrongNameMembershipCondition copy = (StrongNameMembershipCondition)snmc.Copy ();
+ Assert.IsTrue (copy.Equals (snmc), "copy.Equals (snmc)");
+ Assert.IsTrue (snmc.Equals (copy), "snmc.Equals (copy)");
+ copy.Name = null;
+ copy.Version = null;
+ bool original = ((snmc.Name == null) && (snmc.Version == null));
+ Assert.AreEqual (original, copy.Equals (snmc), "bad.Equals (snmc)");
+ Assert.AreEqual (original, snmc.Equals (copy), "snmc.Equals (bad)");
+
+ SecurityElement se = snmc.ToXml ();
+ copy.FromXml (se);
+ Assert.AreEqual (snmc.PublicKey, copy.PublicKey, "PublicKey");
+ Assert.AreEqual (snmc.Name, copy.Name, "Name");
+ Assert.AreEqual (snmc.Version, copy.Version, "Version");
+ Assert.AreEqual (snmc.GetHashCode (), copy.GetHashCode (), "GetHashCode ()");
+ Assert.AreEqual (snmc.ToString (), copy.ToString (), "ToString ()");
+ Assert.IsTrue (copy.Equals (snmc), "xml.Equals (snmc)");
+ Assert.IsTrue (snmc.Equals (copy), "snmc.Equals (xml)");
+ }
+
+ [Test]
+ public void StrongNameMembershipCondition_NullName ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, null, version);
+ Assert.AreEqual (blob, snmc.PublicKey, "PublicKey");
+ Assert.IsNull (snmc.Name, "Name");
+ Assert.AreEqual (version, snmc.Version, "Version");
+ Assert.AreEqual (blob.GetHashCode (), snmc.GetHashCode (), "GetHashCode ()");
+ Assert.IsTrue (snmc.ToString ().StartsWith ("StrongName - 00000000000000000400000000000000 version = "), "ToString ()");
+
+ Assert.IsTrue (snmc.Check (hostEcmaCorlibVersion), "Check(hostEcmaCorlibVersion)");
+ Assert.IsTrue (snmc.Check (hostEcmaVersion), "Check(hostEcmaVersion)");
+ Assert.IsFalse (snmc.Check (hostMsSystemSecurityVersion), "Check(hostMsSystemSecurityVersion)");
+ Assert.IsFalse (snmc.Check (hostMsVersion), "Check(hostMsVersion)");
+ Common (snmc);
+ }
+
+ [Test]
+ public void StrongNameMembershipCondition_NullVersion ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, null);
+ Assert.AreEqual (blob, snmc.PublicKey, "PublicKey");
+ Assert.AreEqual (name, snmc.Name, "Name");
+ Assert.IsNull (snmc.Version, "Version");
+ Assert.AreEqual (blob.GetHashCode (), snmc.GetHashCode (), "GetHashCode ()");
+ Assert.AreEqual ("StrongName - 00000000000000000400000000000000 name = mscorlib", snmc.ToString (), "ToString ()");
+
+ Assert.IsTrue (snmc.Check (hostEcmaCorlibVersion), "Check(hostEcmaCorlibVersion)");
+ Assert.IsFalse (snmc.Check (hostEcmaVersion), "Check(hostEcmaVersion)");
+ Assert.IsFalse (snmc.Check (hostMsSystemSecurityVersion), "Check(hostMsSystemSecurityVersion)");
+ Assert.IsFalse (snmc.Check (hostMsVersion), "Check(hostMsVersion)");
+ Common (snmc);
+ }
+
+ [Test]
+ public void StrongNameMembershipCondition_NullNameVersion ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, null, null);
+ Assert.AreEqual (blob, snmc.PublicKey, "PublicKey");
+ Assert.IsNull (snmc.Name, "Name");
+ Assert.IsNull (snmc.Version, "Version");
+ Assert.AreEqual (blob.GetHashCode (), snmc.GetHashCode (), "GetHashCode ()");
+ Assert.AreEqual ("StrongName - 00000000000000000400000000000000", snmc.ToString (), "ToString ()");
+
+ Assert.IsTrue (snmc.Check (hostEcmaCorlibVersion), "Check(hostEcmaCorlibVersion)");
+ Assert.IsTrue (snmc.Check (hostEcmaVersion), "Check(hostEcmaVersion)");
+ Assert.IsFalse (snmc.Check (hostMsSystemSecurityVersion), "Check(hostMsSystemSecurityVersion)");
+ Assert.IsFalse (snmc.Check (hostMsVersion), "Check(hostMsVersion)");
+ Common (snmc);
+ }
+
+ [Test]
+ public void StrongNameMembershipCondition_Mscorlib ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ Assert.AreEqual (blob, snmc.PublicKey, "PublicKey");
+ Assert.AreEqual ("mscorlib", snmc.Name, "Name");
+ Assert.AreEqual (version, snmc.Version, "Version");
+ Assert.AreEqual (blob.GetHashCode (), snmc.GetHashCode (), "GetHashCode ()");
+ Assert.IsTrue (snmc.ToString ().StartsWith ("StrongName - 00000000000000000400000000000000 name = mscorlib version = "), "ToString ()");
+
+ Assert.IsTrue (snmc.Check (hostEcmaCorlibVersion), "Check(hostEcmaCorlibVersion)");
+ Assert.IsFalse (snmc.Check (hostEcmaVersion), "Check(hostEcmaVersion)");
+ Assert.IsFalse (snmc.Check (hostMsSystemSecurityVersion), "Check(hostMsSystemSecurityVersion)");
+ Assert.IsFalse (snmc.Check (hostMsVersion), "Check(hostMsVersion)");
+ Common (snmc);
+ }
+
+ [Test]
+ public void StrongNameMembershipCondition_MsKey ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (ms, null, null);
+ Assert.AreEqual (ms, snmc.PublicKey, "PublicKey");
+ Assert.IsNull (snmc.Name, "Name");
+ Assert.IsNull (snmc.Version, "Version");
+ Assert.AreEqual (ms.GetHashCode (), snmc.GetHashCode (), "GetHashCode ()");
+
+ Assert.IsFalse (snmc.Check (hostEcmaCorlibVersion), "Check(hostEcmaCorlibVersion)");
+ Assert.IsFalse (snmc.Check (hostEcmaVersion), "Check(hostEcmaVersion)");
+ Assert.IsTrue (snmc.Check (hostMsSystemSecurityVersion), "Check(hostMsSystemSecurityVersion)");
+ Assert.IsTrue (snmc.Check (hostMsVersion), "Check(hostMsVersion)");
+ Common (snmc);
+ }
+
+ [Test]
+ public void Name_Null ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ snmc.Name = null;
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void PublicKey_Null ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ snmc.PublicKey = null;
+ }
+
+ [Test]
+ public void Version_Null ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ snmc.Version = null;
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void FromXml_Null ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ snmc.FromXml (null);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void FromXml_InvalidTag ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+ se.Tag = "IMonoship";
+ snmc.FromXml (se);
+ }
+
+ [Test]
+ public void FromXml_InvalidClass ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+ se.Attributes ["class"] = "Hello world";
+ snmc.FromXml (se);
+ }
+
+ [Test]
+ public void FromXml_NoClass ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+
+ SecurityElement w = new SecurityElement (se.Tag);
+ w.AddAttribute ("version", se.Attribute ("version"));
+ snmc.FromXml (w);
+ // doesn't even care of the class attribute presence
+ }
+
+ [Test]
+ public void FromXml_InvalidVersion ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+
+ SecurityElement w = new SecurityElement (se.Tag);
+ w.AddAttribute ("class", se.Attribute ("class"));
+ w.AddAttribute ("version", "2");
+ w.AddAttribute ("PublicKeyBlob", se.Attribute ("PublicKeyBlob"));
+ snmc.FromXml (w);
+ }
+
+ [Test]
+ public void FromXml_NoVersion ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+
+ SecurityElement w = new SecurityElement (se.Tag);
+ w.AddAttribute ("class", se.Attribute ("class"));
+ snmc.FromXml (w);
+ }
+
+ [Test]
+ public void FromXml_PolicyLevel ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+ // is it accepted for all policy levels ?
+ IEnumerator e = SecurityManager.PolicyHierarchy ();
+ while (e.MoveNext ()) {
+ PolicyLevel pl = e.Current as PolicyLevel;
+ StrongNameMembershipCondition spl = new StrongNameMembershipCondition (blob, name, version);
+ spl.FromXml (se, pl);
+ Assert.IsTrue (spl.Equals (snmc), "FromXml(PolicyLevel='" + pl.Label + "')");
+ }
+ // yes!
+ }
+
+ [Test]
+ public void ToXml_Null ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ // no ArgumentNullException here
+ SecurityElement se = snmc.ToXml (null);
+ Assert.IsNotNull (se, "ToXml(null)");
+ }
+
+ [Test]
+ public void ToXml_PolicyLevel ()
+ {
+ StrongNameMembershipCondition snmc = new StrongNameMembershipCondition (blob, name, version);
+ SecurityElement se = snmc.ToXml ();
+ string s = snmc.ToXml ().ToString ();
+ // is it accepted for all policy levels ?
+ IEnumerator e = SecurityManager.PolicyHierarchy ();
+ while (e.MoveNext ()) {
+ PolicyLevel pl = e.Current as PolicyLevel;
+ StrongNameMembershipCondition spl = new StrongNameMembershipCondition (blob, name, version);
+ spl.FromXml (se, pl);
+ Assert.AreEqual (s, spl.ToXml (pl).ToString (), "ToXml(PolicyLevel='" + pl.Label + "')");
+ }
+ // yes!
+ }
+ }
+}
public void NullNameConstructor ()
{
StrongName sn = new StrongName (snpkb, null, version);
+ }\r
+\r
+ [Test]\r
+ [ExpectedException (typeof (ArgumentException))]\r
+ public void EmptyNameConstructor ()\r
+ {\r
+ StrongName sn = new StrongName (snpkb, String.Empty, version);\r
}
[Test]
+2005-06-10 Sebastien Pouliot <sebastien@ximian.com>
+
+ * PermissionSetTest.cs: Added tests for GetPermission with null and
+ when using a subclass of a permission. Also some new (not working)
+ tests for NET_2_0.
+
2005-05-30 Sebastien Pouliot <sebastien@ximian.com>
* PermissionSetTest.cs: Added unification tests for permissions inside
Assert ("Copy", ps.GetHashCode () != copy.GetHashCode ());
}
#endif
+ [Test]
+ public void GetPermission_Null ()
+ {
+ PermissionSet ps = new PermissionSet (PermissionState.None);
+ AssertNull ("Empty", ps.GetPermission (null));
+ }
+
[Test]
public void GetPermission_None ()
{
AssertNull ("Empty", ps.GetPermission (typeof (SecurityPermission)));
}
+ [Test]
+ public void GetPermission_Subclass ()
+ {
+ IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.Unrestricted);
+ PermissionSet ps = new PermissionSet (PermissionState.None);
+ ps.AddPermission (isfp);
+ AssertNull ("Subclass", ps.GetPermission (typeof (IsolatedStoragePermission)));
+ }
+
private void Compare (string msg, PermissionSet ps, bool unrestricted, int count)
{
AssertNotNull (msg + "-NullCheck", ps);
Compare ("UPS2+ZIP U UPS1", ups2.Union (ups1), true, 1);
#endif
}
+#if NET_2_0
+ [Test]
+ [Category ("NotWorking")] // requires imperative stack modifiers
+ [ExpectedException (typeof (ExecutionEngineException))]
+ public void RevertAssert_WithoutAssertion ()
+ {
+ PermissionSet.RevertAssert ();
+ }
+ [Test]
+ [Category ("NotWorking")] // requires imperative stack modifiers
+ public void RevertAssert_WithAssertion ()
+ {
+ PermissionSet ups = new PermissionSet (PermissionState.Unrestricted);
+ ups.Assert ();
+ PermissionSet.RevertAssert ();
+ }
+#endif
[Test]
public void Assert_NonCasPermission ()
{
\r
*/
+ // Hangs #72534
+ [Category("NotWorking")]\r
public void TestWaitAndSignal1()\r
{\r
Mutex Sem = new Mutex(false);\r
}\r
// Hangs
+ [Category("NotWorking")]
public void TestWaitAndFoget1()\r
{\r
Mutex Sem = new Mutex(false);\r
namespace MonoTests.System.Threading\r
{\r
[TestFixture]
+ // DISABLED due to random hangs. Do not renable until you can run this
+ // a few thousand times on an SMP box.
+ [Category ("NotWorking")]
public class ReaderWriterLockTest : Assertion\r
{\r
ReaderWriterLock rwlock;\r
using System.Threading;
namespace MonoTests.System.Threading {
-
+
+ // These tests seem to hang the 2.0 framework. So they are disabled for now
+ // Don't reenable them until you can run a few thousand times on an SMP box.
+ [Category ("NotWorking")]
public class ThreadedPrincipalTest : Assertion {
public static void NoPrincipal ()
}
[TestFixture]
+ [Category ("NotWorking")]
public class ThreadTest : Assertion {
//Some Classes to test as threads
namespace MonoTests.System.Threading {
[TestFixture]
+ //
+ // This whole test seems to fail randomly. Either
+ // - It is relying on a race it might not win (that the timer code runs)
+ // - We have a very obscure bug with appdomains.
+ //
+ // Am going with door #1, but it would be nice to investigate this.
+ // -- Ben
+ //
+ [Category ("NotWorking")]
public class TimerTest : Assertion {
public int counter;
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ConvertTest.cs: added new tests for FromBase64String.
+
+2005-06-06 Sebastien Pouliot <sebastien@ximian.com>
+
+ * ModuleHandleTest.cs: Renamed PortableExecutableKind to *Kinds to fix
+ compilation.
+
2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* ActivatorTest.cs: removed CreateCom* tests, as we don't support that
AssertEquals ("CharArray-IgnoreCharsAfter-Ignored", 15, data.Length);
}
- public void TestConvertFromNull() {
-
- AssertEquals ("#W1", false, Convert.ToBoolean (null as object));
- AssertEquals ("#W2", 0, Convert.ToByte (null as object));
- AssertEquals ("#W3", 0, Convert.ToChar (null as object));
- AssertEquals ("#W4", new DateTime (1,1,1,0,0,0), Convert.ToDateTime (null as object));
- AssertEquals ("#W5", 0, Convert.ToDecimal (null as object));
- AssertEquals ("#W6", 0, Convert.ToDouble (null as object));
- AssertEquals ("#W7", 0, Convert.ToInt16 (null as object));
- AssertEquals ("#W8", 0, Convert.ToInt32 (null as object));
- AssertEquals ("#W9", 0, Convert.ToInt64 (null as object));
- AssertEquals ("#W10", 0, Convert.ToSByte (null as object));
- AssertEquals ("#W11", 0, Convert.ToSingle (null as object));
- AssertEquals ("#W12", "", Convert.ToString (null as object));
- AssertEquals ("#W13", 0, Convert.ToUInt16 (null as object));
- AssertEquals ("#W14", 0, Convert.ToUInt32 (null as object));
- AssertEquals ("#W15", 0, Convert.ToUInt64 (null as object));
- AssertEquals ("#W16", false, Convert.ToBoolean (null as string));
- AssertEquals ("#W17", 0, Convert.ToByte (null as string));
-
- try {
- Convert.ToChar (null as string);
- Fail ();
- } catch (Exception e) {
- AssertEquals ("#W18", typeof (ArgumentNullException), e.GetType ());
- }
-
- AssertEquals ("#W19", new DateTime (1,1,1,0,0,0), Convert.ToDateTime (null as string));
- AssertEquals ("#W20", 0, Convert.ToDecimal (null as string));
- AssertEquals ("#W21", 0, Convert.ToDouble (null as string));
- AssertEquals ("#W22", 0, Convert.ToInt16 (null as string));
- AssertEquals ("#W23", 0, Convert.ToInt32 (null as string));
- AssertEquals ("#W24", 0, Convert.ToInt64 (null as string));
- AssertEquals ("#W25", 0, Convert.ToSByte (null as string));
- AssertEquals ("#W26", 0, Convert.ToSingle (null as string));
- AssertEquals ("#W27", null, Convert.ToString (null as string));
- AssertEquals ("#W28", 0, Convert.ToUInt16 (null as string));
- AssertEquals ("#W29", 0, Convert.ToUInt32 (null as string));
- AssertEquals ("#W30", 0, Convert.ToUInt64 (null as string));
- }
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ConvertEmpty ()
+ {
+ Convert.FromBase64String ("");
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ConvertOnlyWhiteSpace ()
+ {
+ Convert.FromBase64String (" \r\t");
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ConvertInvalidChar ()
+ {
+ Convert.FromBase64String ("amVsb3U=\u0100");
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ConvertMin ()
+ {
+ Convert.FromBase64String ("amVsb3U= \r \n\u007B");
+ }
+
+ public void TestConvertFromNull() {
+
+ AssertEquals ("#W1", false, Convert.ToBoolean (null as object));
+ AssertEquals ("#W2", 0, Convert.ToByte (null as object));
+ AssertEquals ("#W3", 0, Convert.ToChar (null as object));
+ AssertEquals ("#W4", new DateTime (1,1,1,0,0,0), Convert.ToDateTime (null as object));
+ AssertEquals ("#W5", 0, Convert.ToDecimal (null as object));
+ AssertEquals ("#W6", 0, Convert.ToDouble (null as object));
+ AssertEquals ("#W7", 0, Convert.ToInt16 (null as object));
+ AssertEquals ("#W8", 0, Convert.ToInt32 (null as object));
+ AssertEquals ("#W9", 0, Convert.ToInt64 (null as object));
+ AssertEquals ("#W10", 0, Convert.ToSByte (null as object));
+ AssertEquals ("#W11", 0, Convert.ToSingle (null as object));
+ AssertEquals ("#W12", "", Convert.ToString (null as object));
+ AssertEquals ("#W13", 0, Convert.ToUInt16 (null as object));
+ AssertEquals ("#W14", 0, Convert.ToUInt32 (null as object));
+ AssertEquals ("#W15", 0, Convert.ToUInt64 (null as object));
+ AssertEquals ("#W16", false, Convert.ToBoolean (null as string));
+ AssertEquals ("#W17", 0, Convert.ToByte (null as string));
+
+ try {
+ Convert.ToChar (null as string);
+ Fail ();
+ } catch (Exception e) {
+ AssertEquals ("#W18", typeof (ArgumentNullException), e.GetType ());
+ }
+
+ AssertEquals ("#W19", new DateTime (1,1,1,0,0,0), Convert.ToDateTime (null as string));
+ AssertEquals ("#W20", 0, Convert.ToDecimal (null as string));
+ AssertEquals ("#W21", 0, Convert.ToDouble (null as string));
+ AssertEquals ("#W22", 0, Convert.ToInt16 (null as string));
+ AssertEquals ("#W23", 0, Convert.ToInt32 (null as string));
+ AssertEquals ("#W24", 0, Convert.ToInt64 (null as string));
+ AssertEquals ("#W25", 0, Convert.ToSByte (null as string));
+ AssertEquals ("#W26", 0, Convert.ToSingle (null as string));
+ AssertEquals ("#W27", null, Convert.ToString (null as string));
+ AssertEquals ("#W28", 0, Convert.ToUInt16 (null as string));
+ AssertEquals ("#W29", 0, Convert.ToUInt32 (null as string));
+ AssertEquals ("#W30", 0, Convert.ToUInt64 (null as string));
+ }
[Test]
public void ToByte_PrefixedHexStringInBase16 ()
[Test]
public void GetPEKind () {
- PortableExecutableKind pe_kind;
+ PortableExecutableKinds pe_kind;
ImageFileMachine machine;
module.GetPEKind (out pe_kind, out machine);
- AssertEquals (PortableExecutableKind.ILOnly, pe_kind);
+ AssertEquals (PortableExecutableKinds.ILOnly, pe_kind);
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void GetPEKindInvalidHandle () {
- PortableExecutableKind pe_kind;
+ PortableExecutableKinds pe_kind;
ImageFileMachine machine;
ModuleHandle.EmptyHandle.GetPEKind (out pe_kind, out machine);
interface IFace1 {
void foo ();
- }
+ }
interface IFace2 : IFace1 {
void bar ();
- }
+ }
interface IFace3 : IFace2 {
}
[Test]
[Category("NotDotNet")]
+ // Depends on the GAC working, which it doesn't durring make distcheck.
+ [Category ("NotWorking")]
public void GetTypeWithWhitespace () {
AssertNotNull (Type.GetType
(@"System.Configuration.NameValueSectionHandler,
[Test]
public void CreateValueTypeNoCtor () {
- typeof(B).InvokeMember ("", BindingFlags.CreateInstance, null, null, null);
+ typeof(B).InvokeMember ("", BindingFlags.CreateInstance, null, null, null);
}
[Test]
[ExpectedException (typeof (MissingMethodException))]
public void CreateValueTypeNoCtorArgs () {
- typeof(B).InvokeMember ("", BindingFlags.CreateInstance, null, null, new object [] { 1 });
+ typeof(B).InvokeMember ("", BindingFlags.CreateInstance, null, null, new object [] { 1 });
}
class TakesInt {
}
[Test]
+ [Category ("NotWorking")] // Filed as bug #75241
public void GetConstructoNullInTypes ()
{
// This ends up calling type.GetConstructor ()
System/GenericParameterAttributes.cs
System/Guid.cs
System/IAppDomainSetup.cs
-System/IApplicationDescription.cs
System/IAsyncResult.cs
System/ICloneable.cs
System/IComparable.cs
System/IDisposable.cs
System/IFormatProvider.cs
System/IFormattable.cs
-System/IHostContext.cs
System/INullableValue.cs
System/IndexOutOfRangeException.cs
System/Int16.cs
System.Reflection/EventAttributes.cs
System.Reflection/EventInfo.cs
System.Reflection/ExceptionHandlingClause.cs
-System.Reflection/ExceptionHandlingClauseFlags.cs
+System.Reflection/ExceptionHandlingClauseOptions.cs
System.Reflection/FieldAttributes.cs
System.Reflection/FieldInfo.cs
System.Reflection/ICustomAttributeProvider.cs
System.Reflection/ParameterInfo.cs
System.Reflection/ParameterModifier.cs
System.Reflection/Pointer.cs
-System.Reflection/PortableExecutableKind.cs
+System.Reflection/PortableExecutableKinds.cs
+System.Reflection/ProcessorArchitecture.cs
System.Reflection/PropertyAttributes.cs
System.Reflection/PropertyInfo.cs
System.Reflection/ReflectionTypeLoadException.cs
System.Runtime.CompilerServices/RuntimeHelpersTest.cs
System.Runtime.InteropServices/GCHandleTest.cs
System.Runtime.InteropServices/MarshalTest.cs
+System.Runtime.InteropServices/RuntimeEnvironmentTest.cs
System.Runtime.Remoting/ContextTest.cs
System.Runtime.Remoting/SoapServicesTest.cs
System.Runtime.Remoting/SynchronizationAttributeTest.cs
System.Security.Policy/SiteMembershipConditionTest.cs
System.Security.Policy/SiteTest.cs
System.Security.Policy/StrongNameTest.cs
+System.Security.Policy/StrongNameMembershipConditionTest.cs
System.Security.Policy/UnionCodeGroupTest.cs
System.Security.Policy/UrlMembershipConditionTest.cs
System.Security.Policy/UrlTest.cs
System.Reflection.Emit/MethodRentalCas.cs
System.Resources/ResourceReaderCas.cs
System.Resources/ResourceSetCas.cs
+System.Runtime.InteropServices/RuntimeEnvironmentCas.cs
System.Security/PermissionSetCas.cs
System.Security/SecurityContextCas.cs
System.Security/SecurityExceptionCas.cs
+2005-06-06 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile (run-mcs-tests): Update location of compiler-tester.exe.
+
+2005-06-06 Marek Safar <marek.safar@seznam.cz>
+
+ * Makefile: Reflect tester changes.
+
+ * TestRunner.cs: Moved to tools/compiler-tester.
+
2005-06-03 Raja R Harinath <rharinath@novell.com>
* cs0654.cs: New test.
DISTFILES = \
CONTRIBUTORS_README \
- README.tests \
errors.txt \
do-tests.pl \
$(wildcard *.cs) \
all-local:
-test-local: TestRunner-$(PROFILE).exe $(TEST_SUPPORT_FILES)
+test-local: $(TEST_SUPPORT_FILES)
run-test-ondotnet-local:
run-mcs-tests: $(TEST_SUPPORT_FILES)
-run-mcs-tests: TestRunner-$(PROFILE).exe
- $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) TestRunner-$(PROFILE).exe $(COMPILER_NAME) $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
+run-mcs-tests:
+ $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe negative $(TEST_PATTERN) $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
clean-local:
rm -f *.exe *.dll *.log *.mdb dummy.xml *.junk
%-module.dll: %-module.cs
$(CSCOMPILE) /target:module /out:$@ $<
-
-TestRunner-$(PROFILE).exe: TestRunner.cs
- $(CSCOMPILE) /out:$@ TestRunner.cs
+++ /dev/null
-Test cases listed by Category:
-==============================
-
-* Flow Analysis
-
- error-1.cs error-3.cs
-
-* Type Containers
-
- error-2.cs
-
-Test cases listed by Number:
-============================
-
-error-1.cs
-----------
-Flow analysis: Check whether mcs correctly reports all errors.
-
-error-2.cs
-----------
-Base types are less accessible than the current type.
-
-error-3.cs
-----------
-Flow analysis: Check struct members.
-
-error-4.cs
-----------
-Ensure that we do not allow void types to be converted to anything else
-
-error-5.cs
-----------
-Catch invalid access to a private event of a class
-
-error-6.cs
-----------
-Catch invalid (multiple) assignments.
-
+++ /dev/null
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Reflection;
-using System.Text;
-using System.Collections;
-
-namespace TestRunner {
-
- interface ITester
- {
- string Output { get; }
- bool Invoke (string[] args);
- }
-
- class ReflectionTester: ITester {
- MethodInfo ep;
- object[] method_arg;
- StringWriter output;
-
- public ReflectionTester (Assembly a)
- {
- ep = a.GetType ("Mono.CSharp.CompilerCallableEntryPoint").GetMethod ("InvokeCompiler",
- BindingFlags.Static | BindingFlags.Public);
- if (ep == null)
- throw new MissingMethodException ("static InvokeCompiler");
- method_arg = new object [2];
- }
-
- public string Output {
- get {
- return output.GetStringBuilder ().ToString ();
- }
- }
-
- public bool Invoke(string[] args)
- {
- output = new StringWriter ();
- method_arg [0] = args;
- method_arg [1] = output;
- return (bool)ep.Invoke (null, method_arg);
- }
- }
-
- class ProcessTester: ITester
- {
- ProcessStartInfo pi;
- string output;
-
- public ProcessTester (string p_path)
- {
- pi = new ProcessStartInfo ();
- pi.FileName = p_path;
- pi.CreateNoWindow = true;
- pi.WindowStyle = ProcessWindowStyle.Hidden;
- pi.RedirectStandardOutput = true;
- pi.RedirectStandardError = true;
- pi.UseShellExecute = false;
- }
-
- public string Output {
- get {
- return output;
- }
- }
-
- public bool Invoke(string[] args)
- {
- StringBuilder sb = new StringBuilder ();
- foreach (string s in args) {
- sb.Append (s);
- sb.Append (" ");
- }
- pi.Arguments = sb.ToString ();
- Process p = Process.Start (pi);
- output = p.StandardError.ReadToEnd ();
- if (output.Length == 0)
- output = p.StandardOutput.ReadToEnd ();
- p.WaitForExit ();
- return p.ExitCode == 0;
- }
- }
-
- class Tester {
-
- enum CompilerError
- {
- Expected,
- Wrong,
- Missing
- }
-
- static ArrayList know_issues = new ArrayList ();
- static ArrayList ignore_list = new ArrayList ();
- static ArrayList no_error_list = new ArrayList ();
- static ArrayList regression = new ArrayList ();
-
- static StreamWriter log_file;
-
- static void Log (string msg, params object [] rest)
- {
- Console.Write (msg, rest);
- log_file.Write (msg, rest);
- }
-
- static void LogLine ()
- {
- Console.WriteLine ();
- log_file.WriteLine ();
- }
-
- static void LogLine (string msg, params object [] rest)
- {
- Console.WriteLine (msg, rest);
- log_file.WriteLine (msg, rest);
- }
-
- static int Main(string[] args) {
- if (args.Length != 4) {
- Console.Error.WriteLine ("Usage: TestRunner (test-pattern|compiler-name) compiler know-issues log-file");
- return 1;
- }
-
- string test_pattern = args [0];
- string mcs = args [1];
- string issue_file = args [2];
- string log_fname = args [3];
-
- log_file = new StreamWriter (log_fname, false);
-
- // THIS IS BUG #73763 workaround
- if (test_pattern == "gmcs")
- test_pattern = "*cs*.cs";
- else
- test_pattern = "cs*.cs";
-
- string wrong_errors_file = issue_file;
- string[] files = Directory.GetFiles (".", test_pattern);
-
- ReadWrongErrors (wrong_errors_file);
- ITester tester;
- try {
- Console.WriteLine ("Loading: " + mcs);
- tester = new ReflectionTester (Assembly.LoadFile (mcs));
- }
- catch (Exception) {
- Console.Error.WriteLine ("Switching to command line mode (compiler entry point was not found)");
- if (!File.Exists (mcs)) {
- Console.Error.WriteLine ("ERROR: Tested compiler was not found");
- return 1;
- }
- tester = new ProcessTester (mcs);
- }
-
- string[] test_args;
- int success = 0;
- int total = files.Length;
- foreach (string s in files) {
- string filename = Path.GetFileName (s);
- if (filename.StartsWith ("CS")) { // Windows hack
- total--;
- continue;
- }
-
- Log (filename);
-
- string[] extra = GetExtraOptions (s);
- if (extra != null) {
- test_args = new string [1 + extra.Length];
- extra.CopyTo (test_args, 0);
- } else {
- test_args = new string [1];
- }
- test_args [test_args.Length - 1] = s;
-
- Log ("...\t");
-
- if (ignore_list.Contains (filename)) {
- LogLine ("NOT TESTED");
- total--;
- continue;
- }
-
- try {
- int start_char = 0;
- while (Char.IsLetter (filename, start_char))
- ++start_char;
-
- int end_char = filename.IndexOfAny (new char [] { '-', '.' } );
- string expected = filename.Substring (start_char, end_char - start_char);
-
- bool result = tester.Invoke (test_args);
- if (result) {
- HandleFailure (filename, CompilerError.Missing);
- continue;
- }
-
- CompilerError result_code = GetCompilerError (expected, tester.Output);
- if (HandleFailure (filename, result_code)) {
- success++;
- } else {
- LogLine (tester.Output);
- }
- }
- catch (Exception e) {
- HandleFailure (filename, CompilerError.Missing);
- Log (e.ToString ());
- }
- }
-
- LogLine ("Done" + Environment.NewLine);
- LogLine ("{0} correctly detected error cases ({1:.##%})", success, (float) (success) / (float)total);
-
- know_issues.AddRange (no_error_list);
- if (know_issues.Count > 0) {
- LogLine ();
- LogLine (issue_file + " contains {0} already fixed issues. Please remove", know_issues.Count);
- foreach (string s in know_issues)
- LogLine (s);
- }
- if (regression.Count > 0) {
- LogLine ();
- LogLine ("The latest changes caused regression in {0} file(s)", regression.Count);
- foreach (string s in regression)
- LogLine (s);
- }
-
- log_file.Close ();
-
- return regression.Count == 0 ? 0 : 1;
- }
-
- static void ReadWrongErrors (string file)
- {
- const string ignored = "IGNORE";
- const string no_error = "NO ERROR";
-
- using (StreamReader sr = new StreamReader (file)) {
- string line;
- while ((line = sr.ReadLine()) != null) {
- if (line.StartsWith ("#"))
- continue;
-
- ArrayList active_cont = know_issues;
-
- if (line.IndexOf (ignored) > 0)
- active_cont = ignore_list;
- else if (line.IndexOf (no_error) > 0)
- active_cont = no_error_list;
-
- string file_name = line.Split (' ')[0];
- if (file_name.Length == 0)
- continue;
-
- active_cont.Add (file_name);
- }
- }
- }
-
- static bool HandleFailure (string file, CompilerError status)
- {
- switch (status) {
- case CompilerError.Expected:
- if (know_issues.Contains (file) || no_error_list.Contains (file)) {
- LogLine ("FIXED ISSUE");
- return true;
- }
- LogLine ("OK");
- return true;
-
- case CompilerError.Wrong:
- if (know_issues.Contains (file)) {
- LogLine ("KNOWN ISSUE (Wrong error reported)");
- know_issues.Remove (file);
- return false;
- }
- if (no_error_list.Contains (file)) {
- LogLine ("REGRESSION (NO ERROR -> WRONG ERROR)");
- no_error_list.Remove (file);
- }
- else {
- LogLine ("REGRESSION (CORRECT ERROR -> WRONG ERROR)");
- }
-
- break;
-
- case CompilerError.Missing:
- if (no_error_list.Contains (file)) {
- LogLine ("KNOWN ISSUE (No error reported)");
- no_error_list.Remove (file);
- return false;
- }
-
- if (know_issues.Contains (file)) {
- LogLine ("REGRESSION (WRONG ERROR -> NO ERROR)");
- know_issues.Remove (file);
- }
- else {
- LogLine ("REGRESSION (CORRECT ERROR -> NO ERROR)");
- }
-
- break;
- }
-
- regression.Add (file);
- return false;
- }
-
- static CompilerError GetCompilerError (string expected, string buffer)
- {
- const string error_prefix = "CS";
- const string ignored_error = "error CS5001";
- string tested_text = "error " + error_prefix + expected;
- StringReader sr = new StringReader (buffer);
- string line = sr.ReadLine ();
- bool any_error = false;
- while (line != null) {
-
- if (line.IndexOf (tested_text) != -1)
- return CompilerError.Expected;
-
- if (line.IndexOf (error_prefix) != -1 &&
- line.IndexOf (ignored_error) == -1)
- any_error = true;
-
- line = sr.ReadLine ();
- }
-
- return any_error ? CompilerError.Wrong : CompilerError.Missing;
- }
-
- static string[] GetExtraOptions (string file)
- {
- const string options = "// Compiler options:";
-
- int row = 0;
- using (StreamReader sr = new StreamReader (file)) {
- String line;
- while (row++ < 3 && (line = sr.ReadLine()) != null) {
- int index = line.IndexOf (options);
- if (index != -1) {
- string[] o = line.Substring (index + options.Length).Split (' ');
- for (int i = 0; i < o.Length; i++)
- o [i] = o[i].TrimStart ();
- return o;
- }
- }
- }
- return null;
- }
- }
-}
-// cs0017.cs: Program has more than one entry point
+// cs0017.cs: Program `cs0017.exe' has more than one entry point defined: `X.Main()'
// Line: 7
class X {
static void Main () {}
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
+// cs0019-2.cs: Operator `+' cannot be applied to operands of type `int' and `Test.Zub'
// Line : 11
using System;
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
+// cs0019-3.cs: Operator `+' cannot be applied to operands of type `Test.Zub' and `Test.Zub'
// Line : 11
using System;
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
+// cs0019-4.cs: Operator `+' cannot be applied to operands of type `Test.Zub' and `Test.Zub'
// Line : 11
using System;
+// cs0019.cs: Operator `==' cannot be applied to operands of type `X' and `Y'
+// Line : 13
+
class X {
}
+// cs0019.cs: Operator `==' cannot be applied to operands of type `A' and `B'
+// Line : 21
+
enum A
{
A1,
-// cs0019.cs: Can not apply operator + between string and float *
+// cs0019-7.cs: Operator `+' cannot be applied to operands of type `string' and `float*'
// Line: 12
// Compiler options: -unsafe
using System;
-// cs0019.cs : Operator '-' cannot be applied to operands of type `string' and `ulong'
+// cs0019-8.cs: Operator `-' cannot be applied to operands of type `string' and `ulong'
// Line : 12
using System;
+// cs0019.cs: Operator `&' cannot be applied to operands of type `System.Reflection.MethodImplAttributes' and `System.Runtime.CompilerServices.MethodImplOptions'
+// Line : 13
+
//
// From bug #59864
//
-// cs0019.cs : Operator + cannot be applied to operands of type `Foo' and `int'
+// cs0019.cs: Operator `+' cannot be applied to operands of type `Foo' and `int'
// Line : 11
public class Foo {
-// cs0020.cs : Division by constant zero.
+// cs0020.cs: Division by constant zero
// Line: 9
using System;
+// cs0021-2.cs: Cannot apply indexing with [] to an expression of type `System.Array'
+// Line: 9
+
using System;
class X {
-// cs0021.cs: You can't use and indexer with a type that doesn't support it.
+// cs0021.cs: Cannot apply indexing with [] to an expression of type `int'
// Line: 9
using System;
-// cs0022.cs: Wrong number of fields inside the indexer.
+// cs0022.cs: Wrong number of indexes `2' inside [], expected `1'
// Line: 9
using System;
-// cs0023.cs : Operator ~ cannot be applied to operand of type `Foo'
+// cs0023.cs: Operator `~' cannot be applied to operand of type `Foo'
// Line : 10
public class Foo {
-// cs0026: use of this is not allowed in a static field initializer
+// cs0026-2.cs: Keyword `this' is not valid in a static property, static method, or static field initializer
//
class X {
static object o = this;
-// cs0026: use of this is not allowed in static methods
+// cs0026.cs: Keyword `this' is not valid in a static property, static method, or static field initializer
// Line: 6
class X {
static void A ()
-// cs0027-2.cs: Keyword 'this' can't be used outside a constructor, a method or a property.
+// cs0027-2.cs: Keyword `this' is not available in the current context
// Line: 10
// Attention: Here the compiler complains saying that cannot convert implicitly from 'Error0027' to 'int' but
-// cs0027.cs: Keyword 'this' can't be used outside a constructor, a method or a property.
+// cs0027.cs: Keyword `this' is not available in the current context
// Line: 7
using System;
-// cs0028: has the wrong signature to be an entry point
+// cs0028.cs: `T.Main(int)' has the wrong signature to be an entry point
// Line: 8
// Compiler options: -warnaserror -warn:4
+// cs0029.cs: Cannot implicitly convert type `string' to `System.Runtime.InteropServices.CallingConvention'
+// Line: 10
+
using System;
using System.Runtime.InteropServices;
+// cs0029.cs: Cannot implicitly convert type `T' to `int'
+// Line: 4
+
class X {
static void Main()
{
-// cs0031.cs : Constant value '256' cannot be converted to a byte
+// cs0031.cs: Constant value `256' cannot be converted to a `byte'
// Line : 7
public class Blah {
-// cs0034: operator >= is ambiguous on types ulong and sbyte
+// cs0034.cs: Operator `>=' is ambiguous on operands of type `ulong' and `sbyte'
// Line: 7
class X {
-// cs0036.cs: Attibute [In] cannot be accompaning the an 'out' parameter.
+// cs0036.cs: An out parameter cannot have the `In' attribute
// Line: 10
using System;
-//cs0037.cs: Can not convert null to struct because its a value type
+// cs0037.cs: Cannot convert null to `S' because it is a value type
// Line: 10
struct S {
int a;
-// cs0038-1.cs: Cannot access a nonstatic member of outer type 'A' via nested type 'C.N'
+// cs0038-1.cs: Cannot access a nonstatic member of outer type `A.n' via nested type `C.N'
+// Line: 12
+
class A {
protected int n = 0;
}
-// CS0038: Cannot access nonstatic member `MyEnum' of outer type `X' via nested type `X+Nested'
+// cs0038-2.cs: Cannot access a nonstatic member of outer type `X' via nested type `X.Nested'
// Line: 9
public enum MyEnum { V = 1 }
+// cs0038.cs: Cannot access a nonstatic member of outer type `A' via nested type `B.C'
+// line: 15
+
public class A {
public int Foo { get { return 1; } }
}
+// cs0038.cs: Cannot access a nonstatic member of outer type `B' via nested type `B.C'
+// line: 14
+
public class B {
public static void Main ()
{
-// cs0038.cs: Cannot access a nonstatic member of outer type `X' via nested type `X.Y'.
+// cs0038.cs: Cannot access a nonstatic member of outer type `X' via nested type `X.Y'
// line: 15
using System;
-// cs0039.cs: as operator can not convert explicitly from type to type
+// cs0039.cs: Cannot convert type `decimal' to `string' via a built-in conversion
// line: 8
class A {
public static void Main ()
-// cs0052.cs: Accessibility levels inconsistent. Method type is less accessible than method.
+// cs0050-2.cs: Inconsistent accessibility: return type `ErrorCS0052' is less accessible than method `Foo.Method()'
// Line: 10
using System;
-// cs0050.cs: Inconsistent accessibility. Return type less accessible than method.
+// cs0050.cs: Inconsistent accessibility: return type `X' is less accessible than method `Foo.Bar()'
// Line: 13
using System;
-// cs0051.cs: Inconsistent accessibility: parameter type `MyClass.X' is less accessible than method MyClass.method(MyClass.X)
+// cs0051.cs: Inconsistent accessibility: parameter type `MyClass.X' is less accessible than method `MyClass.method(MyClass.X)'
// Line: 12
public class MyClass {
-// cs0052.cs: Inconsistent accessibility: field type 'C' is less accessible than field 'PublicClass.member'
+// cs0052.cs: Inconsistent accessibility: field type `C' is less accessible than field `PublicClass.member'
// Line: 8
class C
-// cs0052.cs: Inconsistent accessibility: field type `InternalClass' is less accessible than field 'PublicClass.member'
+// cs0052.cs: Inconsistent accessibility: field type `InternalClass' is less accessible than field `PublicClass.member'
// Line: 8
class InternalClass {
-// cs0053.cs: Inconsistent accessibility. Property type is less accessible than property.
+// cs0053.cs: Inconsistent accessibility: property type `ErrorCS0053' is less accessible than property `Foo.Property'
// Line: 11
using System;
-// cs0054.cs: Inconsistent accessibility. Indexer return type is less accessible than indexer.
+// cs0054.cs: Inconsistent accessibility: indexer return type `ErrorCS0054' is less accessible than indexer `Foo.this[int]'
// Line: 13
using System;
-// cs0055.cs: Inconsistent accessibility. Parameter type is less accessible than indexer.
+// cs0055.cs: Inconsistent accessibility: parameter type `ErrorCS0055' is less accessible than indexer `Foo.this[ErrorCS0055]'
// Line: 11
using System;
-// cs0056.cs: Incompatible accessibility. Operator return type is less accessible than operator.
+// cs0056.cs: Inconsistent accessibility: return type `ErrorCS0056' is less accessible than operator `Foo.implicit operator ErrorCS0056(Foo)'
// Line: 11
using System;
-// cs0057.cs: Inconsistent accessibility. Parameter type is less accessible than operator.
+// cs0057.cs: Inconsistent accessibility: parameter type `ErrorCS0057' is less accessible than operator `Foo.implicit operator Foo(ErrorCS0057)'
// Line: 11
using System;
-// cs0058.cs: Incompatible accessibility. Parameter type is less accessible than delegate.
+// cs0058.cs: Inconsistent accessibility: return type `ErrorCS0058' is less accessible than delegate `Foo.Delegate'
// Line: 10
using System;
-// cs0059.cs: Iconsisten accessibility. Parameter type less accessible than delegate.
+// cs0059.cs: Inconsistent accessibility: parameter type `ErrorCS0059' is less accessible than delegate `Foo.ErrorCS0059Delegate'
// Line: 10
using System;
-// cs0060.cs: Incosistent accessability between X and Y.X
+// cs0060.cs: Inconsistent accessibility: base class `X' is less accessible than class `Y'
// Line: 6
class X {
}
-// cs0061.cs: Inconsistent accessibility. Base interface less accessible than interface.
+// cs0061.cs: Inconsistent accessibility: base interface `IFoo' is less accessible than interface `IBar'
// Line: 9
using System;
-// cs0065.cs: 'EventClass.handler' : event property must have both add and remove accessors
+// cs0065.cs: `EventClass.handler': event property must have both add and remove accessors
// Line : 9
using System;
-// cs0066.cs : 'Sample.reference' : event must be of a delegate type
+// cs0066-2.cs: `Sample.reference': event must be of a delegate type
// Line: 5
public class Sample {
-// cs0066.cs : 'Button.Click' : event must be of a delegate type
+// cs0066.cs: `Button.Click': event must be of a delegate type
// Line : 10
using System;
-// cs0067.cs: The event is never used.
+// cs0067.cs: The event `Foo.OnFoo' is never used
// Line: 12
// Compiler options: -warnaserror -warn:4
-// cs0068.cs: Event in interface can't have initializer.
+// cs0068.cs: `IFoo.OnFoo': event in interface cannot have initializer
// Line: 14
using System;
-// cs0069.cs: Event cannot have add or remove accessors in an interface.
+// cs0069.cs: Event in interface cannot have add or remove accessors
// Line: 13
using System;
-// cs0070.cs : The event 'Click' can only appear on the left-side of a += or -= (except when used from within the type 'Button')
+// cs0070.cs: The event `Button.Click' can only appear on the left hand side of += or -= (except when used from within the type `Button')
// Line : 20
using System;
+// cs0071-2.cs: An explicit interface implementation of an event must use property syntax
+// Line: 13
+
using System;
public delegate void Foo (object source);
-// cs0071.cs: An explicit implementation of an event must use property syntax.
+// cs0071.cs: An explicit interface implementation of an event must use property syntax
// Line: 13
using System;
-// cs0072.cs: `Child.OnFoo' : cannot override; `ErrorCS0072.OnFoo' is not an event
+// cs0072-2.cs: Event `Child.OnFoo' can override only event
// Line: 16
using System;
-// cs0072.cs: `Child.OnFoo' : cannot override; `ErrorCS0072.OnFoo' is not an event
+// cs0072.cs: Event `Child.OnFoo' can override only event
// Line: 16
using System;
-// cs0073.cs: An add or remove accessor must have a body.
+// cs0073.cs: An add or remove accessor must have a body
// Line: 9
using System;
-// cs0074.cs: Abstracts events can't have initializers.
+// cs0074.cs: `ErrorCS0074.OnFoo': abstract event cannot have an initializer
// Line: 8
using System;
-// cs0075.cs: Casting a negative value needs to have the value in parentheses.
+// cs0075.cs: To cast a negative value, you must enclose the value in parentheses
// Line: 20
class X
{
-// cs0076.cs: An item in an enumeration can't have an identifier 'value__'.
+// cs0076.cs: An item in an enumeration cannot have an identifier `value__'
// Line: 8
using System;
-// cs0077.cs: As operator can only be used with reference types.
+// cs0077.cs: The as operator must be used with a reference type (`ErrorCS0077.Foo' is a value type)
// Line: 10
using System;
-// cs0078.cs: 'l' is easily confused with digit '1'.
+// cs0078.cs: The `l' suffix is easily confused with the digit `1' (use `L' for clarity)
// Line: 12
// Compiler options: -warnaserror -warn:4
-// cs0079.cs: Events can only appear on the left hand side of += or -=
+// cs0079.cs: The event `ErrorCS0079.OnFoo' can only appear on the left hand side of += or -=
// Line: 19
using System;
-// cs0100.cs: same parameters name in a method declaration.
+// cs0100.cs: The parameter name `a' is a duplicate
// Line: 6
//
// Author:
-// Alejandro Sánchez Acosta <raciel@es.gnu.org>
+// Alejandro Snchez Acosta <raciel@es.gnu.org>
//
-// (C) Alejandro Sánchez Acosta
+// (C) Alejandro Snchez Acosta
//
public class X
-// cs0101: namespace already contains a definition for this enum
+// cs0101.cs: The namespace `<global namespace>' already contains a definition for `SomeEnum'
// Line: 10
using System;
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'add_XX'
+// cs0102-10.cs: The type `SampleClass' already contains a definition for `add_XX'
// Line: 13
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'MyEvent'
+// cs0102-11.cs: The type `SampleClass' already contains a definition for `MyEvent'
// Line: 7
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'A'
+// cs0102-12.cs: The type `SampleClass' already contains a definition for `A'
// Line: 7
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'op_Implicit'
+// cs0102-13.cs: The type `SampleClass' already contains a definition for `op_Implicit'
// Line: 10
public class SampleClass {
-// cs0102.cs: The class 'T' already contains a definition for 'A'
+// cs0102-14.cs: The type `T' already contains a definition for `A'
// Line: 6
class T{
-// cs0102.cs: The class 'Test' already contains a definition for 'add_XX'
+// cs0102.cs: The type `Test' already contains a definition for `add_XX'
// Line: 12
public class Test
-// cs0102.cs: The class 'SampleEnum' already contains a definition for 'Label'
+// cs0102-2.cs: The type `SampleEnum' already contains a definition for `Label'
// Line: 6
public enum SampleEnum {
-// cs0102.cs: The class 'ErrorClass' already contains a definition for 'Method'
+// cs0102-3.cs: The type `ErrorClass' already contains a definition for `Method'
// Line: 6
public class ErrorClass {
-// cs0102.cs: The class 'ErrorClass' already contains a definition for 'Blah'
+// cs0102-4.cs: The type `ErrorClass' already contains a definition for `Blah'
// Line: 7
using System.Runtime.CompilerServices;
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'Item'
+// cs0102-5.cs: The type `SampleClass' already contains a definition for `Item'
// Line: 6
public class SampleClass {
-// cs102.cs: The class 'X' already contains a definition for 'A'
+// cs0102-6.cs: The type `X' already contains a definition for `A'
// Line: 6
class X {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'set_Item'
+// cs0102-7.cs: The type `SampleClass' already contains a definition for `set_Item'
// Line: 7
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'set_Item'
+// cs0102-8.cs: The type `SampleClass' already contains a definition for `set_Item'
// Line: 6
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'EE'
+// cs0102-9.cs: The type `SampleClass' already contains a definition for `EE'
// Line: 6
public class SampleClass {
-// cs0102.cs: The class 'SampleClass' already contains a definition for 'set_Item'
+// cs0102.cs: The type `SampleClass' already contains a definition for `set_Item'
// Line: 6
public class SampleClass {
-// cs0103cs: The name 'y' does not exist in the current context
+// cs0103.cs: The name `y' does not exist in the context of `C'
// Line: 8
public class C
-// cs0103.cs: The name 'count' does not exist in the class or namespace 'ClassMain'
+// cs0103.cs: The name `count' does not exist in the context of `ClassMain'
// Line: 6
class ClassMain {
+// cs0104-2.cs: `Graphics' is an ambiguous reference between `Gdk.Graphics' and `System.Drawing.Graphics'
+// Line: 16
+
using Gdk;
using System.Drawing;
-// cs0104.cs: Ambiguous type reference
+// cs0104.cs: `X' is an ambiguous reference between `A.X' and `B.X'
// Line: 16
namespace A {
class X {
+// cs0105.cs: The using directive for 'System' appeared previously in this namespace
+// Line: 6
// Compiler options: -warnaserror -warn:3
using System;
-// cs0106: virtual, abstract or public are not valid for explicit interface implementations
+// cs0106: The modifier `public' is not valid for this item
// Line: 8
interface A {
void B ();
-// cs0107.cs: More than one protection modifier
+// cs0107.cs: More than one protection modifier specified
// Line: 4
class X {
public private class X2 {
-// cs0108.cs: The new keyword is required on 'Derived.EE' because it hides inherited member
+// cs0108-10.cs: `Derived.EE' hides inherited member `Base.EE'. Use the new keyword if hiding was intended
// Line: 12
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Bar.this[int, int]' because it hides inherited member
+// cs0108-11.cs: `Bar.this[int, int]' hides inherited member `Foo.this[int, int]'. Use the new keyword if hiding was intended
// Line: 15
// Compiler options: -warnaserror -warn:2
-// cs0108-12.cs: The keyword new is required on 'Libs.MyLib' because it hides inherited member
+// cs0108-12.cs: `Libs.MyLib' hides inherited member `Foo.MyLib'. Use the new keyword if hiding was intended
// Line: 18
// Compiler options: -warnaserror -warn:2
-// cs0108-2.cs: The new keyword is required on 'Derived.Test(bool)' because it hides 'BaseInterface.Test(bool)'
+// cs0108-2.cs: `Derived.Test(bool)' hides inherited member `BaseInterface.Test(bool)'. Use the new keyword if hiding was intended
// Line: 9
// Compiler options: -warnaserror -warn:2 -t:library
-// cs0108.cs: The new keyword is required on 'O.InnerAttribute()' because it hides inherited member
+// cs0108-3.cs: `O.InnerAttribute' hides inherited member `Base.InnerAttribute()'. Use the new keyword if hiding was intended
// Line: 12
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Derived.Prop(int)' because it hides inherited member
+// cs0108-4.cs: `Derived.Prop' hides inherited member `Base.Prop(int)'. Use the new keyword if hiding was intended
// Line: 10
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Derived.Prop' because it hides inherited member
+// cs0108-5.cs: `Derived.Prop' hides inherited member `Base.Prop'. Use the new keyword if hiding was intended
// Line: 10
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Derived.Prop' because it hides inherited member
+// cs0108-6.cs: `Derived.Prop' hides inherited member `Base.Prop'. Use the new keyword if hiding was intended
// Line: 14
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Derived.Prop because it hides inherited member
+// cs0108-7.cs: `Derived.Prop(bool)' hides inherited member `Base.Prop'. Use the new keyword if hiding was intended
// Line: 13
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Derived.Method()' because it hides inherited member
+// cs0108-8.cs: `Derived.Method()' hides inherited member `Base.Method()'. Use the new keyword if hiding was intended
// Line: 11
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on 'Outer.Inner' because it hides inherited member
+// cs0108-9.cs: `Outer.Inner' hides inherited member `Base.Inner'. Use the new keyword if hiding was intended
// Line: 13
// Compiler options: -warnaserror -warn:2
-// cs0108.cs: The new keyword is required on MEMBER because it hides MEMBER2
+// cs0108.cs: `Derived.F()' hides inherited member `Base.F()'. Use the new keyword if hiding was intended
// Line:
// Compiler options: -warnaserror -warn:2
-// cs0109.cs: The member 'BaseClass.Location' does not hide an inherited member. The new keyword is not required
+// cs0109-2.cs: The member `BaseClass.Location' does not hide an inherited member. The new keyword is not required
// Line: 6
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'BaseClass.Location' does not hide an inherited member. The new keyword is not required
+// cs0109-3.cs: The member `BaseClass.Val' does not hide an inherited member. The new keyword is not required
// Line: 6
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'Derived.this[string]' does not hide an inherited member. The new keyword is not required
+// cs0109-4.cs: The member `Derived.this[string]' does not hide an inherited member. The new keyword is not required
// Line: 10
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'Derived.Test()' does not hide an inherited member. The new keyword is not required
+// cs0109.cs: The member `Derived.Test()' does not hide an inherited member. The new keyword is not required
// Line: 10
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'Outer.Inner' does not hide an inherited member. The new keyword is not required.
+// cs0109.cs: The member `Outer.Inner' does not hide an inherited member. The new keyword is not required
// Line: 7
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'Test.this[int]' does not hide an inherited member. The new keyword is not required
+// cs0109-7.cs: The member `Test.this[string]' does not hide an inherited member. The new keyword is not required
// Line: 9
// Compiler options: -warnaserror -warn:4
-// cs0109.cs: The member 'BaseClass.Location' does not hide an inherited member. The new keyword is not required
+// cs0109.cs: The member `BaseClass.Location' does not hide an inherited member. The new keyword is not required
// Line: 6
// Compiler options: -warnaserror -warn:4
+// cs0110.cs: The evaluation of the constant value for 'A.B.C.X' involves a circular definition
+// Line: 9
+
class A {
int a;
-// cs0111.cs: Class 'SampleClass' already defines a member called 'get_Value' with the same parameter types
+// cs0111-10.cs: Type `Test' already defines a member called `get_Value' with the same parameter types
// Line: 7
public class Test
-// cs111.cs : Class `Blah' already contains a definition with the same return value and parameter types for method 'I.M'
+// cs0111-11.cs: Type `Blah' already defines a member called `I.M' with the same parameter types
// Line : 12
public interface I
-// cs111.cs : Class 'Test' already defines a member called 'get_Value' with the same parameter types
+// cs0111-12.cs: Type `Test' already defines a member called `get_Value' with the same parameter types
// Line : 6
public class Test
-// cs111.cs : Class 'Test' already defines a member called 'set_Item' with the same parameter types
+// cs0111-14.cs: Type `Test' already defines a member called `set_Item' with the same parameter types
// Line : 6
public class Test
-// cs0111.cs: Class 'ISample' already defines a member called 'set_Item' with the same parameter types
+// cs0111-2.cs: Type `ISample' already defines a member called `set_Item' with the same parameter types
// Line: 6
public interface ISample {
-// cs0111.cs: Class 'Class' already defines a member called 'op_Implicit' with the same parameter types
+// cs0111-3.cs: Type `Class' already defines a member called `op_Implicit' with the same parameter types
// Line: 9
public class Class {
-// cs0111.cs: Class 'ErrorClass' already defines a member called 'get_Blah' with the same parameter types
+// cs0111-4.cs: Type `ErrorClass' already defines a member called `get_Blah' with the same parameter types
// Line: 8
using System.Runtime.CompilerServices;
-// cs0111.cs: Class 'ISample' already defines a member called 'Blah' with the same parameter types
+// cs0111-5.cs: Type `ISample' already defines a member called `Blah' with the same parameter types
// Line: 6
public interface ISample {
-// cs111-6.cs : Class `T' already contains a definition with the same return value and parameter types for method `Foo'
+// cs0111-6.cs: Type `T' already defines a member called `T' with the same parameter types
// Line : 6
class T {
-// cs111-7.cs : Class `T' already contains a definition with the same return value and parameter types for method `Foo'
+// cs0111-7.cs: Type `T' already defines a member called `T' with the same parameter types
// Line : 6
class T {
-// cs0111.cs: Class 'C' already defines a member called 'this' with the same parameter types
+// cs0111-9.cs: Type `C' already defines a member called `this' with the same parameter types
// Line: 6
class C
-// cs111.cs : Class `Blah' already contains a definition with the same return value and parameter types for method `Foo'
+// cs0111.cs: Type `Blah' already defines a member called `Foo' with the same parameter types
// Line : 10
public class Blah {
-// cs0112.cs: A static method can not be marked as virtual, abstract or override.
+// cs0112.cs: A static member `X.Bar.Add(int, int)' cannot be marked as override, virtual or abstract
// Line: 13
namespace X
+// cs0113.cs: A member 'X.Y()' marked as override cannot be marked as new or virtual
+// Line: 8
+
class X {
public virtual override void Y () {}
}
-// cs0114.cs: Y.XX hides inherited member X.XX. Must use `override' or `new' keyword
+// cs0114.cs: `Y.XX()' hides inherited member `X.XX()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
// Line: 8
// Compiler options: -warnaserror -warn:2
-// cs0115.cs: 'X.this[int]': no suitable method found to override
+// cs0115.cs: `X.this[int]': no suitable method found to override
// Line: 5
class X {
-// cs0115:'MyTestExtended.GetName()': no suitable methods found to override
+// cs0115-3.cs: `MyTestExtended.GetName()': no suitable method found to override
// Line: 12
// Compiler options: -r:CS0534-4-lib.dll
-// cs0115.cs: 'X.Bla()': no suitable method found to override
+// cs0115.cs: `X.Bla()': no suitable method found to override
// Line: 9
class X {
-// cs0116.cs: A namespace cant have members that dont correspond to a class, delegate, interface, union, struct or enum.
+// cs0116.cs: A namespace can only contain types and namespace declarations
// Line: 6
namespace Bar
-// CS0117: `A' does not contain a definition for `Foo'.
+// cs0117-2.cs: `A' does not contain a definition for `Foo'
// Line: 15
using System;
using System.Runtime.CompilerServices;
-// CS0117: `A' does not contain a definition for `Foo'.
+// cs0117-3.cs: `A' does not contain a definition for `Foo'
// Line: 16
using System;
using System.Runtime.CompilerServices;
-// cs0117: `int' does not contain a definition for 'E'.
+// cs0117.cs: `int' does not contain a definition for `E'
// Line: 7
class T {
-// cs0119: Expression denotes a 'method group', where a 'variable', 'value' or 'type' was expected
+// cs0119-2.cs: `App.SomeEnum()' is a `method', which is not valid in the given context\r
// Line: 9
public class App {
+// cs0120-2.cs: An object reference is required for the nonstatic field, method, or property `Test.Add8(int)'
+// Line: 12
+
using System;
using System.Threading;
using System.Reflection;
-// cs0120: `An object reference is required for the nonstatic field, method or property test.method()
+// cs0120-3.cs: An object reference is required for the nonstatic field, method, or property `X.method()'
// Line: 11
class X {
+// cs0120-4.cs: An object reference is required for the nonstatic field, method, or property `X.Y'
+// Line: 11
+
using System;
class X {
-// cs0120.cs: error CS0120: An object reference is required for the non-static field `Account'
+// cs0120-5.cs: An object reference is required for the nonstatic field, method, or property `Babble.Protocol.Auth.Account.get'
// Line: 28
using System;
-// CS0120: An object reference is required for the non-static field `Int32'
+// cs0120-6.cs: An object reference is required for the nonstatic field, method, or property `MemRefMonoBug.Int32'
// Line: 11
using System;
-// CS0120: An object reference is required for the non-static field `String'
+// cs0120-7.cs: An object reference is required for the nonstatic field, method, or property `MemRefMonoBug.String'
// Line: 11
using System;
-// cs0120: Ie, a static method invoking a non-static method
-// `An object reference is required for the nonstatic field, method or property test.method()
+// cs0120.cs: An object reference is required for the nonstatic field, method, or property `test.method()'
// Line: 11
class test {
-// cs0121-2.cs: ambigous call selecting between `IFoo.DoIt ()' and `IBar.DoIt ()'
+// cs0121-2.cs: The call is ambiguous between the following methods or properties: `IFoo.DoIt()' and `IBar.DoIt()'
// Line: 9
class A : IFooBar {
-// cs0121.cs: Ambiguous call when selecting function due to implicit casts
+// cs0121-4.cs: The call is ambiguous between the following methods or properties: `X.Add(float, float, float)' and `X.Add(params decimal[])'
// Line: 7
class X {
-// cs0121.cs: ambigous call when selecting function due to implicit casts
+// cs0121.cs: The call is ambiguous between the following methods or properties: `X.a(int, double)' and `X.a(double, int)'
// Line: 15
class X {
-// cs0122-13.cs: 'Wrapper.Test.foo' is inaccessible due to its protection level
+// cs0122-13.cs: `Test.foo' is inaccessible due to its protection level\r
// Line: 10
internal class Test
-// cs0122.cs: prop is not accessible due to its protection level
+// cs0122-2.cs: `A.prop' is inaccessible due to its protection level
// Line: 19
// Compiler options: -t:library
+// cs0122.cs: 'A.B' is inaccessible due to its protection level
+// Line: 11
+
interface r {
A.B aaa ();
}
-// cs0122: `Foo.Bar' is inaccessible due to its protection level
+// cs0122-5.cs: `Test.Foo.Bar' is inaccessible due to its protection level
public class Test
{
-// cs0122: `Foo.IBar' is inaccessible due to its protection level
+// cs0122-6.cs: `Test.Foo.IBar' is inaccessible due to its protection level
public class Test
{
+// cs0122-9.cs: `X.a' is inaccessible due to its protection level
+// Line: 11
+
public class X {
private int a {
get {
-// cs0122.cs: y.x is inaccessible due to its protection level
+// cs0122.cs: `Y.x()' is inaccessible due to its protection level
// Line: 15
using System;
-// cs0126: an object of type `int' is expected in the return statement
+// cs0126.cs: An object of a type convertible to `int' is required
// Line: 7
class X {
-// cs0127.cs: Since 'X.fn' returns void, a return keyword must not be followed by an object expression
+// cs0127.cs: Since `X.fn()' returns void, a return keyword must not be followed by an object expression
// Line: 6
class X {
void fn ()
-// cs0128: a local variable named `x' is already defined in this scope
+// cs0128.cs: A local variable named `x' is already defined in this scope
// Line:
class x {
-// cs0131.cs: The left-hand side of an assignment or mutating operation must be a variable, property or indexer
+// cs0131-3.cs: The left-hand side of an assignment must be a variable, property or indexer
// Line: 12
using System;
-// cs0131.cs: left hand side of an assignment must be variable, property access or indexer
+// cs0131.cs: The left-hand side of an assignment must be a variable, property or indexer
// Line:
class X {
void A ()
-// cs0132.cs: A static parameter must not have any parameters
+// cs0132.cs: `X.X(int)': a static constructor must be parameterless
// Line: 4
class X {
static X (int x)
-// cs0133.cs: the expression being assigned to `x' must be constant
+// cs0133.cs: The expression being assigned to `x' must be constant
// Line: 6
class X {
X (int arg)
-// cs0136.cs: local variable j can not be declared, because there is something with that name already
+// cs0136-2.cs: A local variable named `j' cannot be declared in this scope because it would give a different meaning to `j', which is already used in a `parent or current' scope to denote something else
// Line: 5
class X {
public static void Bar (int j, params int [] args)
-// cs0136: 'y' has a different meaning later in the block
+// cs0136-3.cs: A local variable named `y' cannot be declared in this scope because it would give a different meaning to `y', which is already used in a `parent or current' scope to denote something else
// Line: 8
class X
-// cs0136: 'y' has a different meaning later in the block
+// cs0136-4.cs: A local variable named `y' cannot be declared in this scope because it would give a different meaning to `y', which is already used in a `parent or current' scope to denote something else
// Line: 8
class X
-// cs0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i'
+// cs0136-5.cs: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `child' scope to denote something else
// Line: 9
class X {
void b ()
-// cs0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i'
+// cs0136.cs: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `parent or current' scope to denote something else
// Line: 8
class X {
void b ()
-// cs0138.cs: Using keyword only let you specify a namespace,
-// Console is a class not a namespace.
+// cs0138.cs: A using namespace directive can only be applied to namespaces; `System.Console' is a type not a namespace
// Line: 5
using System;
-// cs0139.cs: No loop to exit to in continue or break.
+// cs0139.cs: No enclosing loop out of which to break or continue
// Line: 6
class X {
void A ()
-// cs0140: A duplicated Label.
+// cs0140.cs: The label `L1' is a duplicate
// Line: 11
namespace cs0140Test
-// cs0144.cs: can not create instances of abstract classes or interfaces
+// cs0144-2.cs: Cannot create an instance of the abstract class or interface `X'
// Line: 11
interface X {
void A ();
-// cs0144.cs: can not create instances of abstract classes or interfaces
+// cs0144.cs: Cannot create an instance of the abstract class or interface `X'
// Line: 11
abstract class X {
public abstract void B ();
-// cs0150.cs :
+// cs0150.cs: A constant value is expected
// Line :
using System;
+// cs0151-2.cs: A value of an integral type expected
+// Line: 12
+
class Y {
byte b;
-// cs0151.cs: An integral value expected
+// cs0151.cs: A value of an integral type expected
// Line: 12
class Y {
byte b;
-// cs0152.cs: The label `case X:' already occurs in this switch statement
+// cs0152.cs: The label `case 1:' already occurs in this switch statement
// Line: 9
class X {
void f (int i)
-// cs0153.cs: goto default only allowed in switch statement
+// cs0153.cs: A goto case is only valid inside a switch statement
// Line:
class X {
void Main ()
-// cs0154-2.cs: error CS0154: The property or indexer 'B.Foo' cannot be used in this context because it lacks the get accessor
+// cs0154-2.cs: The property or indexer `B.Foo' cannot be used in this context because it lacks the get accessor
// Line: 13
// this is bug 55780.
-// cs0154.cs: The property 'name' can not be used in this context because
-// it lacks a get accessor.
+// cs0154.cs: The property or indexer `A.name' cannot be used in this context because it lacks the get accessor
// Line: 21
public class A
-// CS0156: A throw statement with no argument is only allowed in a catch clause
+// cs0156.cs: A throw statement with no arguments is not allowed outside of a catch clause
// Line: 12
using System;
-// cs0157-2.cs: Control can not leave the body of a finally clause
+// cs0157-2.cs: Control cannot leave the body of a finally clause
// Line: 11
class T {
-// cs0157-3.cs: Control can not leave the body of a finally clause
+// cs0157-3.cs: Control cannot leave the body of a finally clause
// Line: 11
class T {
-// cs0157-4.cs: Control can not leave the body of a finally clause
+// cs0157-4.cs: Control cannot leave the body of a finally clause
// Line: 11
class T {
-// cs0157-5.cs: Control can not leave the body of a finally clause
+// cs0157-5.cs: Control cannot leave the body of a finally clause
// Line: 12
class T {
-// cs0157.cs: Control can not leave the body of a finally clause
+// cs0157.cs: Control cannot leave the body of a finally clause
// Line: 9
class X {
-// cs0159-2.cs: No such case 20
+// cs0159-2.cs: No such label `case 20:' within the scope of the goto statement
class y {
enum X { A = 1, B = 1, C = 1 }
-// cs0159.cs: No default target for goto default
+// cs0159.cs: No such label `default:' within the scope of the goto statement
// Line:
class X {
-// CS0161: Not all code paths return a value
+// cs0161-2.cs: `Test.Main()': not all code paths return a value
// Line: 4
class Test {
static int Main () {
-// CS0161: Not all code paths return a value
+// cs0161.cs: `A.Main()': not all code paths return a value
// Line:
class A
-// cs0163.cs: Control cannot fall through from one case label to another
+// cs0163.cs: Control cannot fall through from one case label (`case 3:') to another
// Line: 17
+// cs0165.cs: Use of unassigned local variable `x'
+// Line: 16
+
class T {
void fun (ref int a)
{
-// cs0165.cs: Use of unassigned local variable
+// cs0165-4.cs: Use of unassigned local variable `a'
// Line: 9
class C {
-// cs0165.cs: Use of unassigned local variable
+// cs0165-5.cs: Use of unassigned local variable `a'
// Line: 9
using System;
-// CS0165: Use of unassigned local variable `x'
+// cs0165-6.cs: Use of unassigned local variable `service'\r
// Line: 17
using System;
-// CS0165: Use of unassigned local variable `x'
+// cs0165-7.cs: Use of unassigned local variable `service'\r
// Line: 16
using System;
-// CS0165: Use of unassigned local variable `x'
+// cs0165-8.cs: Use of unassigned local variable `service'\r
// Line: 17
using System;
+// cs0165.cs: Use of unassigned local variable `s'\r
+// Line: 16\r
+\r
using System;
public class Test
-// cs0165.cs: Use of unassigned local variable
+// cs0165.cs: Use of unassigned local variable `errors'
// Line: 9
class T {
-// cs0169.cs: warning, private field `prv' is never used
+// cs0169.cs: The private field `X.x' is never used
// Line: 4
// Compiler options: -warnaserror -warn:4
-// cs0171.cs: field x must be initialized before constructor X ends.
+// cs0171.cs: Field `X.x' must be fully assigned before control leaves the constructor
// Line:
struct X {
public readonly int x;
+// cs0172.cs: Can not compute type of conditional expression as `X' and `Y' convert implicitly to each other
+// Line: 25
+
class X {
public static implicit operator X (Y y)
{
-// cs0175.cs: Use of keyword base is not valid in this context
+// cs0175-2.cs: Use of keyword `base' is not valid in this context
// Line: 13
class DerivedClass {
-// cs0175: wrong context for use of `base' keyword
+// cs0175.cs: Use of keyword `base' is not valid in this context
// Line: 8
using System.Collections;
class Collection : CollectionBase
-// CS0176: Static member `Start' cannot be accessed with an instance reference, qualify with a type name instead
+// cs0176-2.cs: Static member `MyClass.Start(string)' cannot be accessed with an instance reference; qualify it with a type name instead
// Line: 10
using System;
-// CS0176: cant access static field via instance reference. qualify w/ type name -- #59324
+// cs0176-3.cs: Static member `A.X' cannot be accessed with an instance reference; qualify it with a type name instead
// Line: 12
using System;
-// cs0176.cs: cannot be accessed with an instance reference, use typename instead
+// cs0176.cs: Static member `X.void_method()' cannot be accessed with an instance reference; qualify it with a type name instead
// Line: 15
class X {
public static void void_method ()
-// cs0177.cs: The out parameter 'display' must be assigned to before control leaves the current method
+// cs0177-2.cs: The out parameter `f' must be assigned to before control leaves the current method
// Line: 5
class ClassMain {
-// cs0178.cs :
+// cs0178.cs: Invalid rank specifier: expected `,' or `]'
// Line :
using System;
-// cs0179.cs: member can not be declared extern and have a body
+// cs0179.cs: `X.extern_method()' cannot be extern and declare a body
// Line:
class X {
-// cs0179.cs: member can not be declared extern and abstract
+// cs0180.cs: `X.extern_method()' cannot be both extern and abstract
// Line:
class X {
-// cs0183.cs: the expression is always of the type `x'
+// cs0183.cs: The given expression is always of the provided (`int') type
// Line:
// Compiler options: -warnaserror -warn:1
-// cs0184.cs: The expression is never of the provided type
+// cs0184.cs: The given expression is never of the provided (`byte') type
// Line:
// Compiler options: -warnaserror -warn:1
-// cs0185.cs: object is not a reference type (as expected by lock)
+// cs0185.cs: `int' is not a reference type as required by the lock statement
// Line:
class X {
+// cs0187.cs: No such operator '++' defined for type 'X'
+// Line: 9
+
class X {
static void Main ()
{
-// cs0188.cs: The this object cannot be used before all of its fields are assigned to
+// cs0188-2.cs: The `this' object cannot be used before all of its fields are assigned to
// Line: 10
struct B
-// cs0188.cs: The this object cannot be used before all of its fields are assigned to
+// cs0188.cs: The `this' object cannot be used before all of its fields are assigned to
// Line: 6
struct Sample {
-// cs0191: can not assign to readonly variable outside constructor
+// cs0191.cs: A readonly field cannot be assigned to (except in a constructor or a variable initializer)
// Line: 8
class X {
readonly int a;
-// cs0192.cs: You cannot pass a readonly field by ref or out (except in a constructor)
+// cs0192.cs: A readonly field cannot be passed ref or out (except in a constructor)
// Line: 17
using System;
-// cs0193.cs: * or -> operator can only be applied to pointer types.
+// cs0193.cs: The * or -> operator must be applied to a pointer
// Line: 9
// Compiler options: -unsafe
-// cs0196.cs: pointers must be indexed by a single value
+// cs0196.cs: A pointer must be indexed by only one value
// line: 10
// Compiler options: -unsafe
using System;
-// cs0198: can not assign to static readonly variable outside static constructor
+// cs0198.cs: A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)
// Line: 8
class X {
static readonly int a;
-// cs0200: can not assign to property X.P -- it is readonly
+// cs0200.cs: Property or indexer `X.P' cannot be assigned to (it is read only)
// line: 12
class X {
static int P {
-//
-// cs0201.cs: if a meaningless statement is encountered error cs0201 have to be thrown
-//
+// cs0201.cs: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
+// Line: 11
using System;
+// cs0205-2.cs: Cannot call an abstract base member: `A.Foobar'
+// Line: 15
+
using System;
public abstract class A
-// cs0205: can not call abstract base method
+// cs0205.cs: Cannot call an abstract base member: `A.Foobar()'
//
using System;
-// cs0206.cs: indexers or properties can not be used as ref or out arguments
+// cs0206.cs: A property or indexer may not be passed as an out or ref parameter
// Line:
class X {
static int P { get { return 1; } set { } }
-// cs0208.cs: Cannot take the address or size of a variable of a managed type ('cs208.Foo')
+// cs0208-2.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`cs208.Foo')
// Line: 20
// Compiler options: -unsafe
-// cs0202.cs: The call to GetEnumerator must return a class or a struct, not 'Foo.P*'
+// cs0208-3.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`Foo.P')
// Line: 18
// Compiler options: -unsafe
-// cs0208-4.cs: Cannot declare a pointer to a managed type ('System.Object')
+// cs0208-4.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`object')
// Line: 11
// Compiler options: -unsafe
-// cs0208-5.cs: Cannot declare a pointer to a managed type ('X')
+// cs0208-5.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`X')
// Line: 8
// Compiler options: -unsafe
-// cs0208-6.cs: Cannot take the address of a managed type ('X')
+// cs0208-6.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`X')
// Line: 8
// Compiler options: -unsafe
-// cs0208: cannot declare a pointer to a managed type ('foo')
+// cs0208-7.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`foo')
// Line: 11
// Compiler options: -unsafe
-// cs0208: _Port is not an unmanaged type.
+// cs0208-8.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`_Port')
// Line: 16
// Compiler options: -unsafe
-// cs0208-9.cs: Cannot declare a pointer to a managed type ('Foo')
+// cs0208-9.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`Foo')\r
// Line: 7
// Compiler options: -t:library -unsafe
-// cs0208.cs: Cannot take the address or size of a variable of a managed type ('cs208.Foo')
+// cs0208.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type (`cs208.Foo')
// Line: 20
// Compiler options: -unsafe
-// cs0209.cs: variable in a fixed statement must be a pointer
+// cs0209.cs: The type of locals declared in a fixed statement must be a pointer type
// Line: 9
// Compiler options: -unsafe
-// cs0212: You can only take the address of an unfixed expression inside a fixed statement initializer.
+// cs0212.cs: You can only take the address of unfixed expression inside of a fixed statement initializer
// Line: 19
// Compiler options: -unsafe
-// cs0213.cs: You do not need to use the fixed statement to take the address of an already fixed expression
+// cs0213.cs: You cannot use the fixed statement to take the address of an already fixed expression
// Line: 12
// Compiler options: -unsafe
-// cs0214: pointers can only be used in an unsafe context
+// cs0214-2.cs: Pointers and fixed size buffers may only be used in an unsafe context
// Line: 9
// Compiler options: -unsafe
-// cs0214: Pointer can only be used in unsafe context
+// cs0214-3.cs: Pointers and fixed size buffers may only be used in an unsafe context
// Line: 13
// Compiler options: -unsafe
-// cs0214: Pointer can only be used in unsafe context
+// cs0214-4.cs: Pointers and fixed size buffers may only be used in an unsafe context
// Line: 8
// Compiler options: -unsafe
-// cs0214: Pointer can only be used in unsafe context
+// cs0214-5.cs: Pointers and fixed size buffers may only be used in an unsafe context
// Line: 16
// Compiler options: -unsafe
+// cs0214.cs: Pointers may only be used in an unsafe context
+// Line: 12
+
using System;
namespace ConsoleApplication1
-// cs0214: Pointer can only be used in unsafe context
+// cs0214.cs: Pointers and fixed size buffers may only be used in an unsafe context
// Line: 6
// Compiler options: -unsafe
-// cs0216: Missmatch of operators (true/false)
+// cs0216-2.cs: The operator `X.operator true(X)' requires a matching operator `false' to also be defined
// Line: 4
class X {
public static bool operator true (X i)
-// cs0216.cs: If you define operator <, you also need to define >
+// cs0216.cs: The operator `X.operator <(X, int)' requires a matching operator `>' to also be defined
// Line:
class X {
public static X operator < (X a, int b)
-// cs0219.cs: The variable 'p' is declared but its value is never used
+// cs0219.cs: The variable `p' is assigned but its value is never used
// Line: 9
// Compiler options: -warn:3 -warnaserror
-// cs0221.cs: cannot convert constant value to type, use in checked context
+// cs0221.cs: Constant value `4294967295' cannot be converted to a `int' (use `unchecked' syntax to override)
// Line: 5
class X {
-//
-// cs0225.cs: params parameter have to be a single dimensional array.
-//
+// cs0225.cs: The params parameter must be a single dimensional array
+// Line: 6
public class X
{
-// cs0231.cs: A params parameter must be the last in a formal parameter list
+// cs0231.cs: A params parameter must be the last parameter in a formal parameter list
// Line: 5
class Test
{
-// error CS0234: The type or namespace name `Enum' could not be found in namespace `A.B.System'
+// cs0234-2.cs: The type or namespace name `Enum' does not exist in the namespace `A.B.System' (are you missing an assembly reference?)
// Line: 8
using System;
-// error CS0234: The type or namespace name `Type' could not be found in namespace `MonoTests.System'
+// cs0234-3.cs: The type or namespace name `Type' does not exist in the namespace `MonoTests.System' (are you missing an assembly reference?)
// Line: 12
using System;
-//cs0236: A field initializer cannot reference the non-static field, method or property `X.Foo'.
+// cs0236.cs: A field initializer cannot reference the nonstatic field, method, or property `X.Foo.get'
class X
{
-// cs0239.cs : `X.MyMethod' : cannot override inherited member `Bar.MyMethod' because it is sealed.
+// cs0239.cs: `X.MyMethod()': cannot override inherited member `Bar.MyMethod()' because it is sealed
// Line : 25
using System;
-// cs0242: operation is not defined for void *
+// cs0242.cs: The operation in question is undefined on void pointers
// Line: 10
// Compiler options: -unsafe
using System;
-//cs0243: NonExistant does not exist in this namespace
+// cs0246-10.cs: The type or namespace name `Nonexistant' could not be found (are you missing a using directive or an assembly reference?)
using System;
using Nonexistant;
-// cs0246-6.cs: The type or namespace name 'XmlDocument' could not be found
+// cs0246-6.cs: The type or namespace name `XmlDocument' could not be found (are you missing a using directive or an assembly reference?)
// Line: 7
// This is bug 55770
-// CS0246: Cannot find type `Reflection.ConstructorInfo'
+// cs0246-8.cs: The type or namespace name `Reflection' could not be found (are you missing a using directive or an assembly reference?)
// Line: 7
using System;
-// error CS0246: Cannot find type 'foo'
+// cs0246-9.cs: The type or namespace name `foo' could not be found (are you missing a using directive or an assembly reference?)
// This is from bug #70758
struct bar {
foo foo;
-// cs0246.cs: can not find type `B'
+// cs0246.cs: The type or namespace name `B' could not be found (are you missing a using directive or an assembly reference?)
// Line: 4
interface A : B {
}
-// CS0260: Missing partial modifier on declaration of type `Foo'; another partial implementation of this type exists
+// cs0260-2.cs: Missing partial modifier on declaration of type `Foo'; another partial declaration of this type exists
// Line: 6
public partial class Foo
{ }
-// CS0260: Missing partial modifier on declaration of type `Foo'; another partial implementation of this type exists
+// cs0260.cs: Missing partial modifier on declaration of type `Foo'; another partial declaration of this type exists
// Line: 3
public class Foo
{ }
+// cs0267.cs: The partial modifier can only appear immediately before `class', `struct' or `interface'
+// Line: 4
+
partial enum e {}
-// cs0273.cs: Accessibility modifier must be more restrictive than the property access
+// cs0273.cs: The accessibility modifier of the `Error0273.Message.get' accessor must be more restrictive than the property or indexer `Error0273.Message'
// Line: 8
// Compiler options: -t:library
-// cs0274.cs: Accessibility modifiers for both accesors is not allowed
+// cs0274.cs: Cannot specify accessibility modifiers for both accessors of the property or indexer `Error0274.Message'
// Line: 7
// Compiler options: -t:library
-// cs0275.cs(9) error CS0275: Accessibility modifiers can not be used on accessors in interfaces
+// cs0275.cs: `Error0275.Message.get': accessibility modifiers may not be used on accessors in an interface
// Line: 7
public interface Error0275
-// cs0276.cs: Accessibility modifiers can only be used if both get and set accessors exist
+// cs0276.cs: `Error0276.Message': accessibility modifiers on accessors may only be used if the property or indexer has both a get and a set accessor
// Line: 7
// Compiler options: -t:library
+// cs0419.cs: Ambiguous reference in cref attribute: 'System.String.Replace'. Assuming 'string.Replace(char, char)', but could have also matched other overloads including 'string.Replace(string, string)'.
+// Line: 1
// Compiler options: -doc:dummy.xml -warn:3 -warnaserror
/// <summary>
/// Exposes <see cref="System.String.Replace"/> to XSLT
--- /dev/null
+// cs0420.cs: 'XX.j': a reference to a volatile field will not be treated as volatile
+// Line: 14
+// Compiler options: -unsafe /warnaserror
+
+unsafe class XX {
+ static volatile int j;
+
+ static void X (ref int a)
+ {
+ }
+
+ static void Main ()
+ {
+ X (ref j);
+ }
+}
--- /dev/null
+// cs0420.cs: 'X.j': a reference to a volatile field will not be treated as volatile
+// Line: 10
+// Compiler options: -unsafe /warnaserror
+
+unsafe class X {
+ static volatile int j;
+
+ static void Main ()
+ {
+ fixed (int *p = &j){
+
+ }
+ }
+}
+// cs0500.cs: `X.B()' cannot declare a body because is marked abstract
+// Line: 5
+
abstract class X {
public abstract void B () {
}
-// cs0503.cs: The abstract method `Class.X' cannot be marked virtual
+// cs0503.cs: The abstract method `Class.X()' cannot be marked virtual
// Line: 4
abstract class Class {
virtual abstract public void X ();
-//using System;
+// cs0519.cs: `System' clashes with a predefined namespace
+// Line: 1
enum System { A }
+// cs0535.cs: 'Stack' does not implement interface member 'IStack.Insert(int, object)'
+// Line: 11
using System;
-//
-// cs0594: Floating-point constant is outside the range for type 'decimal|double|float'
+// cs0594.cs: Floating-point constant is outside the range of the type 'decimal'
+// Line: 6
class X {
public static void Main() {
-//
-// cs0594: Floating-point constant is outside the range for type 'decimal|double|float'
+// cs0594.cs: Floating-point constant is outside the range of the type 'double'
+// Line: 6
class X {
public static void Main() {
-//
-// cs0594: Floating-point constant is outside the range for type 'decimal|double|float'
+// cs0594.cs: Floating-point constant is outside the range of the type 'double'
+// Line: 6
class X {
public static void Main() {
+// cs0612-2.cs: Cannot find type 'Foo'
+// Line: 8
// Compiler options: -r:CS0612-2-lib.dll -warnaserror
public class Bar {
+// cs0647.cs: Error emitting 'DllImport' attribute because 'dllName
+// Line: 8
+
using System.Runtime.InteropServices;
using System;
+// cs0647.cs: Error emitting 'DllImport' attribute because 'Argument cannot be null.
+// Line: 8
+
using System.Runtime.InteropServices;
using System;
+// cs0670.cs: void type is not allowed for fields
+// Line: 5
+
class X {
void j;
+++ /dev/null
-// Compiler options: -unsafe
-
-unsafe class XX {
- static volatile int j;
-
- static void X (ref int a)
- {
- }
-
- static void Main ()
- {
- X (ref j);
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-unsafe class X {
- static volatile int j;
-
- static void Main ()
- {
- fixed (int *p = &j){
-
- }
- }
-}
+// cs0678.cs: A field can not be both volatile and readonly
+// Line: 5
+
class X {
readonly volatile int j;
-// cs0710.cs: 'StaticClass': Static classes cannot have instance constructors
+// cs0710.cs: Static classes cannot have instance constructors
// Line: 5
static class StaticClass {
-// cs0711.cs: 'StaticClass': Static classes cannot contain destructors
+// cs0711.cs: Static classes cannot contain destructors
// Line: 5
static class StaticClass {
-// CS0742: A throw statement with no argument is only allowed in a catch clause nested inside of the innermost catch clause
+// cs0724.cs: A throw statement with no arguments is not allowed inside of a finally clause nested inside of the innermost catch clause
// Line: 14
class C
+// cs1018.cs: Keyword this or base expected
+// Line: 5
+
class X {
X () : {
}
-//
-// cs1021: Integral constant is too large
+// cs1021.cs: Integral constant is too large
+// Line: 6
class X {
public static void Main() {
-//
-// cs1021: Integral constant is too large
+// cs1021.cs: Integral constant is too large
+// Line: 6
class X {
public static void Main() {
-// warning CS1041: Identifier expected, 'true' is a keyword
-// warning CS1041: Identifier expected, 'catch' is a keyword
-// Compiler options: -warnaserror -doc:dummy.xml
+// cs1041.cs: Identifier expected, 'int' is a keyword
+// Line: 5
-/// <summary><see cref="true" />, <see cref="catch" /></summary>
-public enum Test {
- /// <summary>Maybe</summary>
- @true,
-
- /// <summary>Maybe</summary>
- @catch
+public class Test {
+ void T (int int) {}
}
-
-class Foo { static void Main () {} }
+// cs1501.cs: New invocation: Can not find a constructor in `A' for this argument list
+// Line: 6
+
public class A {
A[] test = {
new A("test")
+// cs1501.cs: No overload for method `System.CLSCompliantAttribute' takes `0' arguments
+// Line: 6
+
using System;
[assembly:CLSCompliant()]
-//
-// cs1520: Class, struct or interface method must have a return type
-// Line: 9
+// cs1520.cs: Class, struct, or interface method must have a return type
+// Line: 8
class test {
+// cs1540.cs: Cannot access protected member `A.n' via a qualifier of type `B'; the qualifier must be of type `C' (or derived from it)
+// Line: 19
+
class A
{
protected int n;
+// cs1540.cs: Cannot access protected member `A.n' via a qualifier of type `A'; the qualifier must be of type `B' (or derived from it)
+// Line: 14
+
class A
{
protected void n () { }
+// cs1540.cs: Cannot access protected member `A.n' via a qualifier of type `B'; the qualifier must be of type `C.N' (or derived from it)
+// Line: 12
+
class A {
protected int n = 0;
}
+// cs1540.cs: Cannot access protected member `A.A' via a qualifier of type `A'; the qualifier must be of type `B' (or derived from it)
+// Line: 25
+
public class A {
public A ()
{
+// cs1540.cs: Cannot access protected member `A.n' via a qualifier of type `A'; the qualifier must be of type `B' (or derived from it)
+// Line: 14
+
class A
{
protected int n;
+// cs1570.cs: XML comment on 'F:Testing.Test.PrivateField2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 23
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'P:Testing.Test.PublicProperty2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 32
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.Test2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 22
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.StructTest2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.InterfaceTest2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.EnumTest2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 17
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.MyDelegate2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 17
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.Test2' has non-well-formed XML (a name did not start with a legal character 54 (6) Line 1, position 3.).
+// Line: 18
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'F:Testing.Test.Constant2' has non-well-formed XML (unmatched closing element: expected summary but found invalid Line 3, position 10.).
+// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'F:Testing.Test.PublicField2' has non-well-formed XML (unmatched closing element: expected summary but found invalid Line 3, position 10.).
+// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
+
using System;
namespace Testing
+// cs1570.cs: XML comment on 'T:Testing.Test2' has non-well-formed XML (unmatched closing element: expected summary but found incorrect Line 3, position 12.).
+// Line: 22
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
namespace Testing
+// cs1571.cs: XML comment on 'Bar' has a duplicate param tag for 'i'
+// Line: 18
// Compiler options: -doc:dummy.xml -warn:2 -warnaserror
+
namespace Testing
{
public class Test
+// cs1572.cs: XML comment on 'Baz' has a 'param' tag for 'mismatch', but there is no such parameter.
+// Line: 10
// Compiler options: -doc:dummy.xml -warn:2 -warnaserror
+
namespace Testing
{
public class Test
+// cs1573.cs: Parameter 'Baz' has no matching param tag in the XML comment for 'j' (but other parameters do)
+// Line: 10
// Compiler options: -doc:dummy.xml -warn:4 -warnaserror
+
namespace Testing
{
public class Test
+// cs1574.cs: XML comment on 'Test' has cref attribute 'Method(System.String)' that could not be resolved in 'Test'.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="Method(System.String)"/>
+// cs1574.cs: XML comment on 'Test' has cref attribute 'Test.Foo(int)' that could not be resolved in 'Test'.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="Test.Foo(int)"/> Test has Foo, but is property that has no args.
+// cs1574.cs: XML comment on 'Test' has cref attribute 'System.Xml.XmlDocument' that could not be resolved in 'Test'.
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -noconfig
+
using System;
/// <seealso cref="System.Xml.XmlDocument"/>
+// cs1574.cs: XML comment on 'Test' has cref attribute 'Goo' that could not be resolved in 'Test'.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="Goo"/> ... does not exist
+// cs1574.cs: XML comment on 'Test' has cref attribute 'MyDelegate(int)' that could not be resolved in 'Test'.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
/// <summary>
/// <see cref="MyDelegate(int)" />
/// </summary>
+// cs1574.cs: XML comment on 'Test' has cref attribute 'explicit operator int (bool)' that could not be resolved in 'Test'.
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="explicit operator int (bool)"/>
public class Test
+// cs1580.cs: Invalid type for parameter '1' in XML comment cref attribute 'Method(x,y)'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="Method(x,y)"/>
public class Test
+// cs1580.cs: Invalid type for parameter '1' in XML comment cref attribute 'Foo(x)'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="Foo(x)"/>
public class Test
+// cs1581.cs: Invalid return type in XML comment cref attribute 'explicit operator int (Test)'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="explicit operator int (Test)"/>
public class Test
+// cs1581.cs: Invalid return type in XML comment cref attribute 'explicit operator intp (Test)'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="explicit operator intp (Test)"/>
public class Test
+// cs1584.cs: XML comment on 'Test' has syntactically incorrect attribute ''
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="" />
+// cs1584.cs: XML comment on 'Test' has syntactically incorrect attribute '.'
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="." />
+// cs1584.cs: XML comment on 'Test' has syntactically incorrect attribute 'Mai()n'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <see cref="Mai()n" />
public class Test
+// cs1584.cs: XML comment on 'Test' has syntactically incorrect attribute 'operator foo(int,Test)'
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
+
using System;
/// <seealso cref="operator foo(int,Test)"/>
public class Test
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 10
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 15
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 15
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 13
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 13
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 6
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
/// invalid comment on global attributes.
[assembly:System.CLSCompliant (true)]
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 13
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 13
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 11
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 16
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 7
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
[Flags]
/// invalid comment between attributes and type declaration.
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
/// invalid comment placed on namespace.
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 10
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 8
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
/// invalid comment on using alias directive.
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 10
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 10
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
using System;
namespace TopNS
+// cs1587.cs: XML comment is placed on an invalid language element which can not accept it.
+// Line: 6
// Compiler options: -doc:dummy.xml -warnaserror -warn:2
+
/// invalid comment placed on namespace.
using System;
enum Foo {
+// cs1589.cs: Unable to include XML fragment '/root/@attr' of file cs1589.inc -- Cannot insert specified type of node as a child of this node..
+// Line: 15
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
namespace Testing
+// cs1590.cs: Invalid XML 'include' element; Missing 'path' attribute.
+// Line: 11
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// Invalid XML 'include' element; Missing 'path' attribute
namespace Testing
{
+// cs1590.cs: Invalid XML 'include' element; Missing 'file' attribute.
+// Line: 16
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// Invalid XML 'include' element; Missing 'file' attribute
namespace Testing
{
+// cs1590.cs: Invalid XML 'include' element; Missing 'file' attribute.
+// Line: 8
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1590: Invalid XML 'include' element; Missing 'file' attribute.
namespace Testing
{
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.Foo()'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.IFoo.Foo()'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.IFoo.Foo'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.this[ int]'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'bool operator !(Testing.Test)'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.Test()'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.Finalize()'
+// Line: 16
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.InternalClass'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.InternalStruct'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.InterfaceTest'
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Foo'
+// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Foo.Foo'
+// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.MyDelegate'
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.Constant'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.PublicField'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.PublicProperty'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.Test.MyEvent'
+// Line: 14
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1591.cs: Missing XML comment for publicly visible type or member 'Testing.TestClass'
+// Line: 9
// Compiler options: -doc:dummy.xml -warnaserror -warn:4
+
using System;
namespace Testing
+// cs1592.cs: Badly formed XML in included comments file -- 'there-is-no-such-file'
+// Line: 12
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// Badly formed XML in included comments file -- 'there-is-no-such-file'
namespace Testing
{
+// cs1612.cs: Cannot modify expression because it is not a variable.
+// Line: 9
+
using System;
class X {
static void Main ()
+// cs1612.cs: Cannot modify expression because it is not a variable.
+// Line: 9
+
using System;
class X {
static void Main ()
{
D d = delegate {
yield return this;
- return this;
};
}
}
+// cs1632.cs: Control cannot leave body of anonymous method
+// Line: 12
+
using System;
class X {
-// syntax error, got token `PROTECTED', expecting SET CLOSE_BRACE OPEN_BRACKET
+// cs1644.cs: Feature 'access modifiers on properties' cannot be used because it is not part of the standardized ISO C# language specification
// Line: 13
// Compiler options: -langversion:ISO-1
-// Feature 'fixed sized buffers' cannot be used because it is not part of the standardized ISO C# language specificatio
+// cs1644.cs: Feature 'fixed sized buffers' cannot be used because it is not part of the standardized ISO C# language specificatio
// Line: 6
// Compiler options: -langversion:ISO-1
+// cs1660.cs: Cannot convert anonymous method to `int', since it is not a delegate
+// Line: 9
+
using System;
class X {
+// cs1660.cs: Cannot convert anonymous method to `object', since it is not a delegate
+// Line: 9
+
using System;
class X {
+// cs1686.cs: Variable i is captured in an anonymous method and its address is also being taken: they are exclusive
+// Line: 16
// Compiler options: -unsafe
class X {
+// cs1722.cs: In Class `My.Namespace.MyBaseClass', `My.Namespace.MyInterfaceBase' is not an interface, a base class must be listed first
+// Line: 21
+
using System;
namespace My.Namespace {
-//
-// The type parameters introduce the names into the class namespace, so it is
-// not possible to have members with the same name as a parameter
-//
+// gcs0102.cs: The type 'X`1' already contains a definition for 'T'
+// Line: 11
-// First error.
class X <T> {
int T;
}
+// gcs0117.cs: `X' does not contain a definition for `Test'
+// Line: 12
+
class A<X>
{
//
+// gcs0208.cs: Cannot take the size of an unmanaged type (X`1)
+// Line: 12
// Compiler options: -unsafe
-// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('X<A>')
+
class X <Y> {
}
+// gcs0246.cs: Cannot find type 'List`2'
+// Line: 8
+
using System.Collections.Generic;
class X
+// gcs0246.cs: Cannot find type 'Stack'
+// Line: 9
+
class Stack<T>
{ }
+// gcs0246.cs: Cannot find type 'DateTime`1'
+// Line: 8
+
using System;
class X
+// gcs0246.cs: Cannot find type 'Stack`1'
+// Line: 9
+
class Stack
{ }
+// gcs0246.cs: Cannot find type 'NotExist`1'
+// Line: 6
+
class X
{
NotExist<float> foo;
+// gcs0309.cs: The type `U' must be convertible to `System.IComparable' in order to use it as parameter `T' in the generic type or method `A`1<T>'\r
+// Line: 13\r
+\r
using System;
class A<T>
+// gcs0401.cs: The new() constraint must be last.
+// Line: 6
+
class Foo<T>
where T : new (), new ()
{
+// gcs0405.cs: Duplicate constraint `I' for type parameter `T'.
+// Line: 8
+
interface I { }
class Foo<T>
+// gcs0406.cs: `B': the class constraint for `T' must come before any other constraints.
+// Line: 9
+
class A { }
class B { }
+// gcs0411.cs: The type arguments for method `Foo' cannot be infered from the usage. Try specifying the type arguments explicitly.
+// Line: 15
+
class Test<A>
{
public void Foo<V,W> (V v, V w)
+// gcs0411.cs: The type arguments for method `Foo' cannot be infered from the usage. Try specifying the type arguments explicitly.
+// Line: 15
+
class Test<A,B>
{
public void Foo<V,W> (Test<A,W> x, Test<V,B> y)
+// gcs0411.cs: The type arguments for method `T X.G ()' cannot be infered from the usage. Try specifying the type arguments explicitly.
+// Line: 17
+
using System;
delegate int E ();
+// gcs0411.cs: The type arguments for method `Foo' cannot be infered from the usage. Try specifying the type arguments explicitly.
+// Line: 15
+
class Test<A>
{
public void Foo<V> (V v, V w)
-//
-// Two type parameters might not have the same name
-//
+// gcs0692.cs: Duplicate type parameter `A'
+// Line: 4
+
class X <A,A> {
}
-//
-// The type parameters introduce the names into the class namespace, so it is
-// not possible to have members with the same name as a parameter
-//
-
-
-// type parameter is the same name as the class
+// gcs0694.cs: Type parameter 'Y' has same name as containing type, or method
+// Line: 4
class Y <Y> {
}
+// gcs0695.cs: `A<X,Y,Z>' cannot implement both `I`1<A`3<Y,Y,Z>>' and `I`1<X>' because they may unify for some type parameter substitutions
+// Line: 7
+
interface I<X>
{ }
+// gcs0695.cs: `C<X,Y>' cannot implement both `I`1<K`1<Y>>' and `I`1<X>' because they may unify for some type parameter substitutions
+// Line: 10
+
interface I<X>
{ }
+// gcs0695.cs: `C<X,Y>' cannot implement both `I`1<X>' and `I`1<K`1<Y>>' because they may unify for some type parameter substitutions
+// Line: 10
+
interface I<X>
{ }
+// gcs0695.cs: `A<X,Y>' cannot implement both `I`1<Y>' and `I`1<X>' because they may unify for some type parameter substitutions
+// Line: 7
+
interface I<X>
{ }
+// gcs0701.cs: `A' is not a valid bound. Bounds must be interfaces or non sealed classes
+// Line: 8
+
sealed class A { }
class Foo<T>
+// gcs0702.cs: Bound cannot be special class `System.Object'
+// Line: 8
+
using System;
class Foo<T>
+// gcs0702.cs: Bound cannot be special class `System.Array'
+// Line: 8
+
using System;
class Foo<T>
cs0266.cs
cs0266-2.cs NO ERROR
cs0266-3.cs
+cs0420.cs
+cs0420-2.cs
cs0428.cs
cs0525.cs
cs0526.cs
cs0647-15.cs NO ERROR # corlib bug 73143
cs0652.cs NO ERROR
cs1013.cs # new in GMCS; grammar issue
+cs1041.cs # new in GMCS; grammar issue
cs1501-5.cs
cs1513.cs
cs1518.cs
cs0266.cs
cs0266-2.cs NO ERROR
cs0266-3.cs
+cs0420.cs
+cs0420-2.cs
cs0428.cs
cs0525.cs
cs0526.cs
+2005-06-06 Marek Safar <marek.safar@seznam.cz>
+
+ * rootcontext.cs: Reset TargetExt as well.
+
+2005-06-09 Martin Baulig <martin@ximian.com>
+
+ * delegate.cs (Delegate.VerifyMethod): Added
+ `MethodGroupExpr old_mg' argument; inherit its
+ `HasTypeParameters'; fix #75085.
+
+2005-06-09 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Correctly handle
+ generic methods for the SetMemberIsUsed(); fix #75064.
+
+2005-06-09 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
+ fixes #75062.
+
+2005-06-08 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (nullable_type_or_conditional): If we put the
+ nullable back and our `type' is a `ComposedCast', remove the
+ nullable from it. Fixes #75156.
+
+ * expression.cs (ComposedCast.RemoveNullable): New public method.
+
+2005-06-08 Martin Baulig <martin@ximian.com>
+
+ The big Iterators rewrite :-)
+
+ * iterators.cs: Rewrite this to use the anonymous methods framework.
+
+ * rootcontext.cs (RootContext.DefineTypes): Define Delegates
+ before the TypeContainers; see 2test-21.cs.
+
+ * class.cs
+ (TypeContainer.DefineType): Don't create a new EmitContext if we
+ already have one (this only happens if we're an Iterator).
+ (TypeContainer.Define): Also call Define() on all our iterators.
+ (Method.CreateEmitContext): Added support for iterators.
+
+ * anonymous.cs
+ (AnonymousContainer): New abstract base class for `AnonymousMethod'.
+ (AnonymousContainer.CreateMethodHost): Moved here from
+ AnonymousMethod and made abstract.
+ (AnonymousContainer.CreateScopeType): New abstract method.
+ (AnonymousContainer.IsIterator): New public property.
+ (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
+ get the ScopeTypeBuilder rather than manually defining it here.
+ (ScopeInfo.EmitScopeInstance): New public method; correctly handle
+ iterators here.
+
+ * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
+ before RootContext.DefineTypes().
+
+ * codegen.cs (EmitContext.RemapToProxy): Removed.
+ (EmitContext.CurrentAnonymousMethod): Changed type from
+ AnonymousMethod -> AnonymousContainer.
+ (EmitContext.ResolveTopBlock): Protect from being called twice.
+ (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
+ (EmitContext.EmitThis): Removed the iterators hacks; use the
+ anonymous methods framework for that.
+
+ * statement.cs
+ (ToplevelBlock.Container): Make this a property, not a field.
+ (ToplevelBlock.ReParent): New public method; move the
+ ToplevelBlock into a new container.
+ (Foreach.TemporaryVariable): Simplify.
+
2005-06-05 Martin Baulig <martin@ximian.com>
* statement.cs (LocalInfo.CompilerGenerated): New flag.
namespace Mono.CSharp {
- public class AnonymousMethod : Expression {
+ public abstract class AnonymousContainer : Expression
+ {
// Used to generate unique method names.
- static int anonymous_method_count;
+ protected static int anonymous_method_count;
// An array list of AnonymousMethodParameter or null
public Parameters Parameters;
//
public Method method;
- MethodInfo invoke_mb;
+ protected MethodInfo invoke_mb;
// The emit context for the anonymous method
public EmitContext aec;
public InternalParameters amp;
public string[] TypeParameters;
public Type[] TypeArguments;
- bool unreachable;
+ protected bool unreachable;
//
// The modifiers applied to the method, we aggregate them
//
- int method_modifiers = Modifiers.PRIVATE;
+ protected int method_modifiers = Modifiers.PRIVATE;
//
// During the resolve stage of the anonymous method body,
//
// Points to our container anonymous method if its present
//
- public AnonymousMethod ContainerAnonymousMethod;
-
- public AnonymousMethod (Parameters parameters, ToplevelBlock container, ToplevelBlock block, Location l)
+ public AnonymousContainer ContainerAnonymousMethod;
+
+ protected AnonymousContainer (Parameters parameters, ToplevelBlock container,
+ ToplevelBlock block, Location l)
{
Parameters = parameters;
Block = block;
block.SetHaveAnonymousMethods (l, this);
}
+ protected AnonymousContainer (Parameters parameters, ToplevelBlock container,
+ Location l)
+ {
+ Parameters = parameters;
+ Block = new ToplevelBlock (container, Parameters, l);
+ loc = l;
+
+ //
+ // The order is important: this setups the CaptureContext tree hierarchy.
+ //
+ container.SetHaveAnonymousMethods (loc, this);
+ Block.SetHaveAnonymousMethods (loc, this);
+ }
+
public override Expression DoResolve (EmitContext ec)
{
//
return this;
}
+ protected abstract bool CreateMethodHost (EmitContext ec);
+
+ public abstract void CreateScopeType (EmitContext ec, ScopeInfo scope);
+
+ public abstract bool IsIterator {
+ get;
+ }
+ }
+
+ public class AnonymousMethod : AnonymousContainer
+ {
+ public AnonymousMethod (Parameters parameters, ToplevelBlock container,
+ ToplevelBlock block, Location l)
+ : base (parameters, container, block, l)
+ {
+ }
+
+ public override bool IsIterator {
+ get { return false; }
+ }
+
public override void Emit (EmitContext ec)
{
// nothing, as we only exist to not do anything.
//
// Creates the host for the anonymous method
//
- bool CreateMethodHost (EmitContext ec, Type return_type)
+ protected override bool CreateMethodHost (EmitContext ec)
{
//
// Crude hack follows: we replace the TypeBuilder during the
method = new Method (
(TypeContainer) ec.TypeContainer, generic_method,
- new TypeExpression (return_type, loc),
+ new TypeExpression (invoke_mb.ReturnType, loc),
method_modifiers, false, member_name,
Parameters, null, loc);
method.Block = Block;
public bool EmitMethod (EmitContext ec)
{
- if (!CreateMethodHost (ec, invoke_mb.ReturnType))
+ if (!CreateMethodHost (ec))
return false;
MethodBuilder builder = method.MethodData.MethodBuilder;
return true;
}
+ public override void CreateScopeType (EmitContext ec, ScopeInfo scope)
+ {
+ TypeBuilder container = ec.TypeContainer.TypeBuilder;
+ string name = String.Format ("<>AnonHelp<{0}>", scope.id);
+
+ scope.ScopeTypeBuilder = container.DefineNestedType (
+ name, TypeAttributes.AutoLayout | TypeAttributes.Class |
+ TypeAttributes.NestedAssembly, TypeManager.object_type, null);
+
+ Type [] constructor_types = TypeManager.NoTypes;
+ Parameters constructor_parameters = Parameters.EmptyReadOnlyParameters;
+ scope.ScopeConstructor = scope.ScopeTypeBuilder.DefineConstructor (
+ MethodAttributes.Public | MethodAttributes.HideBySig |
+ MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
+ CallingConventions.HasThis, constructor_types);
+ InternalParameters parameter_info = new InternalParameters (constructor_types, constructor_parameters);
+ TypeManager.RegisterMethod (scope.ScopeConstructor, parameter_info, constructor_types);
+
+ ILGenerator cig = scope.ScopeConstructor.GetILGenerator ();
+ cig.Emit (OpCodes.Ldarg_0);
+ cig.Emit (OpCodes.Call, TypeManager.object_ctor);
+ cig.Emit (OpCodes.Ret);
+ }
+
public static void Error_AddressOfCapturedVar (string name, Location loc)
{
Report.Error (1686, loc,
// Points to the object of type `ScopeTypeBuilder' that
// holds the data for the scope
//
- public LocalBuilder ScopeInstance;
-
+ LocalBuilder scope_instance;
public ScopeInfo (CaptureContext cc, Block b)
{
return String.Format ("<>AnonHelp<{0}>", id);
}
- public void EmitScopeConstructor ()
- {
- Type [] constructor_types = TypeManager.NoTypes;
- Parameters constructor_parameters = Parameters.EmptyReadOnlyParameters;
- ScopeConstructor = ScopeTypeBuilder.DefineConstructor (
- MethodAttributes.Public | MethodAttributes.HideBySig |
- MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
- CallingConventions.HasThis, constructor_types);
- InternalParameters parameter_info = new InternalParameters (constructor_types, constructor_parameters);
- TypeManager.RegisterMethod (ScopeConstructor, parameter_info, constructor_types);
-
- ILGenerator cig = ScopeConstructor.GetILGenerator ();
- cig.Emit (OpCodes.Ldarg_0);
- cig.Emit (OpCodes.Call, TypeManager.object_ctor);
- cig.Emit (OpCodes.Ret);
- }
-
public void EmitScopeType (EmitContext ec)
{
- //EmitDebug ();
+ // EmitDebug ();
if (ScopeTypeBuilder != null)
return;
TypeBuilder container = ec.TypeContainer.TypeBuilder;
- ScopeTypeBuilder = container.DefineNestedType (
- MakeHelperName (), TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.NestedAssembly,
- TypeManager.object_type, null);
-
+ CaptureContext.Host.CreateScopeType (ec, this);
+
if (NeedThis)
THIS = ScopeTypeBuilder.DefineField ("<>THIS", container, FieldAttributes.Assembly);
if (ParentScope.ScopeTypeBuilder == null){
throw new Exception (String.Format ("My parent has not been initialized {0} and {1}", ParentScope, this));
}
-
- ParentLink = ScopeTypeBuilder.DefineField ("<>parent", ParentScope.ScopeTypeBuilder,
- FieldAttributes.Assembly);
+
+ if (ParentScope.ScopeTypeBuilder != ScopeTypeBuilder)
+ ParentLink = ScopeTypeBuilder.DefineField ("<>parent", ParentScope.ScopeTypeBuilder,
+ FieldAttributes.Assembly);
}
if (NeedThis && ParentScope != null)
throw new Exception ("I was not expecting THIS && having a parent");
- foreach (LocalInfo info in locals){
+ foreach (LocalInfo info in locals)
info.FieldBuilder = ScopeTypeBuilder.DefineField (
info.Name, info.VariableType, FieldAttributes.Assembly);
- }
if (HostsParameters){
Hashtable captured_parameters = CaptureContext.captured_parameters;
}
}
- EmitScopeConstructor ();
foreach (ScopeInfo si in children){
si.EmitScopeType (ec);
}
if (ScopeConstructor == null)
throw new Exception ("ScopeConstructor is null for" + this.ToString ());
- ig.Emit (OpCodes.Newobj, (ConstructorInfo) ScopeConstructor);
- ScopeInstance = ig.DeclareLocal (ScopeTypeBuilder);
- ig.Emit (OpCodes.Stloc, ScopeInstance);
+ if (!CaptureContext.Host.IsIterator) {
+ scope_instance = ig.DeclareLocal (ScopeTypeBuilder);
+ ig.Emit (OpCodes.Newobj, (ConstructorInfo) ScopeConstructor);
+ ig.Emit (OpCodes.Stloc, scope_instance);
+ }
if (THIS != null){
- ig.Emit (OpCodes.Ldloc, ScopeInstance);
- ig.Emit (OpCodes.Ldarg_0);
+ if (CaptureContext.Host.IsIterator) {
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldarg_1);
+ } else {
+ ig.Emit (OpCodes.Ldloc, scope_instance);
+ ig.Emit (OpCodes.Ldarg_0);
+ }
ig.Emit (OpCodes.Stfld, THIS);
}
// Copy the parameter values, if any
//
int extra = ec.IsStatic ? 0 : 1;
+ if (CaptureContext.Host.IsIterator)
+ extra++;
if (HostsParameters){
Hashtable captured_parameters = CaptureContext.captured_parameters;
foreach (DictionaryEntry de in captured_parameters){
CapturedParameter cp = (CapturedParameter) de.Value;
- ig.Emit (OpCodes.Ldloc, ScopeInstance);
+ EmitScopeInstance (ig);
ParameterReference.EmitLdArg (ig, cp.Idx + extra);
ig.Emit (OpCodes.Stfld, cp.FieldBuilder);
}
}
-
+
if (ParentScope != null){
if (!ParentScope.inited)
ParentScope.EmitInitScope (ec);
-
- //
- // Only emit initialization in our capturecontext world
- //
- if (ParentScope.CaptureContext == CaptureContext){
- ig.Emit (OpCodes.Ldloc, ScopeInstance);
- ig.Emit (OpCodes.Ldloc, ParentScope.ScopeInstance);
- ig.Emit (OpCodes.Stfld, ParentLink);
- } else {
- ig.Emit (OpCodes.Ldloc, ScopeInstance);
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Stfld, ParentLink);
+
+ if (ParentScope.ScopeTypeBuilder != ScopeTypeBuilder) {
+ //
+ // Only emit initialization in our capturecontext world
+ //
+ if (ParentScope.CaptureContext == CaptureContext){
+ EmitScopeInstance (ig);
+ ParentScope.EmitScopeInstance (ig);
+ ig.Emit (OpCodes.Stfld, ParentLink);
+ } else {
+ EmitScopeInstance (ig);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Stfld, ParentLink);
+ }
}
}
inited = true;
}
+ public void EmitScopeInstance (ILGenerator ig)
+ {
+ if (CaptureContext.Host.IsIterator)
+ ig.Emit (OpCodes.Ldarg_0);
+ else
+ ig.Emit (OpCodes.Ldloc, scope_instance);
+ }
+
static void DoPath (StringBuilder sb, ScopeInfo start)
{
if (start.ParentScope != null){
Hashtable captured_fields = new Hashtable ();
Hashtable captured_variables = new Hashtable ();
public Hashtable captured_parameters = new Hashtable ();
- public AnonymousMethod Host;
+ public AnonymousContainer Host;
- public CaptureContext (ToplevelBlock toplevel_owner, Location loc, AnonymousMethod host)
+ public CaptureContext (ToplevelBlock toplevel_owner, Location loc,
+ AnonymousContainer host)
{
cc_id = count++;
this.toplevel_owner = toplevel_owner;
DoPath (sb, cc.ParentCaptureContext);
sb.Append (".");
}
- sb.Append (cc_id.ToString ());
+ sb.Append (cc.cc_id.ToString ());
+ }
+
+ public void ReParent (ToplevelBlock new_toplevel, AnonymousContainer new_host)
+ {
+ toplevel_owner = new_toplevel;
+ Host = new_host;
+
+ for (CaptureContext cc = ParentCaptureContext; cc != null;
+ cc = cc.ParentCaptureContext) {
+ cc.Host = new_host;
+ }
}
public override string ToString ()
throw new Exception ("Should never be reached");
}
- void AdjustMethodScope (AnonymousMethod am, ScopeInfo scope)
+ void AdjustMethodScope (AnonymousContainer am, ScopeInfo scope)
{
am.Scope = Deepest (am.Scope, scope);
}
topmost = parent;
}
- public void AddLocal (AnonymousMethod am, LocalInfo li)
+ public void AddLocal (AnonymousContainer am, LocalInfo li)
{
if (li.Block.Toplevel != toplevel_owner){
ParentCaptureContext.AddLocal (am, li);
topmost = scope;
} else {
// Link to parent
-
+
for (Block b = scope.ScopeBlock.Parent; b != null; b = b.Parent){
if (scopes [b.ID] != null){
LinkScope (scope, b.ID);
//
// Records the captured parameter at the appropriate CaptureContext
//
- public void AddParameter (EmitContext ec, AnonymousMethod am, string name, Type t, int idx)
+ public void AddParameter (EmitContext ec, AnonymousContainer am,
+ string name, Type t, int idx)
{
CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
//
// Records the parameters in the context
//
- void AddParameterToContext (AnonymousMethod am, string name, Type t, int idx)
+ public void AddParameterToContext (AnonymousContainer am, string name, Type t, int idx)
{
if (captured_parameters == null)
captured_parameters = new Hashtable ();
topmost.CloseTypes ();
}
+ public void EmitInitScope (EmitContext ec)
+ {
+ EmitAnonymousHelperClasses (ec);
+ if (topmost != null)
+ topmost.EmitInitScope (ec);
+ }
+
ScopeInfo GetScopeFromBlock (EmitContext ec, Block b)
{
ScopeInfo si;
// Emits the opcodes necessary to load the instance of the captured
// variable in `li'
//
- public void EmitCapturedVariableInstance (EmitContext ec, LocalInfo li, AnonymousMethod am)
+ public void EmitCapturedVariableInstance (EmitContext ec, LocalInfo li,
+ AnonymousContainer am)
{
ILGenerator ig = ec.ig;
ScopeInfo si;
-
+
if (li.Block.Toplevel == toplevel_owner){
si = GetScopeFromBlock (ec, li.Block);
- ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ si.EmitScopeInstance (ig);
return;
}
si = am.Scope;
ig.Emit (OpCodes.Ldarg_0);
if (si != null){
+ if (am.IsIterator && (si.ScopeBlock.Toplevel == li.Block.Toplevel)) {
+ return;
+ }
+
while (si.ScopeBlock.ID != li.Block.ID){
if (si.ParentLink != null)
ig.Emit (OpCodes.Ldfld, si.ParentLink);
ILGenerator ig = ec.ig;
ScopeInfo si;
-
+
if (ec.CurrentBlock.Toplevel == toplevel_owner){
si = GetScopeFromBlock (ec, toplevel_owner);
- ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ si.EmitScopeInstance (ig);
return;
}
// The following methods are only invoked on the host for the
// anonymous method.
//
- public void EmitMethodHostInstance (EmitContext target, AnonymousMethod am)
+ public void EmitMethodHostInstance (EmitContext target, AnonymousContainer am)
{
ILGenerator ig = target.ig;
ScopeInfo si = am.Scope;
-
+
if (si == null){
ig.Emit (OpCodes.Ldarg_0);
return;
}
si.EmitInitScope (target);
- ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ si.EmitScopeInstance (ig);
}
ArrayList all_scopes = new ArrayList ();
part.ec.ContainerType = TypeBuilder;
}
} else {
- ec = new EmitContext (this, Mono.CSharp.Location.Null, null, null, ModFlags);
+ //
+ // Normally, we create the EmitContext here.
+ // The only exception is if we're an Iterator - in this case,
+ // we already have the `ec', so we don't want to create a new one.
+ //
+ if (ec == null)
+ ec = new EmitContext (this, Mono.CSharp.Location.Null, null, null, ModFlags);
ec.ContainerType = TypeBuilder;
}
}
}
+ if (iterators != null) {
+ foreach (Iterator iterator in iterators) {
+ if (!iterator.Define ())
+ return false;
+ }
+ }
+
return true;
}
public EmitContext CreateEmitContext (TypeContainer tc, ILGenerator ig)
{
- return new EmitContext (
+ EmitContext ec = new EmitContext (
tc, ds, Location, ig, ReturnType, ModFlags, false);
+
+ ec.CurrentIterator = tc as Iterator;
+ if (ec.CurrentIterator != null)
+ ec.CurrentAnonymousMethod = ec.CurrentIterator.Host;
+
+ return ec;
}
public ObsoleteAttribute GetObsoleteAttribute ()
//
public override bool Define ()
{
+ if (ConstructorBuilder != null)
+ return true;
+
MethodAttributes ca = (MethodAttributes.RTSpecialName |
MethodAttributes.SpecialName);
public bool IsLastStatement;
- /// <summary>
- /// Whether remapping of locals, parameters and fields is turned on.
- /// Used by iterators and anonymous methods.
- /// </summary>
- public bool RemapToProxy;
-
/// <summary>
/// Whether we are inside an unsafe block
/// </summary>
/// <summary>
/// Whether we are inside an anonymous method.
/// </summary>
- public AnonymousMethod CurrentAnonymousMethod;
+ public AnonymousContainer CurrentAnonymousMethod;
/// <summary>
/// Location for this EmitContext
Phase current_phase;
FlowBranching current_flow_branching;
+
+ static int next_id = 0;
+ int id = ++next_id;
+
+ public override string ToString ()
+ {
+ return String.Format ("EmitContext ({0}:{1}:{2})", id,
+ CurrentIterator, capture_context, loc);
+ }
public EmitContext (DeclSpace parent, DeclSpace ds, Location l, ILGenerator ig,
Type return_type, int code_flags, bool is_constructor)
IsStatic = (code_flags & Modifiers.STATIC) != 0;
MethodIsStatic = IsStatic;
InIterator = (code_flags & Modifiers.METHOD_YIELDS) != 0;
- RemapToProxy = InIterator;
ReturnType = return_type;
IsConstructor = is_constructor;
CurrentBlock = null;
}
}
+ bool resolved;
+
public bool ResolveTopBlock (EmitContext anonymous_method_host, ToplevelBlock block,
InternalParameters ip, Location loc, out bool unreachable)
{
unreachable = false;
+ if (resolved)
+ return true;
+
capture_context = block.CaptureContext;
if (!Location.IsNull (loc))
}
#endif
- if (ReturnType != null && !unreachable){
- if (!InIterator){
- if (CurrentAnonymousMethod != null){
- Report.Error (1643, loc, "Not all code paths return a value in anonymous method of type `{0}'",
- CurrentAnonymousMethod.Type);
- } else {
+ if (ReturnType != null && !unreachable) {
+ if (CurrentAnonymousMethod == null) {
Report.Error (161, loc, "Not all code paths return a value");
- }
-
+ return false;
+ } else if (!CurrentAnonymousMethod.IsIterator) {
+ Report.Error (
+ 1643, loc, "Not all code paths return a " +
+ "value in anonymous method of type `{0}'",
+ CurrentAnonymousMethod.Type);
return false;
}
}
- block.CompleteContexts ();
+ block.CompleteContexts ();
+ resolved = true;
return true;
}
// this case.
//
+ bool in_iterator = (CurrentAnonymousMethod != null) &&
+ CurrentAnonymousMethod.IsIterator && InIterator;
+
if ((block != null) && block.IsDestructor) {
// Nothing to do; S.R.E automatically emits a leave.
- } else if (HasReturnLabel || (!unreachable && !InIterator)) {
+ } else if (HasReturnLabel || (!unreachable && !in_iterator)) {
if (ReturnType != null)
ig.Emit (OpCodes.Ldloc, TemporaryReturn ());
ig.Emit (OpCodes.Ret);
if (!InIterator && !HasReturnLabel)
HasReturnLabel = true;
- }
-
- //
- // Creates a field `name' with the type `t' on the proxy class
- //
- public FieldBuilder MapVariable (string name, Type t)
- {
- if (InIterator)
- return CurrentIterator.MapVariable ("v_", name, t);
-
- throw new Exception ("MapVariable for an unknown state");
- }
-
- public Expression RemapParameter (int idx)
- {
- FieldExpr fe = new FieldExprNoAddress (CurrentIterator.parameter_fields [idx].FieldBuilder, loc);
- fe.InstanceExpression = new ProxyInstance ();
- return fe.DoResolve (this);
}
- public Expression RemapParameterLValue (int idx, Expression right_side)
- {
- FieldExpr fe = new FieldExprNoAddress (CurrentIterator.parameter_fields [idx].FieldBuilder, loc);
- fe.InstanceExpression = new ProxyInstance ();
- return fe.DoResolveLValue (this, right_side);
- }
-
//
// Emits the proper object to address fields on a remapped
// variable/parameter to field in anonymous-method/iterator proxy classes.
public void EmitThis ()
{
ig.Emit (OpCodes.Ldarg_0);
- if (InIterator){
- if (!IsStatic){
- FieldBuilder this_field = CurrentIterator.this_field.FieldBuilder;
- if (TypeManager.IsValueType (this_field.FieldType))
- ig.Emit (OpCodes.Ldflda, this_field);
- else
- ig.Emit (OpCodes.Ldfld, this_field);
- }
- } else if (capture_context != null && CurrentAnonymousMethod != null){
+ if (capture_context != null && CurrentAnonymousMethod != null){
ScopeInfo si = CurrentAnonymousMethod.Scope;
while (si != null){
if (si.ParentLink != null)
//
public void EmitCapturedVariableInstance (LocalInfo li)
{
- if (RemapToProxy){
- ig.Emit (OpCodes.Ldarg_0);
- return;
- }
-
if (capture_context == null)
throw new Exception ("Calling EmitCapturedContext when there is no capture_context");
Location loc = (Location) $3;
top_current_block = (Block) oob_stack.Pop ();
current_block = (Block) oob_stack.Pop ();
- if (RootContext.Version == LanguageVersion.ISO_1){
+ if (RootContext.Version == LanguageVersion.ISO_1){
Report.FeatureIsNotStandardized (lexer.Location, "anonymous methods");
$$ = null;
} else {
opt_error
: /* empty */
+ {
+ $$ = false;
+ }
| error
{
lexer.PutbackNullable ();
+ $$ = true;
}
;
nullable_type_or_conditional
: type opt_error
{
- $$ = $1;
+ if (((bool) $2) && ($1 is ComposedCast))
+ $$ = ((ComposedCast) $1).RemoveNullable ();
+ else
+ $$ = $1;
}
;
yyErrorFlag = 3;
} nullable_type_or_conditional
{
+ Report.Debug (64, "PARSE IS", $1, $1.GetType (), $4, $4.GetType (), lexer.Location);
$$ = new Is ((Expression) $1, (Expression) $4, lexer.Location);
}
| relational_expression AS
// to extract the signature of a delegate.
//
public static MethodGroupExpr GetInvokeMethod (EmitContext ec, Type delegate_type,
- Location loc)
+ Location loc)
{
Expression ml = Expression.MemberLookup (
ec, delegate_type, "Invoke", loc);
/// Verifies whether the method in question is compatible with the delegate
/// Returns the method itself if okay and null if not.
/// </summary>
- public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type, MethodBase mb,
+ public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type,
+ MethodGroupExpr old_mg, MethodBase mb,
Location loc)
{
MethodGroupExpr mg = GetInvokeMethod (ec, delegate_type, loc);
if (mg == null)
return null;
+ if (old_mg.HasTypeArguments)
+ mg.HasTypeArguments = true;
+
MethodBase invoke_mb = mg.Methods [0];
ParameterData invoke_pd = TypeManager.GetParameterData (invoke_mb);
continue;
if (invoke_pd_type.IsSubclassOf (pd_type) &&
- invoke_pd_type_mod == pd_type_mod)
+ invoke_pd_type_mod == pd_type_mod)
if (RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotStandardized (loc, "contravariance");
return null;
} else
continue;
-
+
return null;
}
bool check_only)
{
foreach (MethodInfo mi in mg.Methods){
- delegate_method = Delegate.VerifyMethod (ec, type, mi, loc);
+ delegate_method = Delegate.VerifyMethod (ec, type, mg, mi, loc);
if (delegate_method != null)
break;
if (!RootContext.StdLib)
RootContext.BootCorlib_PopulateCoreTypes ();
RootContext.PopulateTypes ();
+
+ TypeManager.InitCodeHelpers ();
+
RootContext.DefineTypes ();
if (RootContext.Documentation != null &&
output_file))
return false;
- TypeManager.InitCodeHelpers ();
-
//
// Verify using aliases now
//
if (ec.CurrentAnonymousMethod != null){
if (!FieldInfo.IsStatic){
- if (ec.TypeContainer is Struct){
+ if (!ec.CurrentAnonymousMethod.IsIterator && (ec.TypeContainer is Struct)){
Report.Error (1673, loc, "Can not reference instance variables in anonymous methods hosted in structs");
return null;
}
ILGenerator ig = ec.ig;
bool is_volatile = false;
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
+ FieldInfo the_fi = FieldInfo.Mono_GetGenericFieldDefinition ();
+ if (the_fi is FieldBuilder){
+ FieldBase f = TypeManager.GetField (the_fi);
if (f != null){
if ((f.ModFlags & Modifiers.VOLATILE) != 0)
is_volatile = true;
override public Expression DoResolve (EmitContext ec)
{
- if (resolved) {
- Report.Debug ("Double resolve of " + Name);
+ if (resolved)
return this;
- }
if (getter != null){
if (TypeManager.GetArgumentTypes (getter).Length != 0){
// If we are referencing a variable from the external block
// flag it for capturing
//
- if (local_info.Block.Toplevel != ec.CurrentBlock.Toplevel){
+ if ((local_info.Block.Toplevel != ec.CurrentBlock.Toplevel) ||
+ ec.CurrentAnonymousMethod.IsIterator)
+ {
if (local_info.AddressTaken){
AnonymousMethod.Error_AddressOfCapturedVar (local_info.Name, loc);
return null;
//
// A local variable on the local CLR stack
//
- ig.Emit (OpCodes.Ldloc, local_info.LocalBuilder);
+ ig.Emit (OpCodes.Ldloc, local_info.LocalBuilder);
} else {
//
// A local variable captured by anonymous methods.
eclass = ExprClass.Variable;
}
+ public ParameterReference (InternalParameters pars, Block block, int idx, Location loc)
+ : this (pars.Parameters, block, idx, pars.ParameterName (idx), loc)
+ { }
+
public VariableInfo VariableInfo {
get { return vi; }
}
"Can not reference a ref or out parameter in an anonymous method");
return;
}
-
+
//
// If we are referencing the parameter from the external block
// flag it for capturing
if (is_out && ec.DoFlowAnalysis && !IsAssigned (ec, loc))
return null;
- if (ec.RemapToProxy)
- return ec.RemapParameter (idx);
-
return this;
}
SetAssigned (ec);
- if (ec.RemapToProxy)
- return ec.RemapParameterLValue (idx, right_side);
-
return this;
}
if (!ec.MethodIsStatic)
arg_idx++;
-
EmitLdArg (ig, arg_idx);
//
public override void Emit (EmitContext ec)
{
- if (ec.HaveCaptureInfo && ec.IsParameterCaptured (name)){
- ec.EmitParameter (name);
- return;
- }
-
Emit (ec, false);
}
ILGenerator ig = ec.ig;
int arg_idx = idx;
+ if (ec.HaveCaptureInfo && ec.IsParameterCaptured (name)){
+ if (leave_copy)
+ throw new InternalErrorException ();
+
+ ec.EmitParameter (name);
+ return;
+ }
+
if (!ec.MethodIsStatic)
arg_idx++;
Parameter.Modifier p_mod = pd.ParameterModifier (i) &
unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF));
-
if (a_mod == p_mod ||
(a_mod == Parameter.Modifier.NONE && p_mod == Parameter.Modifier.PARAMS)) {
if (a_mod == Parameter.Modifier.NONE) {
return null;
if (method != null) {
- IMethodData data = TypeManager.GetMethod (method);
+ MethodBase the_method = method;
+ if (the_method.Mono_IsInflatedMethod)
+ the_method = the_method.GetGenericMethodDefinition ();
+ IMethodData data = TypeManager.GetMethod (the_method);
if (data != null)
data.SetMemberIsUsed ();
}
loc = l;
}
+ public Expression RemoveNullable ()
+ {
+ if (dim.EndsWith ("?")) {
+ dim = dim.Substring (0, dim.Length - 1);
+ if (dim == "")
+ return left;
+ }
+
+ return this;
+ }
+
protected override TypeExpr DoResolveAsTypeStep (EmitContext ec)
{
TypeExpr lexpr = left.ResolveAsTypeTerminal (ec);
}
public class Yield : Statement {
- public Expression expr;
+ Expression expr;
ArrayList finally_blocks;
-
+ bool resolved;
+
public Yield (Expression expr, Location l)
{
this.expr = expr;
"catch clause");
return false;
}
- if (ec.CurrentAnonymousMethod != null){
+
+ AnonymousContainer am = ec.CurrentAnonymousMethod;
+ if ((am != null) && !am.IsIterator){
Report.Error (1621, loc, "The yield statement cannot be used inside anonymous method blocks");
return false;
}
expr = expr.Resolve (ec);
if (expr == null)
return false;
+
+ resolved = true;
+
if (!CheckContext (ec, loc))
return false;
Iterator iterator = ec.CurrentIterator;
+
if (expr.Type != iterator.IteratorType){
expr = Convert.ImplicitConversionRequired (
ec, expr, iterator.IteratorType, loc);
}
public class Iterator : Class {
- ToplevelBlock original_block;
- ToplevelBlock block;
+ protected ToplevelBlock original_block;
+ protected ToplevelBlock block;
string original_name;
Type iterator_type;
TypeExpr iterator_type_expr;
bool is_enumerable;
- bool is_static;
+ public readonly bool IsStatic;
Hashtable fields;
InternalParameters parameters;
MethodInfo dispose_method;
+ MoveNextMethod move_next_method;
+ Constructor ctor;
+ CaptureContext cc;
Expression enumerator_type;
Expression enumerable_type;
entry_point.Define (ig);
ec.EmitTopBlock (original_block, parameters, Location);
+
EmitYieldBreak (ig);
ig.MarkLabel (dispatcher);
Label dispatcher = ig.DefineLabel ();
ig.Emit (OpCodes.Br, dispatcher);
- ec.RemapToProxy = true;
Label [] labels = new Label [resume_points.Count];
for (int i = 0; i < labels.Length; i++) {
ResumePoint point = (ResumePoint) resume_points [i];
ig.EndExceptionBlock ();
ig.Emit (OpCodes.Br, end);
}
- ec.RemapToProxy = false;
ig.MarkLabel (dispatcher);
ig.Emit (OpCodes.Ldarg_0);
}
}
- //
- // Invoked when a local variable declaration needs to be mapped to
- // a field in our proxy class
- //
- // Prefixes registered:
- // v_ for EmitContext.MapVariable
- // s_ for Storage
- //
- public FieldBuilder MapVariable (string pfx, string name, Type t)
- {
- string full_name = pfx + name;
- FieldBuilder fb = (FieldBuilder) fields [full_name];
- if (fb != null)
- return fb;
-
- fb = TypeBuilder.DefineField (full_name, t, FieldAttributes.Private);
- fields.Add (full_name, fb);
- return fb;
- }
-
//
// Called back from Yield
//
this.parameters = parameters;
this.original_name = name;
this.original_block = block;
- this.block = new ToplevelBlock (loc);
+ this.block = new ToplevelBlock (block, parameters.Parameters, loc);
fields = new Hashtable ();
- is_static = (modifiers & Modifiers.STATIC) != 0;
+ IsStatic = (modifiers & Modifiers.STATIC) != 0;
+ }
+
+ public AnonymousContainer Host {
+ get { return move_next_method; }
}
public bool DefineIterator ()
{
ec = new EmitContext (this, Mono.CSharp.Location.Null, null, null, ModFlags);
+ ec.CurrentAnonymousMethod = move_next_method;
+ ec.CurrentIterator = this;
+ ec.InIterator = true;
if (!CheckType (return_type)) {
Report.Error (
protected override bool DoDefineMembers ()
{
+ ec.InIterator = true;
+ ec.CurrentIterator = this;
+ ec.CurrentAnonymousMethod = move_next_method;
+ ec.capture_context = cc;
+
if (!base.DoDefineMembers ())
return false;
return true;
}
+ public override bool Define ()
+ {
+ if (!base.Define ())
+ return false;
+
+ ec.InIterator = true;
+ ec.CurrentIterator = this;
+ ec.CurrentAnonymousMethod = move_next_method;
+ ec.capture_context = cc;
+ ec.TypeContainer = ec.TypeContainer.Parent;
+
+ if (ec.TypeContainer.CurrentType != null)
+ ec.ContainerType = ec.TypeContainer.CurrentType;
+ else
+ ec.ContainerType = ec.TypeContainer.TypeBuilder;
+
+ ec.ig = move_next_method.method.MethodBuilder.GetILGenerator ();
+
+ if (!ctor.Define ())
+ return false;
+
+ bool unreachable;
+
+ if (!ec.ResolveTopBlock (null, original_block, parameters, Location, out unreachable))
+ return false;
+
+ if (!ec.ResolveTopBlock (null, block, parameters, Location, out unreachable))
+ return false;
+
+ original_block.CompleteContexts ();
+
+ cc.EmitAnonymousHelperClasses (ec);
+
+ return true;
+ }
+
//
// Returns the new block for the method, or null on failure
//
current_type = new TypeExpression (TypeBuilder, Location);
Define_Fields ();
- Define_Constructor ();
Define_Current (false);
Define_Current (true);
Define_MoveNext ();
Define_Reset ();
Define_Dispose ();
+ Create_Block ();
+
+ Define_Constructor ();
+
if (is_enumerable) {
Define_GetEnumerator (false);
Define_GetEnumerator (true);
}
- Create_Block ();
-
return base.DefineNestedTypes ();
}
Field pc_field;
Field current_field;
+ LocalInfo pc_local;
+ LocalInfo current_local;
Method dispose;
- public Field this_field;
- public Field[] parameter_fields;
-
void Create_Block ()
{
- int first = is_static ? 0 : 1;
+ original_block.SetHaveAnonymousMethods (Location, move_next_method);
+ block.SetHaveAnonymousMethods (Location, move_next_method);
+
+ cc = original_block.CaptureContext;
+
+ int first = IsStatic ? 0 : 1;
ArrayList args = new ArrayList ();
- if (!is_static) {
+ if (!IsStatic) {
Type t = this_type;
args.Add (new Argument (
- new ThisParameterReference (t, 0, Location)));
+ new ThisParameterReference (t, Location)));
+ cc.CaptureThis ();
}
args.Add (new Argument (new BoolLiteral (false)));
for (int i = 0; i < parameters.Count; i++) {
Type t = parameters.ParameterType (i);
+ string name = parameters.ParameterName (i);
+
args.Add (new Argument (
new SimpleParameterReference (t, first + i, Location)));
+
+ cc.AddParameterToContext (move_next_method, name, t, first + i);
}
Expression new_expr = new New (current_type, args, Location);
void Define_Fields ()
{
- Location loc = Location.Null;
-
pc_field = new Field (
- this, TypeManager.system_int32_expr, Modifiers.PRIVATE, "PC",
- null, null, loc);
+ this, TypeManager.system_int32_expr, Modifiers.PRIVATE, "$PC",
+ null, null, Location);
AddField (pc_field);
current_field = new Field (
- this, iterator_type_expr, Modifiers.PRIVATE, "current",
- null, null, loc);
+ this, iterator_type_expr, Modifiers.PRIVATE, "$current",
+ null, null, Location);
AddField (current_field);
-
- if (!is_static) {
- this_field = new Field (
- this, new TypeExpression (this_type, loc),
- Modifiers.PRIVATE, "this", null, null, loc);
- AddField (this_field);
- }
-
- parameter_fields = new Field [parameters.Count];
- for (int i = 0; i < parameters.Count; i++) {
- string fname = String.Format (
- "field{0}_{1}", i, parameters.ParameterName (i));
-
- parameter_fields [i] = new Field (
- this,
- new TypeExpression (parameters.ParameterType (i), loc),
- Modifiers.PRIVATE, fname, null, null, loc);
- AddField (parameter_fields [i]);
- }
}
void Define_Constructor ()
ArrayList list = new ArrayList ();
- if (!is_static)
+ if (!IsStatic)
list.Add (new Parameter (
new TypeExpression (this_type, Location),
"this", Parameter.Modifier.NONE, null));
fixed_params, parameters.Parameters.ArrayParameter,
Location);
- Constructor ctor = new Constructor (
+ ctor = new Constructor (
this, Name, Modifiers.PUBLIC, ctor_params,
new ConstructorBaseInitializer (null, Location),
Location);
AddConstructor (ctor);
- ToplevelBlock block = ctor.Block = new ToplevelBlock (Location);
+ ctor.Block = new ToplevelBlock (block, parameters.Parameters, Location);
- if (!is_static) {
- Type t = this_type;
-
- Assign assign = new Assign (
- new FieldExpression (this_field),
- new SimpleParameterReference (t, 1, Location),
- Location);
-
- block.AddStatement (new StatementExpression (assign, Location));
- }
-
- int first = is_static ? 2 : 3;
-
- for (int i = 0; i < parameters.Count; i++) {
- Type t = parameters.ParameterType (i);
-
- Assign assign = new Assign (
- new FieldExpression (parameter_fields [i]),
- new SimpleParameterReference (t, first + i, Location),
- Location);
-
- block.AddStatement (new StatementExpression (assign, Location));
- }
+ int first = IsStatic ? 2 : 3;
State initial = is_enumerable ? State.Uninitialized : State.Running;
- block.AddStatement (new SetState (this, initial, Location));
+ ctor.Block.AddStatement (new SetState (this, initial, Location));
- block.AddStatement (new If (
+ ctor.Block.AddStatement (new If (
new SimpleParameterReference (
TypeManager.bool_type, first - 1, Location),
new SetState (this, State.Running, Location),
Location));
+
+ ctor.Block.AddStatement (new InitScope (this, cc, Location));
}
Statement Create_ThrowInvalidOperation ()
MemberName name = new MemberName (left, "Current", null);
- ToplevelBlock get_block = new ToplevelBlock (Location);
+ ToplevelBlock get_block = new ToplevelBlock (
+ block, parameters.Parameters, Location);
get_block.AddStatement (new If (
new Binary (
Binary.Operator.LessThanOrEqual,
- new FieldExpression (pc_field),
+ new FieldExpression (this, pc_field),
new IntLiteral ((int) State.Running), Location),
Create_ThrowInvalidOperation (),
new Return (
- new FieldExpression (current_field), Location),
+ new FieldExpression (this, current_field), Location),
Location));
Accessor getter = new Accessor (get_block, 0, null, Location);
void Define_MoveNext ()
{
- Method move_next = new Method (
- this, null, TypeManager.system_boolean_expr,
- Modifiers.PUBLIC, false, new MemberName ("MoveNext"),
- Parameters.EmptyReadOnlyParameters, null,
- Location.Null);
- AddMethod (move_next);
+ move_next_method = new MoveNextMethod (this, Location);
+
+ original_block.ReParent (block, move_next_method);
- ToplevelBlock block = move_next.Block = new ToplevelBlock (Location);
+ move_next_method.CreateMethod (ec);
- MoveNextMethod inline = new MoveNextMethod (this, Location);
- block.AddStatement (inline);
+ AddMethod (move_next_method.method);
}
void Define_GetEnumerator (bool is_generic)
Location.Null);
AddMethod (get_enumerator);
- get_enumerator.Block = new ToplevelBlock (Location);
+ get_enumerator.Block = new ToplevelBlock (
+ block, parameters.Parameters, Location);
+
+ get_enumerator.Block.SetHaveAnonymousMethods (Location, move_next_method);
Expression ce = new MemberAccess (
new SimpleName ("System.Threading.Interlocked", Location),
"CompareExchange", Location);
- Expression pc = new FieldExpression (pc_field);
+ Expression pc = new FieldExpression (this, pc_field);
Expression before = new IntLiteral ((int) State.Running);
Expression uninitialized = new IntLiteral ((int) State.Uninitialized);
Binary.Operator.Equality,
new Invocation (ce, args, Location),
uninitialized, Location),
- new Return (new This (block, Location), Location),
+ new Return (new ThisParameterReference (type.Type, Location),
+ Location),
Location));
args = new ArrayList ();
- if (!is_static)
- args.Add (new Argument (new FieldExpression (this_field)));
+ if (!IsStatic) {
+ args.Add (new Argument (new CapturedThisReference (this, Location)));
+ }
args.Add (new Argument (new BoolLiteral (true)));
- for (int i = 0; i < parameters.Count; i++)
- args.Add (new Argument (
- new FieldExpression (parameter_fields [i])));
+ for (int i = 0; i < parameters.Count; i++) {
+ Expression cp = new CapturedParameterReference (
+ this, parameters.ParameterType (i),
+ parameters.ParameterName (i), Location);
+ args.Add (new Argument (cp));
+ }
Expression new_expr = new New (current_type, args, Location);
get_enumerator.Block.AddStatement (new Return (new_expr, Location));
}
}
- protected class ThisParameterReference : SimpleParameterReference
+ protected class ThisParameterReference : SimpleParameterReference, IMemoryLocation
{
- public ThisParameterReference (Type type, int idx, Location loc)
- : base (type, idx, loc)
+ public ThisParameterReference (Type type, Location loc)
+ : base (type, 0, loc)
{ }
protected override void DoEmit (EmitContext ec)
if (ec.TypeContainer is Struct)
ec.ig.Emit (OpCodes.Ldobj, type);
}
+
+ public void AddressOf (EmitContext ec, AddressOp mode)
+ {
+ if (ec.TypeContainer is Struct)
+ ec.ig.Emit (OpCodes.Ldarga, 0);
+ else
+ ec.ig.Emit (OpCodes.Ldarg, 0);
+ }
+ }
+
+ protected class CapturedParameterReference : Expression
+ {
+ Iterator iterator;
+ string name;
+
+ public CapturedParameterReference (Iterator iterator, Type type,
+ string name, Location loc)
+ {
+ this.iterator = iterator;
+ this.loc = loc;
+ this.type = type;
+ this.name = name;
+ eclass = ExprClass.Variable;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ec.CurrentAnonymousMethod = iterator.move_next_method;
+
+ iterator.cc.EmitParameter (ec, name);
+ }
+ }
+
+ protected class CapturedThisReference : Expression
+ {
+ Iterator iterator;
+
+ public CapturedThisReference (Iterator iterator, Location loc)
+ {
+ this.iterator = iterator;
+ this.loc = loc;
+ this.type = iterator.this_type;
+ eclass = ExprClass.Variable;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ec.ig.Emit (OpCodes.Ldarg_0);
+ ec.ig.Emit (OpCodes.Ldfld, iterator.move_next_method.Scope.THIS);
+ }
}
protected class FieldExpression : Expression
{
+ Iterator iterator;
Field field;
- public FieldExpression (Field field)
+ public FieldExpression (Iterator iterator, Field field)
{
+ this.iterator = iterator;
this.field = field;
+ this.loc = iterator.Location;
}
public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
- return DoResolve (ec);
+ FieldExpr fexpr = new FieldExpr (field.FieldBuilder, loc);
+ fexpr.InstanceExpression = new ThisParameterReference (
+ iterator.this_type, loc);
+ return fexpr.ResolveLValue (ec, right_side);
}
public override Expression DoResolve (EmitContext ec)
{
FieldExpr fexpr = new FieldExpr (field.FieldBuilder, loc);
- fexpr.InstanceExpression = ec.GetThis (loc);
+ fexpr.InstanceExpression = new ThisParameterReference (
+ iterator.this_type, loc);
return fexpr.Resolve (ec);
}
}
}
- protected class MoveNextMethod : Statement {
+ protected class MoveNextMethod : AnonymousContainer
+ {
Iterator iterator;
public MoveNextMethod (Iterator iterator, Location loc)
+ : base (iterator.parameters.Parameters, iterator.original_block, loc)
{
- this.loc = loc;
this.iterator = iterator;
}
- public override bool Resolve (EmitContext ec)
+ protected override bool CreateMethodHost (EmitContext ec)
{
- ec.CurrentBranching.CurrentUsageVector.Return ();
+ method = new Method (
+ iterator, null, TypeManager.system_boolean_expr,
+ Modifiers.PUBLIC, false, new MemberName ("MoveNext"),
+ Parameters.EmptyReadOnlyParameters, null, loc);
+
+ method.Block = Block;
+
+ MoveNextStatement inline = new MoveNextStatement (iterator, loc);
+ Block.AddStatement (inline);
+
return true;
}
- protected override void DoEmit (EmitContext ec)
+ public bool CreateMethod (EmitContext ec)
{
- int code_flags = Modifiers.METHOD_YIELDS;
- if (iterator.is_static)
- code_flags |= Modifiers.STATIC;
+ return CreateMethodHost (ec);
+ }
- code_flags |= iterator.ModFlags & Modifiers.UNSAFE;
+ public override bool IsIterator {
+ get { return true; }
+ }
- EmitContext new_ec = new EmitContext (
- iterator.container, loc, ec.ig,
- TypeManager.int32_type, code_flags);
+ public override void CreateScopeType (EmitContext ec, ScopeInfo scope)
+ {
+ scope.ScopeTypeBuilder = iterator.TypeBuilder;
+ scope.ScopeConstructor = iterator.ctor.ConstructorBuilder;
+ }
- new_ec.CurrentIterator = iterator;
+ public override void Emit (EmitContext ec)
+ {
+ throw new InternalErrorException ();
+ }
+ }
- iterator.EmitMoveNext (new_ec);
+ protected class MoveNextStatement : Statement {
+ Iterator iterator;
+
+ public MoveNextStatement (Iterator iterator, Location loc)
+ {
+ this.loc = loc;
+ this.iterator = iterator;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ec.CurrentIterator = iterator;
+ ec.CurrentAnonymousMethod = iterator.move_next_method;
+ ec.InIterator = true;
+
+ iterator.EmitMoveNext (ec);
}
}
}
}
+ protected class InitScope : Statement
+ {
+ Iterator iterator;
+ CaptureContext cc;
+
+ public InitScope (Iterator iterator, CaptureContext cc, Location loc)
+ {
+ this.iterator = iterator;
+ this.cc = cc;
+ this.loc = loc;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ iterator.cc.EmitInitScope (ec);
+ }
+ }
+
void Define_Reset ()
{
Method reset = new Method (
AddMethod (reset);
reset.Block = new ToplevelBlock (Location);
+ reset.Block = new ToplevelBlock (block, parameters.Parameters, Location);
+ reset.Block.SetHaveAnonymousMethods (Location, move_next_method);
+
reset.Block.AddStatement (Create_ThrowNotSupported ());
}
Parameters.EmptyReadOnlyParameters, null, Location);
AddMethod (dispose);
- dispose.Block = new ToplevelBlock (Location);
+ dispose.Block = new ToplevelBlock (block, parameters.Parameters, Location);
+ dispose.Block.SetHaveAnonymousMethods (Location, move_next_method);
+
dispose.Block.AddStatement (new DisposeMethod (this, Location));
}
// This return statement tricks return into not flagging an error for being
// used in a Yields method
//
- class NoCheckReturn : Return {
- public NoCheckReturn (Expression expr, Location loc) : base (expr, loc)
+ class NoCheckReturn : Statement {
+ public Expression Expr;
+
+ public NoCheckReturn (Expression expr, Location l)
{
+ Expr = expr;
+ loc = l;
}
public override bool Resolve (EmitContext ec)
{
- ec.InIterator = false;
- bool ret_val = base.Resolve (ec);
- ec.InIterator = true;
+ Expr = Expr.Resolve (ec);
+ if (Expr == null)
+ return false;
+
+ FlowBranching.UsageVector vector = ec.CurrentBranching.CurrentUsageVector;
+ ec.CurrentBranching.CurrentUsageVector.Return ();
- return ret_val;
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ Expr.Emit (ec);
+ ec.ig.Emit (OpCodes.Ret);
}
}
public static int WarningLevel;
public static Target Target;
- public static string TargetExt = ".exe";
+ public static string TargetExt;
public static bool VerifyClsCompliance = true;
StrongNameDelaySign = false;
MainClass = null;
Target = Target.Exe;
+ TargetExt = ".exe";
Version = LanguageVersion.Default;
Documentation = null;
impl_details_class = null;
{
TypeContainer root = Tree.Types;
+ ArrayList delegates = root.Delegates;
+ if (delegates != null){
+ foreach (Delegate d in delegates)
+ if ((d.ModFlags & Modifiers.NEW) == 0)
+ d.Define ();
+ }
+
if (type_container_resolve_order != null){
foreach (TypeContainer tc in type_container_resolve_order) {
// When compiling corlib, these types have already been
}
}
- ArrayList delegates = root.Delegates;
- if (delegates != null){
- foreach (Delegate d in delegates)
- if ((d.ModFlags & Modifiers.NEW) == 0)
- d.Define ();
- }
-
ArrayList enums = root.Enums;
if (enums != null){
foreach (Enum en in enums)
public override bool Resolve (EmitContext ec)
{
+ AnonymousContainer am = ec.CurrentAnonymousMethod;
+ if ((am != null) && am.IsIterator && ec.InIterator) {
+ Report.Error (1622, loc, "Cannot return a value from iterators. Use the yield return " +
+ "statement to return a value, or yield break to end the iteration");
+ return false;
+ }
+
if (ec.ReturnType == null){
if (Expr != null){
if (ec.CurrentAnonymousMethod != null){
return false;
}
- if (ec.InIterator) {
- Report.Error (1622, loc, "Cannot return a value from iterators. Use the yield return " +
- "statement to return a value, or yield break to end the iteration");
- return false;
- }
-
Expr = Expr.Resolve (ec);
if (Expr == null)
return false;
}
}
- if (ec.InIterator){
- Error (-206, "Return statement not allowed inside iterators");
- return false;
- }
-
FlowBranching.UsageVector vector = ec.CurrentBranching.CurrentUsageVector;
if (ec.CurrentBranching.InTryOrCatch (true)) {
}
Type t = expr.Type;
-
+
if ((t != TypeManager.exception_type) &&
- !t.IsSubclassOf (TypeManager.exception_type) &&
- !(expr is NullLiteral)) {
+ !TypeManager.IsSubclassOf (t, TypeManager.exception_type) &&
+ !(expr is NullLiteral)) {
Error (155,
"The type caught or thrown must be derived " +
"from System.Exception");
// statements.
//
ArrayList children;
-
+
//
// Labels. (label, block) pairs.
//
continue;
}
-#if false
- if (remap_locals)
- vi.FieldBuilder = ec.MapVariable (name, vi.VariableType);
- else if (vi.Pinned)
- //
- // This is needed to compile on both .NET 1.x and .NET 2.x
- // the later introduced `DeclareLocal (Type t, bool pinned)'
- //
- vi.LocalBuilder = TypeManager.DeclareLocalPinned (ig, vi.VariableType);
- else if (!vi.IsThis)
- vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
-#endif
-
if (constants == null)
continue;
if (variables != null){
bool have_captured_vars = ec.HaveCapturedVariables ();
- bool remap_locals = ec.RemapToProxy;
foreach (DictionaryEntry de in variables){
LocalInfo vi = (LocalInfo) de.Value;
if (have_captured_vars && ec.IsCaptured (vi))
continue;
- if (remap_locals){
- vi.FieldBuilder = ec.MapVariable (vi.Name, vi.VariableType);
- } else {
- if (vi.Pinned)
- //
- // This is needed to compile on both .NET 1.x and .NET 2.x
- // the later introduced `DeclareLocal (Type t, bool pinned)'
- //
- vi.LocalBuilder = TypeManager.DeclareLocalPinned (ig, vi.VariableType);
- else if (!vi.IsThis)
- vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
- }
+ if (vi.Pinned)
+ //
+ // This is needed to compile on both .NET 1.x and .NET 2.x
+ // the later introduced `DeclareLocal (Type t, bool pinned)'
+ //
+ vi.LocalBuilder = TypeManager.DeclareLocalPinned (ig, vi.VariableType);
+ else if (!vi.IsThis)
+ vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
}
}
if (temporary_variables != null) {
+ AnonymousContainer am = ec.CurrentAnonymousMethod;
+ TypeBuilder scope = null;
+ if ((am != null) && am.IsIterator) {
+ scope = am.Scope.ScopeTypeBuilder;
+ if (scope == null)
+ throw new InternalErrorException ();
+ }
foreach (LocalInfo vi in temporary_variables) {
- vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
+ if (scope != null) {
+ if (vi.FieldBuilder == null)
+ vi.FieldBuilder = scope.DefineField (
+ vi.Name, vi.VariableType, FieldAttributes.Assembly);
+ } else
+ vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
}
}
Report.Debug (4, "RESOLVE BLOCK DONE", StartLocation,
ec.CurrentBranching, statement_count, num_statements);
-
FlowBranching.UsageVector vector = ec.DoEndFlowBranching ();
ec.CurrentBlock = prev_block;
// Pointer to the host of this anonymous method, or null
// if we are the topmost block
//
- public ToplevelBlock Container;
+ ToplevelBlock container;
CaptureContext capture_context;
FlowBranching top_level_branching;
Hashtable capture_contexts;
+ ArrayList children;
//
// The parameters for the block.
cc.AdjustScopes ();
}
}
-
+
public CaptureContext ToplevelBlockCaptureContext {
get {
return capture_context;
}
}
-
+
+ public ToplevelBlock Container {
+ get {
+ return container;
+ }
+ }
+
+ protected void AddChild (ToplevelBlock block)
+ {
+ if (children == null)
+ children = new ArrayList ();
+
+ children.Add (block);
+ }
+
//
// Parent is only used by anonymous blocks to link back to their
// parents
base (null, flags | Flags.IsToplevel, start, Location.Null)
{
Parameters = parameters == null ? Parameters.EmptyReadOnlyParameters : parameters;
- Container = container;
+ this.container = container;
+
+ if (container != null)
+ container.AddChild (this);
}
public ToplevelBlock (Location loc) : this (null, (Flags) 0, null, loc)
{
}
- public void SetHaveAnonymousMethods (Location loc, AnonymousMethod host)
+ public void SetHaveAnonymousMethods (Location loc, AnonymousContainer host)
{
if (capture_context == null)
capture_context = new CaptureContext (this, loc, host);
}
}
+ //
+ // This is used if anonymous methods are used inside an iterator
+ // (see 2test-22.cs for an example).
+ //
+ // The AnonymousMethod is created while parsing - at a time when we don't
+ // know yet that we're inside an iterator, so it's `Container' is initially
+ // null. Later on, when resolving the iterator, we need to move the
+ // anonymous method into that iterator.
+ //
+ public void ReParent (ToplevelBlock new_parent, AnonymousContainer new_host)
+ {
+ foreach (ToplevelBlock block in children) {
+ if (block.CaptureContext == null)
+ continue;
+
+ block.container = new_parent;
+ block.CaptureContext.ReParent (new_parent, new_host);
+ }
+ }
+
//
// Returns a `ParameterReference' for the given name, or null if there
// is no such parameter
CheckObsolete (expr_type);
- if (ec.RemapToProxy){
- Report.Error (-210, loc, "Fixed statement not allowed in iterators");
- return false;
- }
-
data = new Emitter [declarators.Count];
if (!expr_type.IsPointer){
protected class TemporaryVariable : Expression, IMemoryLocation
{
- FieldBuilder fb;
LocalInfo li;
public TemporaryVariable (Type type, Location loc)
eclass = ExprClass.Value;
}
- static int count;
-
public override Expression DoResolve (EmitContext ec)
{
- if (ec.InIterator) {
- count++;
- fb = ec.CurrentIterator.MapVariable (
- "s_", count.ToString (), type);
- } else {
- TypeExpr te = new TypeExpression (type, loc);
- li = ec.CurrentBlock.AddTemporaryVariable (te, loc);
- if (!li.Resolve (ec))
- return null;
- }
+ if (li != null)
+ return this;
+
+ TypeExpr te = new TypeExpression (type, loc);
+ li = ec.CurrentBlock.AddTemporaryVariable (te, loc);
+ if (!li.Resolve (ec))
+ return null;
+
+ AnonymousContainer am = ec.CurrentAnonymousMethod;
+ if ((am != null) && am.IsIterator)
+ ec.CaptureVariable (li);
return this;
}
{
ILGenerator ig = ec.ig;
- if (fb != null) {
+ if (li.FieldBuilder != null) {
ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldfld, fb);
+ ig.Emit (OpCodes.Ldfld, li.FieldBuilder);
} else {
ig.Emit (OpCodes.Ldloc, li.LocalBuilder);
}
{
ILGenerator ig = ec.ig;
- if (fb != null) {
+ if (li.FieldBuilder != null) {
ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldflda, fb);
+ ig.Emit (OpCodes.Ldflda, li.FieldBuilder);
} else {
ig.Emit (OpCodes.Ldloca, li.LocalBuilder);
}
public void Store (EmitContext ec, Expression right_side)
{
- if (fb != null)
+ if (li.FieldBuilder != null)
ec.ig.Emit (OpCodes.Ldarg_0);
right_side.Emit (ec);
- if (fb != null)
- ec.ig.Emit (OpCodes.Stfld, fb);
- else
+ if (li.FieldBuilder != null) {
+ ec.ig.Emit (OpCodes.Stfld, li.FieldBuilder);
+ } else {
ec.ig.Emit (OpCodes.Stloc, li.LocalBuilder);
+ }
}
- public void EmitThis (ILGenerator ig)
+ public void EmitThis (EmitContext ec)
{
- if (fb != null)
- ig.Emit (OpCodes.Ldarg_0);
+ if (li.FieldBuilder != null) {
+ ec.ig.Emit (OpCodes.Ldarg_0);
+ }
}
public void EmitStore (ILGenerator ig)
{
- if (fb != null)
- ig.Emit (OpCodes.Stfld, fb);
+ if (li.FieldBuilder != null)
+ ig.Emit (OpCodes.Stfld, li.FieldBuilder);
else
ig.Emit (OpCodes.Stloc, li.LocalBuilder);
}
public void Initialize (EmitContext ec)
{
- EmitThis (ec.ig);
+ EmitThis (ec);
ec.ig.Emit (OpCodes.Ldc_I4_0);
EmitStore (ec.ig);
}
public void Increment (EmitContext ec)
{
- EmitThis (ec.ig);
+ EmitThis (ec);
Emit (ec);
ec.ig.Emit (OpCodes.Ldc_I4_1);
ec.ig.Emit (OpCodes.Add);
}
public override bool Resolve (EmitContext ec)
- {
+ {
array_type = expr.Type;
rank = array_type.GetArrayRank ();
test [i] = ig.DefineLabel ();
loop [i] = ig.DefineLabel ();
- lengths [i].EmitThis (ig);
+ lengths [i].EmitThis (ec);
((ArrayAccess) access).EmitGetLength (ec, i);
lengths [i].EmitStore (ig);
}
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyVersion("1.1.5")]
+[assembly: AssemblyVersion("1.1.8")]
[assembly: AssemblyTitle ("Mono ILasm Compiler")]
[assembly: AssemblyDescription ("Mono ILasm Compiler")]
[assembly: AssemblyCopyright ("Sergey Chaban and Jackson Harper")]
[assembly: Mono.UsageComplement("SOURCE-FILES")]
//[assembly: Mono.LicensingWith(Mono.GetOptions.Licenses.GPL)]
-//[assembly: Mono.ForMoreInformation("http://www.go-mono.com")]
-//[assembly: Mono.UsageClause("mbas [options] source-files")]
+[assembly: Mono.AdditionalInfo("For more information: http://www.mono-project.com/Language_BASIC")]
+[assembly: Mono.ReportBugsTo(" http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Compilers&component=Basic ")]
-[assembly: AssemblyVersion("0.96.1.0")]
+[assembly: AssemblyVersion("0.96.2.0")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
+2005-06-13 Manjula GHM <mmanjula@novell.com>
+ *statement.cs: To handle Goto in Try, Catch block
+
+2005-06-10 Manjula GHM <mmanjula@novell.com>
+ *assign: To Support other types of source in Mid statement
+
+2005-06-10 Manjula GHM <mmanjula@novell.com>
+ *assign: To Support Optional Max. Insert length value in Mid statement
+
+2005-06-10 Manjula GHM <mmanjula@novell.com>
+ *assign.cs: Allow New Date assignment to other types
+
+2005-06-08 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * AssemblyInfo.cs :
+ - Added informational attributes that Mono.GetOptions shows in the help screen.
+ - Bumped up the version number a bit
+
+2005-06-07 Satya Sudha K <ksathyasudha@novell.com>
+ * class.cs : Disallowing default properties without parameters.
+ * Some cleanups in other files to get rid of warnings.
+
2005-06-03 Satya Sudha K <ksathyasudha@novell.com>
* expression.cs : Allowing '()' for property invocation with no args.
* typemanager.cs :
Expression etmp;
ArrayList arglist = new ArrayList();
- Argument arg4;
+ Argument arg3,arg4;
Expression e = null;
eclass = ExprClass.Value;
arglist = i.Arguments;
-
+
+ // If maximum Insert Length value is omitted
+ if(arglist.Count == 2) {
+ string val = null;
+ val = source.ToString();
+ int maxInsertLength = val.Length;
+ arg3 = new Argument (new IntLiteral(maxInsertLength), Argument.AType.Expression);
+ arglist.Add (arg3);
+ }
+
etmp = Mono.MonoBASIC.Parser.DecomposeQI("Microsoft.VisualBasic.CompilerServices.StringType.MidStmtStr", loc);
//Get fourth argument and add it to argument list
source = e.Resolve (ec);
return this;
}
- if (source_type == TypeManager.date_type && (source_type!=target_type)) {
- if( target_type != TypeManager.object_type) {
- Report.Error (30311, loc,
- " Value of type " + source_type +
- " cannot be converted to " + target_type);
- return null;
- }
-
- }
if (target_type.IsValueType) {
New n = (New) source;
n.ValueTypeVariable = target;
Modifiers.WRITEONLY |
Modifiers.SHADOWS;
- string set_parameter_name;
- Parameters get_params;
- Parameters set_params;
+ //string set_parameter_name;
+ //Parameters get_params;
+ //Parameters set_params;
public Property (Expression type, string name, int mod_flags,
Accessor get_block, Accessor set_block,
"'Property' inside a 'Structure' can not be declared as " +
"'Protected' or 'Protected Friend'");
+ if (((ModFlags & Modifiers.DEFAULT) != 0) && (Parameters == null || Parameters.CountStandardParams () == 0)) {
+ Report.Error (31048, Location, "Properties with no required " +
+ "parameters cannot be declared 'Default'");
+ return false;
+ }
+
if (!DoDefine (parent))
return false;
return false;
}
- Expression real_expr = Expr;
Constant ce = Expr as Constant;
if (ce == null){
UnCheckedExpr un_expr = Expr as UnCheckedExpr;
CheckedExpr ch_expr = Expr as CheckedExpr;
- EmptyCast ec_expr = Expr as EmptyCast;
if ((un_expr != null) && (un_expr.Expr is Constant))
Expr = un_expr.Expr;
else if ((ch_expr != null) && (ch_expr.Expr is Constant))
return Report.Errors == 0;
}
+/*
private bool EmbedResources()
{
options.StartTime("Embedding resources");
options.ShowTime(" Done");
return Report.Errors == 0;
}
+*/
private bool SaveOutput()
{
loc = l;
}
+/*
void LoadExprValue (EmitContext ec)
{
}
+*/
public override void Emit (EmitContext ec)
{
bool is_left_hand; // Needed for late bound calls
bool is_retval_required; // Needed for late bound calls
static Hashtable method_parameter_cache;
- static MemberFilter CompareName;
+ //static MemberFilter CompareName;
static ArrayList tempvars; // For ByRef - different parameter and argument type
static bool is_byref_conversion = false; //For ByRef when it is converted
this.is_left_hand = false;
Arguments = arguments;
loc = l;
- CompareName = new MemberFilter (compare_name_filter);
+ //CompareName = new MemberFilter (compare_name_filter);
}
public Expression Expr {
return ConversionType.Widening;
// }
+/*
if ((a_mod & Parameter.Modifier.ISBYREF) != 0) {
Type pt = pd.ParameterType (i);
return ConversionType.None;
}
return ConversionType.Widening;
+*/
} else
return ConversionType.None;
}
return orderedArgs;
}
+/*
static bool compare_name_filter (MemberInfo m, object filterCriteria)
{
return (m.Name == ((string) filterCriteria));
}
+*/
public static MethodBase OverloadResolve (EmitContext ec, MethodGroupExpr me,
ref ArrayList Arguments, Location loc)
return OverloadResolve (ec, me, ref a, loc);
}
+/*
static string ToString(MethodBase mbase)
{
if (mbase == null)
return mbase.ToString();
}
+*/
/// <summary>
/// Find the Applicable Function Members (7.4.2.1)
}
}
+/*
static void EmitPropertyArgs (EmitContext ec, ArrayList prop_args)
{
int top = prop_args.Count;
a.Emit (ec);
}
}
+*/
public override void Emit (EmitContext ec)
{
}
}
+/*
void Error_NegativeArrayIndex ()
{
Error (284, "Can not create array with a negative size");
return target;
}
+*/
//
// Creates the type of the array
MethodInfo get, set;
Indexers ilist;
ArrayList set_arguments;
- bool is_base_indexer;
+ //bool is_base_indexer;
protected Type indexer_type;
protected Type current_type;
Location loc)
{
this.instance_expr = instance_expr;
- this.is_base_indexer = is_base_indexer;
+ //this.is_base_indexer = is_base_indexer;
this.eclass = ExprClass.Value;
this.loc = loc;
}
AddHandler (current_block, evt_definition, handler_exp);
}
+/*
void CheckAttributeTarget (string a)
{
switch (a) {
break;
}
}
+*/
private void AddHandler (Block b, Expression evt_id, Expression handles_exp)
{
return ci;
}
+/*
void Error_ExpectingTypeName (Location l, Expression expr)
{
if (expr is Invocation){
Report.Error (-1, l, "Invalid Type definition");
}
}
+*/
public static Expression SetLeftHandFlag (Expression expr) {
if (expr is Invocation) {
return expr;
}
+/*
static bool AlwaysAccept (MemberInfo m, object filterCriteria) {
return true;
}
+*/
private void ReportError9998()
{
protected override bool DoEmit (EmitContext ec)
{
Label l = label.LabelTarget (ec);
- ec.ig.Emit (OpCodes.Br, l);
+ if (ec.InTry || ec.InCatch)
+ ec.ig.Emit (OpCodes.Leave, l);
+ else
+ ec.ig.Emit (OpCodes.Br, l);
return false;
}
public class LabeledStatement : Statement {
public readonly Location Location;
- string label_name;
+ //string label_name;
bool defined;
bool referenced;
Label label;
public LabeledStatement (string label_name, Location l)
{
- this.label_name = label_name;
+ //this.label_name = label_name;
this.Location = l;
}
num_params = 0;
for (int i = 0; i < count; i++) {
- Parameter.Modifier mod = param_info.ParameterModifier (i);
+ //Parameter.Modifier mod = param_info.ParameterModifier (i);
// if ((mod & Parameter.Modifier.OUT) == 0)
// continue;
//
// Maps variable names to ILGenerator.LocalBuilders
//
- CaseInsensitiveHashtable local_builders;
+ //CaseInsensitiveHashtable local_builders;
// to hold names of variables required for late binding
public const string lateBindingArgs = "1_LBArgs";
// Process this block variables
//
if (variables != null){
- local_builders = new CaseInsensitiveHashtable ();
+ //local_builders = new CaseInsensitiveHashtable ();
foreach (DictionaryEntry de in variables){
string name = (string) de.Key;
//
bool CheckSwitch (EmitContext ec)
{
- Type compare_type;
+ //Type compare_type;
bool error = false;
Elements = new CaseInsensitiveHashtable ();
got_default = false;
+/*
if (TypeManager.IsEnumType (SwitchType)){
compare_type = TypeManager.EnumToUnderlying (SwitchType);
} else
compare_type = SwitchType;
+*/
for (int secIndex = 0; secIndex < Sections.Count; secIndex ++) {
SwitchSection ss = (SwitchSection) Sections [secIndex];
if (!statement.Resolve (ec))
return false;
- FlowReturns returns = ec.EndFlowBranching ();
+ //FlowReturns returns = ec.EndFlowBranching ();
+ ec.EndFlowBranching ();
return true;
}
const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
- static CaseInsensitiveHashtable type_hash = new CaseInsensitiveHashtable ();
+ //static CaseInsensitiveHashtable type_hash = new CaseInsensitiveHashtable ();
/// <remarks>
/// This is the "old", non-cache based FindMembers() function. We cannot use
//
// Name of the member
//
- static string closure_name;
+ //static string closure_name;
//
// Whether we allow private members in the result (since FindMembers
// Who is invoking us and which type is being queried currently.
//
static Type closure_invocation_type;
- static Type closure_queried_type;
+ //static Type closure_queried_type;
static Type closure_start_type;
//
bool always_ok_flag = false;
bool skip_iface_check = true, used_cache = false;
- closure_name = name;
+ //closure_name = name;
closure_invocation_type = invocation_type;
closure_invocation_assembly = invocation_type != null ? invocation_type.Assembly : null;
closure_start_type = queried_type;
}
closure_private_ok = private_ok;
- closure_queried_type = current_type;
+ //closure_queried_type = current_type;
Timer.StopTimer (TimerType.MemberLookup);
bf |= BindingFlags.IgnoreCase;
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyVersion("1.1.5")]
+[assembly: AssemblyVersion("1.1.8")]
[assembly: AssemblyTitle ("Mono C# Compiler")]
[assembly: AssemblyDescription ("Mono C# Compiler")]
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
+2005-06-10 Duncan Mak <duncan@novell.com>
+
+ * cs-tokenizer.cs (process_directives): New flag for controlling
+ the processing of preprocessor directives.
+ (x_token): After seeing a '#', return Token.NONE instead of going
+ to handle_preprocessing_directive() when not processing
+ directives. This avoids unnecessary processing during the token peek in
+ is_punct().
+
+ This fixes #74939.
+
+ * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
+ the existing error reporting methods instead of Report.Error.
+
+ * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
+ after Raja's rewrite.
+
+2005-06-08 Miguel de Icaza <miguel@novell.com>
+
+ * class.cs: Small fix.
+
+2005-06-08 Raja R Harinath <rharinath@novell.com>
+
+ Fix #75160.
+ * class.cs (GetPartialBases): Fix return value check of
+ part.GetClassBases.
+
+2005-06-07 Raja R Harinath <rharinath@novell.com>
+
+ Ensure that partial classes are registered in their enclosing
+ namespace. Initial part of fix of #75160.
+ * tree.cs (Tree.RecordDecl): Add new namespace argument.
+ Register declspace with namespace here, not in
+ DeclSpace.RecordDecl.
+ * cs-parser.jay: Pass namespace to RecordDecl.
+ * class.cs (PartialContainer.Create): Likewise.
+ (ClassPart.DefineType): New sanity-check. Throws an exception if
+ called.
+ * decl.cs (Declspace.RecordDecl): Remove.
+ * namespace.cs (NamespaceEntry.DefineName): Remove.
+
+2005-06-06 Marek Safar <marek.safar@seznam.cz>
+
+ * rootcontext.cs: Reset TargetExt as well.
+
2005-06-03 Raja R Harinath <rharinath@novell.com>
* ecore.cs (Expression.Resolve): Emit CS0654 error when
}
//
- // If this assignemnt/operator was part of a compound binary
+ // If this assignment/operator was part of a compound binary
// operator, then we allow an explicit conversion, as detailed
// in the spec.
//
return null;
}
}
-
source = Convert.ImplicitConversionRequired (ec, source, target_type, loc);
+
if (source == null)
return null;
TypeExpr[] new_ifaces;
new_ifaces = part.GetClassBases (out new_base_class);
- if (new_ifaces == null && base_type != null)
+ if (new_ifaces == null && new_base_class != null)
return null;
if ((base_class != null) && (new_base_class != null) &&
}
}
+ // Can not continue if constants are broken
EmitConstants ();
+ if (Report.Errors > 0)
+ return;
if (default_static_constructor != null)
default_static_constructor.Emit ();
parent = ((ClassPart) parent).PartialContainer;
pc = new PartialContainer (ns.NS, parent, member_name, mod_flags, kind, loc);
- RootContext.Tree.RecordDecl (member_name, pc);
+ RootContext.Tree.RecordDecl (ns.NS, member_name, pc);
if (kind == Kind.Interface)
parent.AddInterface (pc);
return PartialContainer.BaseCache;
}
}
+
+ public override TypeBuilder DefineType ()
+ {
+ throw new InternalErrorException ("Should not get here");
+ }
+
}
public abstract class ClassOrStruct : TypeContainer {
else
return FindMostEncompassedType (ec, src_types_set);
}
-
- //
- // Useful in avoiding proliferation of objects
- //
- static EmptyExpression priv_fmt_expr;
/// <summary>
/// Finds the most specific target Tx according to section 13.4.4
current_container.AddClassOrStruct (current_class);
current_container = current_class;
- RootContext.Tree.RecordDecl (name, current_class);
+ RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class);
}
}
opt_class_base
current_container.AddInterface (current_class);
current_container = current_class;
- RootContext.Tree.RecordDecl (name, current_class);
+ RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class);
}
}
opt_class_base
}
current_container.AddEnum (e);
- RootContext.Tree.RecordDecl (name, e);
+ RootContext.Tree.RecordDecl (current_namespace.NS, name, e);
$$ = e;
}
}
current_container.AddDelegate (del);
- RootContext.Tree.RecordDecl (name, del);
+ RootContext.Tree.RecordDecl (current_namespace.NS, name, del);
$$ = del;
}
;
current_container.AddClassOrStruct (current_class);
current_container = current_class;
- RootContext.Tree.RecordDecl (name, current_class);
+ RootContext.Tree.RecordDecl (current_namespace.NS, name, current_class);
}
}
opt_class_base
// Save current position and parse next token.
int old = reader.Position;
+
+ // disable preprocessing directives when peeking
+ process_directives = false;
int new_token = token ();
+ process_directives = true;
reader.Position = old;
putback_char = -1;
"Cannot define or undefine pre-processor symbols after a token in the file");
}
+ //
+ // Set to false to stop handling preprocesser directives
+ //
+ bool process_directives = true;
+
//
// if true, then the code continues processing the code
// if false, the code stays in a loop until another directive is
case "else":
if (ifstack == null || ifstack.Count == 0){
- Report.Error (
- 1028, Location,
- "Unexpected processor directive (no #if for this #else)");
+ Error_UnexpectedDirective ("no #if for this #else");
return true;
} else {
int state = (int) ifstack.Peek ();
}
- private int consume_string (bool quoted)
+ private int consume_string (bool quoted)
{
int c;
string_builder.Length = 0;
// FIXME: In C# the '#' is not limited to appear
// on the first column.
if (c == '#') {
+ // return NONE if we're not processing directives (during token peeks)
+ if (!process_directives)
+ return Token.NONE;
+
bool cont = true;
-
if (tokens_seen || comments_seen) {
- error_details = "Preprocessor directives must appear as the first non-whitespace " +
- "character on a line.";
+ error_details = "Preprocessor directives must appear as the first" +
+ " non-whitespace character on a line.";
Report.Error (1040, Location, error_details);
return false;
}
- public void RecordDecl ()
- {
- if ((NamespaceEntry != null) && (Parent == RootContext.Tree.Types))
- NamespaceEntry.DefineName (MemberName.Basename, this);
- }
-
/// <summary>
/// Returns the MemberCore associated with a given name in the declaration
/// space. It doesn't return method based symbols !!
}
}
- public void DefineName (string name, IAlias o)
- {
- ns.DefineName (name, o);
- }
-
/// <summary>
/// Records a new namespace for resolving name references
/// </summary>
public static int WarningLevel;
public static Target Target;
- public static string TargetExt = ".exe";
+ public static string TargetExt;
public static bool VerifyClsCompliance = true;
StrongNameDelaySign = false;
MainClass = null;
Target = Target.Exe;
+ TargetExt = ".exe";
Version = LanguageVersion.Default;
Documentation = null;
impl_details_class = null;
decls = new Hashtable ();
}
- public void RecordDecl (MemberName name, DeclSpace ds)
+ public void RecordDecl (Namespace ns, MemberName name, DeclSpace ds)
{
DeclSpace other = (DeclSpace) decls [name];
if (other != null){
+ Report.SymbolRelatedToPreviousError (other);
+
PartialContainer other_pc = other as PartialContainer;
- if ((ds is TypeContainer) && (other_pc != null)) {
+ if (ds is TypeContainer && other_pc != null)
Report.Error (
260, ds.Location, "Missing partial modifier " +
- "on declaration of type `{0}'; another " +
+ "on declaration of type '{0}'; another " +
"partial implementation of this type exists",
name);
-
- Report.LocationOfPreviousError (other.Location);
- return;
- }
-
- Report.SymbolRelatedToPreviousError (
- other.Location, other.GetSignatureForError ());
-
- Report.Error (
- 101, ds.Location,
- "There is already a definition for `" + name + "'");
+ else
+ Report.Error (
+ 101, ds.Location,
+ "There is already a definition for '{0}'", name);
return;
}
- ds.RecordDecl ();
-
decls.Add (name, ds);
+
+ if (ds.Parent == Types)
+ ns.DefineName (name.Basename, ds);
}
//
+++ /dev/null
-NAnt.exe
-nant.exe
+++ /dev/null
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Make NAnt.exe dependant on all the *.cs in src and each sub
- dir. Since we don't remove it on a 'make clean' it doesn't get rebuilt
- when a new file is added or an existing one changed.
-
-2002-03-17 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Do not remove the NAnt.exe on a 'make clean'. This would
- prevent other cleans from happening that need nant.
-
-2002/03/15 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Compile a version of NAnt with Mono's libs. It only does
- this if you 'make NAnt_mono.exe'. Of course, right now the resulting
- exe probably is not going to work yet becuase of the immature class
- libs.
+++ /dev/null
-NAnt\r
-\r
-What is it? \r
------------\r
-NAnt is a .NET based build tool. In theory it is kind of like make without \r
-make's wrinkles. In practice it's a lot like Ant. \r
- \r
-If you are not familiar with Jakarta Ant you can get more information at the\r
-Jakarta project web site.\r
-http://jakarta.apache.org/\r
-\r
-\r
-Why NAnt?\r
----------\r
-Because Ant was too Java specific.\r
-Because Ant needed the Java runtime. NAnt only needs the .NET runtime.\r
-\r
-\r
-The Latest Version\r
-------------------\r
-Details of the latest version can be found on the NAnt project web site\r
-http://nant.sourceforge.net/\r
-\r
-\r
-Documentation\r
--------------\r
-Documentation is available in HTML format, in the doc/ directory.\r
-\r
-\r
-License\r
--------\r
-Copyright (C) 2001 Gerry Shaw\r
-\r
-This program is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-\r
-In addition, as a special exception, Gerry Shaw gives permission to link the \r
-code of this program with the Microsoft .NET library (or with modified versions \r
-of Microsoft .NET library that use the same license as the Microsoft .NET \r
-library), and distribute linked combinations including the two. You must obey \r
-the GNU General Public License in all respects for all of the code used other \r
-than the Microsoft .NET library. If you modify this file, you may extend this \r
-exception to your version of the file, but you are not obligated to do so. If \r
-you do not wish to do so, delete this exception statement from your version.\r
-\r
-A copy of the GNU General Public License is available in the COPYING.txt file \r
-included with all NAnt distributions.\r
-\r
-For more licensing information refer to the GNU General Public License on the \r
-GNU Project web site.\r
-http://www.gnu.org/copyleft/gpl.html\r
+++ /dev/null
-<html>\r
-\r
-<head>\r
- <meta http-equiv="Content-Language" content="en-ca">\r
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
- <link rel="stylesheet" type="text/css" href="style.css" />\r
- <title>NAnt Authors</title>\r
-</head>\r
-\r
-<body>\r
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">\r
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Authors</td></tr>\r
- </table>\r
-\r
- <h1><span class="N">N</span><span class="Ant">Ant</span> Authors</h1>\r
-\r
- <h3>Lead Developer</h3>\r
- <ul>\r
- <li>Gerry Shaw (gerry_shaw@yahoo.com)</li>\r
- </ul>\r
-\r
- <h3>Developers</h3>\r
- <ul>\r
- <li>Ian MacLean (ian_maclean@another.com)</li>\r
- </ul>\r
-\r
- <h3>Code Contributions (sorted by name)</h3>\r
- <ul>\r
- <li>Mike Krueger (mike@icsharpcode.net)</li>\r
- <li>Sergey Chaban (serge@wildwestsoftware.com)</li>\r
- </ul>\r
-\r
- <h3><a></a>Special Thanks To</h3>\r
- <ul>\r
- <li>The <a href="http://jakarta.apache.org/ant/">Ant</a> team on the Jakarta project.</li>\r
- <li><a href="http://www.hazware.com/">Hazware</a> for the original XBuild source.</li>\r
- <li><a href="http://nunit.sourceforge.net/">Philip Craig</a> for NUnit.</li>\r
- <li><a href="http://msdn.microsoft.com/net/">Microsoft</a> for making .NET and C#.</li>\r
- <li>Ximian for working on the <a href="http://www.go-mono.com">Mono</a> project ot make .NET a true open standard.</li>\r
- </ul>\r
-</body>\r
-\r
-</html>\r
+++ /dev/null
-<html>\r
-\r
-<head>\r
- <meta http-equiv="Content-Language" content="en-ca">\r
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
- <link rel="stylesheet" type="text/css" href="style.css" />\r
- <title>NAnt Change Log</title>\r
-</head>\r
-\r
-<body>\r
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">\r
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Change Log</td></tr>\r
- </table>\r
-\r
- <h1><span class="N">N</span><span class="Ant">Ant</span> Change Log</h1>\r
-\r
- <h3>0.6.0 September 18, 2001</h3>\r
- <ul>\r
- <li>report build file xml errors in a useful way</li>\r
- <li>report error location when tasks are missing required attributes</li>\r
- <li>copy task updated - thanks to Ian MacLean</li>\r
- <li>**/*.cs type pattern matching now available in file sets via DirectoryScanner class</li>\r
- <li>Ian MacLean added as a project developer</li>\r
- <li>added all the environment variables to properites, ie, <echo message="path=${nant.env.PATH}"/></li>\r
- <li>move task updated - thanks to Ian MacLean</li>\r
- <li>sleep task added - thanks to Ian MacLean</li>\r
- <li>DirectoryScanner and FileSet's scan for files AND directories now</li>\r
- <li>FileSet's cache scan results, use Scan() to rescan</li>\r
- <li>FileSet's auto initialize to their containing Task, this helps clean up the code</li>\r
- <li>copy task can now copy full directory trees</li>\r
- <li>added verbose attribute to copy task, default off, message gives number of files processed</li>\r
- <li>fixed bug with any ExternalBase tasks hanging - thanks to Sergey Chaban for reporting</li>\r
- <li>include task added</li>\r
- <li>call task added</li>\r
- <li>-verbose command line option added</li>\r
- <li>build file can now build complete distribution, try 'nant dist'</li>\r
- </ul>\r
-\r
- <h3>0.5.0 August 22, 2001</h3>\r
- <ul>\r
- <li>complete overhaul of the web site and doc folder (all html files)</li>\r
- <li>made src a parent folder to be able to hold multiple assemblies in anticipation of the NAnt.Tests.dll assembly</li>\r
- <li>licensed changed to GNU General Public License</li>\r
- <li>source code placed under CVS</li>\r
- <li>tasks can now have attributes in base classes, see CompilerBase as an example - thanks to Mike Krueger</li>\r
- <li>coding conventions posted on SourceForge in the document manager</li>\r
- <li>task manager in SourceForge is now being used to track currently active tasks</li>\r
- <li>namespace changed to SourceForge.NAnt</li>\r
- <li>added basic command line parsing</li>\r
- <li>added version resource</li>\r
- <li>support for multiple build targets (try 'nant clean test')</li>\r
- <li>BuildException added to report text position in the build file where errors occur - thanks to Ian MacLean</li>\r
- <li>style task (xslt processing) added - thanks to Serge</li>\r
- <li>executable is now signed with the NAnt.key</li>\r
- <li>converted all public/protected fields to properties</li>\r
- <li>added support for user define properties</li>\r
- <li>added -set option (try 'nant -set:debug=true clean build')</li>\r
- <li>changed verions number to 0.5 to reflect the number of changes in the code base</li>\r
- </ul>\r
-\r
- <h3>0.1.5 July 22, 2001</h3>\r
- <ul>\r
- <li>only compiles program if source file last write time > output last write time</li>\r
- <li>refactored compiler code into common CompilerBase class</li>\r
- <li>refactored compiler and exec task into common ExternalProgramBase class</li>\r
- <li>added <arg value="/win32res:filename"/> element to all external program tasks</li>\r
- <li>added Int32ValidatorAttribute and BooleanValidatorAttribute classes to perform error checking on task attributes after macro expansion but before task execution. Search for BooleanValidator or Int32Validator in Tasks for examples.</li>\r
- <li>changed Task attribute names to TaskAttributeAttribute and FileSetAttribute</li>\r
- <li>removed default value for task attributes (set with initial value)</li>\r
- <li>changes to Project class on how to initialize a project and run it</li>\r
- <li>right aligned task prefixes to clean up output</li>\r
- <li>added or enhanced these tasks\r
- <ul>\r
- <li>vbc, jsc, csc</li>\r
- <li>move</li>\r
- <li>nant</li>\r
- <li>taskdef</li>\r
- <li>tstamp</li>\r
- <li>exec (failonerror attribute)</li>\r
- </ul>\r
- </li>\r
- </ul>\r
-\r
- <h3>0.1.4 July 19, 2001</h3>\r
- <ul>\r
- <li>added or enhanced these tasks\r
- <ul>\r
- <li>echo</li>\r
- <li>fail</li>\r
- <li>property</li>\r
- <li>copy (respects basedir)</li>\r
- <li>delete (respects basedir)</li>\r
- <li>mkdir (respects basedir)</li>\r
- <li>exec</li>\r
- </ul>\r
- </li>\r
- </ul>\r
-\r
- <h3>0.1.3 July 18, 2001</h3>\r
- <ul>\r
- <li>dependices working via depends attribute on targets</li>\r
- <li>changed name from NBuild to NAnt</li>\r
- <li>using the name "Parameter" to refer to the xml attributes in tasks because it was conflicting badly with .NET Attributes</li>\r
- <li>added FileSetParameterAttribute so that fileset parameters would autoinit</li>\r
- <li>renamed TaskAttributeAttribute to StringParameterAttribute</li>\r
- <li>broke into seperate source files (one per class)</li>\r
- <li>changed default build file from Project.xml to the first file with a .build extension</li>\r
- </ul>\r
-\r
- <h3>0.1.2 July 16, 2001</h3>\r
- <ul>\r
- <li>basic functionality to have NAnt build itself (csc task)</li>\r
- </ul>\r
-\r
- <h3>0.1.1 July 5, 2001</h3>\r
- <ul>\r
- <li>initial test version</li>\r
- </ul>\r
-</body>\r
-\r
-</html>\r
+++ /dev/null
-<html>\r
-\r
-<head>\r
- <meta http-equiv="Content-Language" content="en-ca">\r
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
- <link rel="stylesheet" type="text/css" href="style.css" />\r
- <title>NAnt - A .NET Build Tool</title>\r
-</head>\r
-\r
-<body>\r
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">\r
- <tr><td class="NavBar-Cell" width="100%"><b>NAnt</b> : A .NET Build Tool</td></tr>\r
- </table>\r
-\r
- <h1><span class="N">N</span><span class="Ant">Ant</span> Home Page</h1>\r
-\r
- <p>September 18, 2001 Gerry Shaw -- <a title="Send email to Gerry Shaw" href="mailto:gerry_shaw@yahoo.com">gerry_shaw@yahoo.com</a></p>\r
- <p>NAnt is a .NET based build tool. In theory it is kind of like make without make's wrinkles. In practice it's a lot like <a title="Ant home page" href="http://jakarta.apache.org/ant/">Ant</a>. NAnt has only been tested with Beta 2 .NET SDK, build 2914.</p>\r
- <p>The idea for NAnt came from <a title="Hazware home page" href="http://www.hazware.com/xbHome.htm"> Hazware's XBuild</a> project. After emailing the author for a beta 2 version of the tool and getting no response I decided to port the code to .NET beta 2. Due to the number of changes from .NET beta 1 to beta 2 the result was a total rewrite.</p>\r
- <ul>\r
- <li><a title="NAnt files page on SourceForge" href="http://sourceforge.net/project/showfiles.php?group_id=31650"><b>Download latest version</b></a> from SourceForge</li>\r
- <li><a title="NAnt web site on SourceForge" href="http://nant.sourceforge.net">Home page</a> on SourceForge</li>\r
- <li><a title="NAnt project summary on SourceForge" href="http://sourceforge.net/projects/nant/">Project summary</a> on SourceForge</li>\r
- <li><a title="Version history of NAnt" href="changelog.html">Changes</a></li>\r
- <li><a title="Tasks still being worked on" href="todo.html">To do</a></li>\r
- <li><a title="Project credits" href="authors.html">Authors</a></li>\r
- <li><a title="Software license agreement" href="license.html">License</a></li>\r
- </ul>\r
-\r
- <h2>Getting Started</h2>\r
- <p>Since the software is still in heavy development you are going to be on your own. You can see NAnt build itself by doing the following:</p>\r
- <ol>\r
- <li>Download the latest released version.</li>\r
- <li>Unzip the distribution into a new folder.</li>\r
- <li>Using a command prompt (so you can see the build output) cd into the\r
- folder where NAnt was unzipped.</li>\r
- <li>Type <code>bin\nant</code> at the command prompt to build NAnt.</li>\r
- </ol>\r
-\r
- <p><a href="http://sourceforge.net"><img valign="middle" src="http://sourceforge.net/sflogo.php?group_id=31650" width="88" height="31" border="0" alt="SourceForge logo (link to home page)"></a></p>\r
-</body>\r
-\r
-</html>\r
+++ /dev/null
-<html>\r
-\r
-<head>\r
- <meta http-equiv="Content-Language" content="en-ca">\r
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
- <link rel="stylesheet" type="text/css" href="style.css" />\r
- <title>NAnt License</title>\r
-</head>\r
-\r
-<body>\r
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">\r
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> License</td></tr>\r
- </table>\r
-\r
- <h1><span class="N">N</span><span class="Ant">Ant</span> License</h1>\r
- <p>Copyright © 2001 Gerry Shaw</p>\r
- <p>\r
- This program is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation; either version 2 of the License, or\r
- (at your option) any later version.\r
- </p>\r
- <p>\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
- </p>\r
- <p>\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- </p>\r
- <p>\r
- <b>In addition, as a special exception</b>, Gerry Shaw gives permission to link the \r
- code of this program with the Microsoft .NET library (or with modified versions \r
- of Microsoft .NET library that use the same license as the Microsoft .NET \r
- library), and distribute linked combinations including the two. You must obey \r
- the GNU General Public License in all respects for all of the code used other \r
- than the Microsoft .NET library. If you modify this file, you may extend this \r
- exception to your version of the file, but you are not obligated to do so. If \r
- you do not wish to do so, delete this exception statement from your version.\r
- </p>\r
- <p>A copy of the GNU General Public License is available in the COPYING.txt file included with all NAnt distributions.</p>\r
- <p>The <a title="GNU home page" href="http://www.gnu.org/">GNU Project</a> has more information on the <a title="Full text of the GNU Public License" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.</p>\r
-</body>\r
-\r
-</html>\r
+++ /dev/null
-body {\r
- font-family: Georgia, "Times New Roman", Times, "New York", serif;\r
- background: white;\r
- color: black\r
-}\r
-\r
-h1, h2, h3, h4, h5, h6 {\r
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif\r
-}\r
-\r
-h1.LinkHeader, h2.LinkHeader, h3.LinkHeader { margin-bottom: -18 }\r
-\r
-h4 {\r
- margin-bottom: 0.5em\r
-}\r
-\r
-h5 {\r
- margin-bottom: -.8em;\r
-}\r
-\r
-\r
-hr {\r
- color: gray\r
-}\r
-\r
-input {\r
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;\r
-}\r
-\r
-a:link { color: #0000cc; }\r
-a:visited { color: purple }\r
-a:active { color: #cc0000 }\r
-a:hover { color: #cc0000; }\r
-\r
-/*\r
-\r
-Because HTML 4.0 strict does not include the border attribute for images we turn it off with a style\r
-but this totally messes up Navigator 4.7 so we can't use it.\r
-\r
-a:link img, a:visited img, a:active img {\r
- border: none\r
-}\r
-*/\r
-\r
-/* have list items flush left against lists in a side bar use this style */\r
-ul.FlushLeft {\r
- margin-left: 1.25em;\r
- list-style-position: outside\r
-}\r
-\r
-.NavBar {\r
- background-color: #dfff80;\r
- border-color: #999966;\r
- border-style: none none solid none;\r
- border-width: 2px;\r
-}\r
-\r
-.NavBar-Cell {\r
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;\r
- font-size: 79%;\r
-}\r
-\r
-.SideBar {\r
- font-size: 80%;\r
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;\r
- padding: 8px;\r
-}\r
-\r
-/* color scheme */\r
-.N { color: #99cc00; }\r
-.Ant { color: #ff9900; }\r
+++ /dev/null
-<html>\r
-\r
-<head>\r
- <meta http-equiv="Content-Language" content="en-ca">\r
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">\r
- <link rel="stylesheet" type="text/css" href="style.css" />\r
- <title>NAnt To Do</title>\r
-</head>\r
-\r
-<body>\r
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">\r
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->" width="13" height="9"/> To Do</td></tr>\r
- </table>\r
-\r
- <h1><span class="N">N</span><span class="Ant">Ant</span> To Do</h1>\r
- <p>The following is a rough guide to what features are being worked on and when they will be worked on in the future.</p>\r
- <p>For a list of what is actively being worked refer to the <a title="SourceForge task manager for NAnt" href="https://sourceforge.net/pm/?group_id=31650">NAnt Task Manager</a> on SourceForge.</p>\r
-\r
- <h3>0.7</h3>\r
- <ul>\r
- <li>command line parsing using clippy (another tool I'm working on that will be posted soon)</li>\r
- <li>clippy task (for command line parsing)</li>\r
- <li>nunit tests</li>\r
- <li>nunit task</li>\r
- <li>validate build file for valid xml and against a schema before starting build</li>\r
- <li>code xml docs for all non private members</li>\r
- <li>developer docs (code conventions, high level design)</li>\r
- <li>post newsgroup announcment</li>\r
- <li>request code review and project help</li>\r
- </ul>\r
-\r
- <h3>0.8</h3>\r
- <ul>\r
- <li>task documentation for users</li>\r
- <li>zip task</li>\r
- <li>ftp task</li>\r
- <li>standard input support for tasks that require input (ie, passwords when copying files via scp to SourceForge)</li>\r
- </ul>\r
-\r
- <h3>1.0</h3>\r
- <ul>\r
- <li>official release</li>\r
- <li>general cleanup</li>\r
- <li>xml documentation</li>\r
- <li>user documentation</li>\r
- <li>post newsgroup announcment</li>\r
- </ul>\r
-\r
- <h3>1.1</h3>\r
- <ul>\r
- <li>additional optional but useful tasks (sql, touch, email, grep)</li>\r
- </ul>\r
-</body>\r
-\r
-</html>
\ No newline at end of file
+++ /dev/null
-This is an import of the Nant sources version 0.6.0 into the
-tree. We are doing this because the binaries were not compatible
-across versions of .NET.
-
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-[assembly: AssemblyTitle("NAnt")]\r
-[assembly: AssemblyDescription("A .NET Build Tool")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("http://nant.sourceforge.net/")]\r
-[assembly: AssemblyProduct("NAnt")]\r
-[assembly: AssemblyCopyright("Copyright (C) 2001 Gerry Shaw")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-[assembly: AssemblyVersion("0.6.0.*")]\r
-\r
-// This will not compile with Visual Studio. If you want to build a signed\r
-// executable use the NAnt build file. To build under Visual Studio just\r
-// exclude this file from the build.\r
-[assembly: AssemblyDelaySign(false)]\r
-[assembly: AssemblyKeyName("")]\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- /// <summary>Indicates that field should be able to be converted into a Boolean.</summary>\r
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]\r
- public class BooleanValidatorAttribute : ValidatorAttribute {\r
-\r
- public BooleanValidatorAttribute() {\r
- }\r
-\r
- public override string Validate(object value) {\r
- string errorMessage = null;\r
- try {\r
- Convert.ToBoolean(value);\r
- } catch (Exception) {\r
- errorMessage = String.Format("Cannot resolve to '{0}' to Boolean value.", value.ToString());\r
- }\r
- return errorMessage;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- /// <summary>Indicates that field should be able to be converted into a Int32 within the given range.</summary>\r
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]\r
- public class Int32ValidatorAttribute : ValidatorAttribute {\r
-\r
- int _minValue = Int32.MinValue;\r
- int _maxValue = Int32.MaxValue;\r
-\r
- public Int32ValidatorAttribute() {\r
- }\r
-\r
- public Int32ValidatorAttribute(int minValue, int maxValue) {\r
- MinValue = minValue;\r
- MaxValue = maxValue;\r
- }\r
-\r
- public int MinValue {\r
- get { return _minValue; }\r
- set { _minValue = value; }\r
- }\r
-\r
- public int MaxValue {\r
- get { return _maxValue; }\r
- set { _maxValue = value; }\r
- }\r
-\r
- public override string Validate(object value) {\r
- string errorMessage = null;\r
- try {\r
- Int32 intValue = Convert.ToInt32(value);\r
- if (intValue < MinValue || intValue > MaxValue) {\r
- errorMessage = String.Format("Cannot resolve '{0}' to integer between '{1}' and '{2}'.", value.ToString(), MinValue, MaxValue);\r
- }\r
- } catch (Exception) {\r
- errorMessage = String.Format("Cannot resolve '{0}' to integer value.", value.ToString());\r
- }\r
- return errorMessage;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- /// <summary>Indicates that field should be treated as a xml attribute for the task.</summary>\r
- /// <example>\r
- /// Examples of how to specify task attributes\r
- /// <code>\r
- /// // task XmlType default is string\r
- /// [TaskAttribute("out", Required=true)]\r
- /// string _out = null; // assign default value here\r
- ///\r
- /// [TaskAttribute("optimize")]\r
- /// [BooleanValidator()]\r
- /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)\r
- /// string _optimize = Boolean.FalseString;\r
- ///\r
- /// [TaskAttribute("warnlevel")]\r
- /// [Int32Validator(0,4)] // limit values to 0-4\r
- /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)\r
- /// string _warnlevel = "0";\r
- ///\r
- /// [TaskFileSet("sources")]\r
- /// FileSet _sources = new FileSet();\r
- /// </code>\r
- /// NOTE: Attribute values must be of type of string if you want\r
- /// to be able to have macros. The field stores the exact value during\r
- /// InitializeTask. Just before ExecuteTask is called NAnt will expand\r
- /// all the macros with the current values.\r
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]\r
- public class TaskAttributeAttribute : Attribute {\r
-\r
- string _name;\r
- bool _required;\r
- bool _expandText;\r
-\r
- public TaskAttributeAttribute(string name) {\r
- Name = name;\r
- Required = false;\r
- ExpandText = true;\r
- }\r
-\r
- public string Name {\r
- get { return _name; }\r
- set { _name = value; }\r
- }\r
-\r
- public bool Required {\r
- get { return _required; }\r
- set { _required = value; }\r
- }\r
-\r
- public bool ExpandText {\r
- get { return _expandText; }\r
- set { _expandText = value; }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- /// <summary>Indicates that field should be treated as a xml file set for the task.</summary>\r
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]\r
- public class TaskFileSetAttribute : Attribute {\r
-\r
- string _name;\r
-\r
- public TaskFileSetAttribute(string name) {\r
- Name = name;\r
- }\r
-\r
- public string Name {\r
- get { return _name; }\r
- set { _name = value; }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- /// <summary>Indicates that class should be treated as a task.</summary>\r
- /// <remarks>\r
- /// Attach this attribute to a subclass of Task to have NAnt be able\r
- /// to reconize it. The name should be short but must not confict\r
- /// with any other task already in use.\r
- /// </remarks>\r
- [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]\r
- public class TaskNameAttribute : Attribute {\r
-\r
- string _name;\r
-\r
- public TaskNameAttribute(string name) {\r
- _name = name;\r
- }\r
-\r
- public string Name {\r
- get { return _name; }\r
- set { _name = value; }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- public abstract class ValidatorAttribute : Attribute {\r
- public abstract string Validate(object value);\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
-\r
- /// <summary>\r
- /// Thrown whenever an error occurs during the build.\r
- /// </summary>\r
- public class BuildException : ApplicationException {\r
-\r
- private Location _location = Location.UnknownLocation;\r
-\r
- /// <summary>\r
- /// Constructs a build exception with no descriptive information.\r
- /// </summary>\r
- public BuildException() : base() {\r
- }\r
-\r
- /// <summary>\r
- /// Constructs an exception with a descriptive message.\r
- /// </summary>\r
- public BuildException(String message) : base(message) {\r
- }\r
-\r
- /// <summary>\r
- /// Constructs an exception with a descriptive message and an\r
- /// instance of the Exception that is the cause of the current Exception.\r
- /// </summary>\r
- public BuildException(String message, Exception e) : base(message, e) {\r
- }\r
-\r
- /// <summary>\r
- /// Constructs an exception with a descriptive message and location\r
- /// in the build file that caused the exception.\r
- /// </summary>\r
- /// <param name="location">Location in the build file where the exception occured.</param>\r
- public BuildException(String message, Location location) : base(message) {\r
- _location = location;\r
- }\r
-\r
- /// <summary>\r
- /// Constructs an exception with the given descriptive message, the\r
- /// location in the build file and an instance of the Exception that\r
- /// is the cause of the current Exception.\r
- /// </summary>\r
- /// <param name="message">The error message that explains the reason for the exception.</param>\r
- /// <param name="location">Location in the build file where the exception occured.</param>\r
- /// <param name="e">An instance of Exception that is the cause of the current Exception.</param>\r
- public BuildException(String message, Location location, Exception e) : base(message, e) {\r
- _location = location;\r
- }\r
-\r
- public override string Message {\r
- get {\r
- string message = base.Message;\r
-\r
- // only include location string if not empty\r
- string locationString = _location.ToString();\r
- if (locationString != String.Empty) {\r
- message = locationString + " " + message;\r
- }\r
- return message;\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-/*\r
-Examples:\r
-"**\*.class" matches all .class files/dirs in a directory tree.\r
-\r
-"test\a??.java" matches all files/dirs which start with an 'a', then two\r
-more characters and then ".java", in a directory called test.\r
-\r
-"**" matches everything in a directory tree.\r
-\r
-"**\test\**\XYZ*" matches all files/dirs that start with "XYZ" and where\r
-there is a parent directory called test (e.g. "abc\test\def\ghi\XYZ123").\r
-\r
-Example of usage:\r
-\r
-DirectoryScanner scanner = DirectoryScanner();\r
-scanner.Includes.Add("**\\*.class");\r
-scanner.Exlucdes.Add("modules\\*\\**");\r
-scanner.BaseDirectory = "test";\r
-scanner.Scan();\r
-foreach (string filename in GetIncludedFiles()) {\r
- Console.WriteLine(filename);\r
-}\r
-*/\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.IO;\r
- using System.Text;\r
- using System.Text.RegularExpressions;\r
-\r
- public class DirectoryScanner {\r
-\r
- string _baseDirectory = Environment.CurrentDirectory;\r
-\r
- // holds the nant patterns\r
- StringCollection _includes = new StringCollection();\r
- StringCollection _excludes = new StringCollection();\r
-\r
- // holds the nant patterns converted to regular expression patterns\r
- StringCollection _includePatterns = null;\r
- StringCollection _excludePatterns = null;\r
-\r
- // holds the result from a scan\r
- StringCollection _fileNames = null;\r
- StringCollection _directoryNames = null;\r
-\r
- public StringCollection Includes {\r
- get { return _includes; }\r
- }\r
-\r
- public StringCollection Excludes {\r
- get { return _excludes; }\r
- }\r
-\r
- public string BaseDirectory {\r
- get { return _baseDirectory; }\r
- set { _baseDirectory = value; }\r
- }\r
-\r
- public StringCollection FileNames {\r
- get {\r
- if (_fileNames == null) {\r
- Scan();\r
- }\r
- return _fileNames;\r
- }\r
- }\r
-\r
- public StringCollection DirectoryNames {\r
- get {\r
- if (_directoryNames == null) {\r
- Scan();\r
- }\r
- return _directoryNames;\r
- }\r
- }\r
-\r
- public void Scan() {\r
- _includePatterns = new StringCollection();\r
- foreach (string pattern in Includes) {\r
- _includePatterns.Add(ToRegexPattern(pattern));\r
- }\r
-\r
- _excludePatterns = new StringCollection();\r
- foreach (string pattern in Excludes) {\r
- _excludePatterns.Add(ToRegexPattern(pattern));\r
- }\r
-\r
- _fileNames = new StringCollection();\r
- _directoryNames = new StringCollection();\r
-\r
- ScanDirectory(Path.GetFullPath(BaseDirectory));\r
- }\r
-\r
- void ScanDirectory(string path) {\r
- // get info for the current directory\r
- DirectoryInfo currentDirectoryInfo = new DirectoryInfo(path);\r
-\r
- // scan subfolders\r
- foreach (DirectoryInfo directoryInfo in currentDirectoryInfo.GetDirectories()) {\r
- ScanDirectory(directoryInfo.FullName);\r
- }\r
-\r
- // scan files\r
- foreach (FileInfo fileInfo in currentDirectoryInfo.GetFiles()) {\r
- string filename = Path.Combine(path, fileInfo.Name);\r
- if (IsPathIncluded(filename)) {\r
- _fileNames.Add(filename);\r
- }\r
- }\r
-\r
- // Check current path last so that delete task will correctly\r
- // delete empty directories. This may *seem* like a special case\r
- // but it is more like formalizing something in a way that makes\r
- // writing the delete task easier :)\r
- if (IsPathIncluded(path)) {\r
- _directoryNames.Add(path);\r
- }\r
- }\r
-\r
- bool IsPathIncluded(string path) {\r
- bool included = false;\r
-\r
- // check path against includes\r
- foreach (string pattern in _includePatterns) {\r
- Match m = Regex.Match(path, pattern);\r
- if (m.Success) {\r
- included = true;\r
- break;\r
- }\r
- }\r
-\r
- // check path against excludes\r
- if (included) {\r
- foreach (string pattern in _excludePatterns) {\r
- Match m = Regex.Match(path, pattern);\r
- if (m.Success) {\r
- included = false;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- return included;\r
- }\r
-\r
- string ToRegexPattern(string nantPattern) {\r
-\r
- StringBuilder pattern = new StringBuilder(nantPattern);\r
-\r
- // NAnt patterns can use either / \ as a directory seperator.\r
- // We must replace both of these characters with Path.DirectorySeperatorChar\r
- pattern.Replace('/', Path.DirectorySeparatorChar);\r
- pattern.Replace('\\', Path.DirectorySeparatorChar);\r
-\r
- // Patterns MUST be full paths.\r
- if (!Path.IsPathRooted(pattern.ToString())) {\r
- pattern = new StringBuilder(Path.Combine(BaseDirectory, pattern.ToString()));\r
- }\r
-\r
- // The '\' character is a special character in regular expressions\r
- // and must be escaped before doing anything else.\r
- pattern.Replace(@"\", @"\\");\r
-\r
- // Escape the rest of the regular expression special characters.\r
- // NOTE: Characters other than . $ ^ { [ ( | ) * + ? \ match themselves.\r
- // TODO: Decide if ] and } are missing from this list, the above\r
- // list of characters was taking from the .NET SDK docs.\r
- pattern.Replace(".", @"\.");\r
- pattern.Replace("$", @"\$");\r
- pattern.Replace("^", @"\^");\r
- pattern.Replace("{", @"\{");\r
- pattern.Replace("[", @"\[");\r
- pattern.Replace("(", @"\(");\r
- pattern.Replace(")", @"\)");\r
- pattern.Replace("+", @"\+");\r
-\r
- // Special case directory seperator string under Windows.\r
- string seperator = Path.DirectorySeparatorChar.ToString();\r
- if (seperator == @"\") {\r
- seperator = @"\\";\r
- }\r
-\r
- // Convert NAnt pattern characters to regular expression patterns.\r
-\r
- // SPECIAL CASE: to match subdirectory OR current directory. If\r
- // we don't do this then we can write something like 'src/**/*.cs'\r
- // to match all the files ending in .cs in the src directory OR\r
- // subdirectories of src.\r
- pattern.Replace(seperator + "**", "(" + seperator + ".|)|");\r
-\r
- // | is a place holder for * to prevent it from being replaced in next line\r
- pattern.Replace("**", ".|");\r
- pattern.Replace("*", "[^" + seperator + "]*");\r
- pattern.Replace("?", "[^" + seperator + "]?");\r
- pattern.Replace('|', '*'); // replace place holder string\r
-\r
- // Help speed up the search\r
- pattern.Insert(0, '^'); // start of line\r
- pattern.Append('$'); // end of line\r
-\r
- return pattern.ToString();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.IO;\r
-\r
- public class FileSet {\r
-\r
- /// <summary>\r
- /// Used to determine if a file has a more recent last write time then the specified write time.\r
- /// </summary>\r
- /// <param name="fileNames">A collection of filenames to check last write times against.</param>\r
- /// <param name="targetLastWriteTime">The datetime to compare against.</param>\r
- /// <returns><c>True</c> if at least one file in <c>fileNames</c> has a last write time greater than <c>targetLastWriteTime</c>.</returns>\r
- public static bool MoreRecentLastWriteTime(StringCollection fileNames, DateTime targetLastWriteTime) {\r
- foreach (string fileName in fileNames) {\r
- FileInfo fileInfo = new FileInfo(fileName);\r
- if (!fileInfo.Exists) {\r
- return true;\r
- }\r
- if (fileInfo.LastWriteTime > targetLastWriteTime) {\r
- return true;\r
- }\r
- }\r
- return false;\r
- }\r
-\r
- // We can't just use the DirectoryScanner's includes/excludes collections\r
- // because when we do a Scan() we need to first expand any macros.\r
-\r
- StringCollection _includes = new StringCollection();\r
- StringCollection _excludes = new StringCollection();\r
- DirectoryScanner _scanner = null;\r
- string _baseDirectory;\r
- bool _includeAllByDefault;\r
- Task _task = null;\r
-\r
- public FileSet(bool includeAllByDefault) {\r
- IncludeAllByDefault = includeAllByDefault;\r
- Excludes.Add("**/CVS/*");\r
- Excludes.Add("**/.cvsignore");\r
- }\r
-\r
- /// <remarks>\r
- /// Will be automagically set in Task.AutoInitializeAttributes() if\r
- /// file set has TaskFileSetAttribute set on it.\r
- /// </remarks>\r
- // TODO: change this to IMacroExpander\r
- public Task Task {\r
- get { return _task; }\r
- set { _task = value; }\r
- }\r
-\r
- public string BaseDirectory {\r
- get { return _baseDirectory; }\r
- set { _baseDirectory = value; }\r
- }\r
-\r
- /// <summary>Determines if scan should produce everything or nothing\r
- /// if there are no Includes set. Default false.</summary>\r
- public bool IncludeAllByDefault {\r
- get { return _includeAllByDefault; }\r
- set { _includeAllByDefault = value; }\r
- }\r
-\r
- public StringCollection Includes {\r
- get { return _includes; }\r
- }\r
-\r
- public StringCollection Excludes {\r
- get { return _excludes; }\r
- }\r
-\r
- public void Scan() {\r
- // get project (only for expanding macros)\r
- Project expander = Task.Project;\r
-\r
- _scanner = new DirectoryScanner();\r
- _scanner.BaseDirectory = expander.GetFullPath(BaseDirectory);;\r
-\r
- foreach (string path in Includes) {\r
- _scanner.Includes.Add(expander.ExpandText(path));\r
- }\r
- if (Includes.Count <= 0 && IncludeAllByDefault) {\r
- _scanner.Includes.Add("**");\r
- }\r
-\r
- foreach (string path in Excludes) {\r
- _scanner.Excludes.Add(expander.ExpandText(path));\r
- }\r
-\r
- _scanner.Scan();\r
- }\r
-\r
- public StringCollection DirectoryNames {\r
- get {\r
- if (_scanner == null) {\r
- Scan();\r
- }\r
- return _scanner.DirectoryNames;\r
- }\r
- }\r
-\r
- public StringCollection FileNames {\r
- get {\r
- if (_scanner == null) {\r
- Scan();\r
- }\r
- return _scanner.FileNames;\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Ian MacLean (ian_maclean@another.com)\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
- using System;\r
- using System.IO;\r
-\r
- /// <summary>\r
- /// Stores the file name and line number in a file.\r
- /// </summary>\r
- public class Location {\r
- string _fileName;\r
- int _lineNumber;\r
- int _columnNumber;\r
-\r
- public static readonly Location UnknownLocation = new Location();\r
-\r
- /// <summary>\r
- /// Creates a location consisting of a file name and line number.\r
- ///</summary>\r
- public Location(string fileName, int lineNumber, int columnNumber) {\r
- Uri uri = new Uri(fileName);\r
- string strfileName = uri.LocalPath; // convert from URI syntax to local path\r
- Init(strfileName, lineNumber, columnNumber);\r
- }\r
-\r
- /// <summary>\r
- /// Creates a location consisting of a file name but no line number.\r
- ///</summary>\r
- public Location(string fileName) {\r
- Init(fileName, 0, 0);\r
- }\r
-\r
- /// <summary>\r
- /// Creates an "unknown" location.\r
- ///</summary>\r
- private Location() {\r
- Init(null, 0, 0);\r
- }\r
-\r
- /// <summary>\r
- /// Private Init function.\r
- ///</summary>\r
- private void Init(string fileName, int lineNumber, int columnNumber) {\r
- _fileName = fileName;\r
- _lineNumber = lineNumber;\r
- _columnNumber = columnNumber;\r
- }\r
-\r
- /// <summary>\r
- /// Returns the file name, line number and a trailing space. An error\r
- /// message can be appended easily. For unknown locations, returns\r
- /// an empty string.\r
- ///</summary>\r
- public override string ToString() {\r
- string message = "";\r
-\r
- if (_fileName != null) {\r
- message += _fileName;\r
-\r
- if (_lineNumber != 0) {\r
- message += ":";\r
- message += _lineNumber.ToString();\r
- }\r
-\r
- message += ":";\r
- }\r
-\r
- return message;\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Diagnostics;\r
- using System.IO;\r
- using System.Text.RegularExpressions;\r
-\r
- public class NAnt {\r
- public static int Main(string[] args) {\r
- int returnCode = 0;\r
-\r
- Log.IndentSize = 12;\r
-\r
- Project project = new Project();\r
-\r
- const string buildfileOption = "-buildfile:";\r
- const string basedirOption = "-basedir:";\r
- const string setOption = "-set:";\r
- const string helpOption = "-h"; // allow -h and -help\r
- const string verboseOption = "-verbose";\r
-\r
- bool showHelp = false;\r
-\r
- foreach (string arg in args) {\r
- if (arg.StartsWith(buildfileOption)) {\r
- project.BuildFileName = arg.Substring(buildfileOption.Length);\r
- } else if (arg.StartsWith(basedirOption)) {\r
- project.BaseDirectory = arg.Substring(basedirOption.Length);\r
- } else if (arg.StartsWith(basedirOption)) {\r
- project.BaseDirectory = arg.Substring(basedirOption.Length);\r
- } else if (arg.StartsWith(setOption)) {\r
- // TODO: implement user defined properties\r
- // user defined properties from command line or file should be\r
- // marked so that they cannot be overwritten by the build file\r
- // ie, once set they are set for the rest of the build.\r
- Match match = Regex.Match(arg, @"-set:(\w+)=(\w*)");\r
- if (match.Success) {\r
- string name = match.Groups[1].Value;\r
- string value = match.Groups[2].Value;\r
- project.Properties.AddReadOnly(name, value);\r
- }\r
- } else if (arg.StartsWith(helpOption)) {\r
- showHelp = true;\r
- } else if (arg.StartsWith(verboseOption)) {\r
- project.Verbose = true;\r
- } else if (arg.Length > 0) {\r
- // must be a target (or mistake ;)\r
- project.BuildTargets.Add(arg);\r
- }\r
- }\r
-\r
- // Get version information directly from assembly. This takes more\r
- // work but prevents the version numbers from getting out of sync.\r
- ProcessModule module = Process.GetCurrentProcess().MainModule;\r
- FileVersionInfo info = FileVersionInfo.GetVersionInfo(module.FileName);\r
- string programName = Path.GetFileNameWithoutExtension(info.FileName); // in case the user has renamed the program\r
-\r
- if (showHelp) {\r
- const int optionPadding = 23;\r
-\r
- Console.WriteLine("NAnt Version {0} Copyright (C) 2001 Gerry Shaw", info.FileMajorPart + "." + info.FileMinorPart + "." + info.FileBuildPart);\r
- Console.WriteLine("http://nant.sourceforge.net/");\r
- Console.WriteLine();\r
- Console.WriteLine("NAnt comes with ABSOLUTELY NO WARRANTY.");\r
- Console.WriteLine("This is free software, and you are welcome to redistribute it under certain");\r
- Console.WriteLine("conditions set out by the GNU General Public License. A copy of the license");\r
- Console.WriteLine("is available in the distribution package and from the NAnt web site.");\r
- Console.WriteLine();\r
- Console.WriteLine("usage: {0} [options] [target]", programName);\r
- Console.WriteLine();\r
- Console.WriteLine("options:");\r
- Console.WriteLine(" {0} use given buildfile", (buildfileOption + "<file>").PadRight(optionPadding));\r
- Console.WriteLine(" {0} set project base directory", (basedirOption + "<dir>").PadRight(optionPadding));\r
- Console.WriteLine(" {0} use value for given property", (setOption + "<property>=<value>").PadRight(optionPadding));\r
- Console.WriteLine(" {0} print this message", helpOption.PadRight(optionPadding));\r
- Console.WriteLine();\r
- Console.WriteLine("If no buildfile is specified the first file ending in .build will be used.");\r
- } else {\r
- if (!project.Run()) {\r
- Console.WriteLine("Try `{0} -help' for more information.", programName);\r
- returnCode = 1; // set return code to indicate an error occurred\r
- }\r
- }\r
- Log.Close();\r
- return returnCode;\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
- using System.Reflection;\r
- using System.Text.RegularExpressions;\r
- using System.Xml;\r
- using System.Xml.XPath;\r
- using System.Collections;\r
- using System.Collections.Specialized;\r
-\r
- /// <summary>\r
- /// Central representation of an NAnt project.\r
- /// </summary>\r
- public class Project {\r
-\r
- public static readonly string BuildFilePattern = "*.build";\r
-\r
- /// <summary>\r
- /// Finds the file name for the build file in the specified directory.\r
- /// </summary>\r
- /// <param name="directory">The directory to look for a build file. When in doubt use Environment.CurrentDirectory for directory.</param>\r
- /// <returns>The path to the build file or <c>null</c> if no build file could be found.</returns>\r
- public static string FindBuildFileName(string directory) {\r
- string buildFileName = null;\r
-\r
- // find first file ending in .build\r
- DirectoryInfo directoryInfo = new DirectoryInfo(directory);\r
- FileInfo[] files = directoryInfo.GetFiles(BuildFilePattern);\r
- if (files.Length > 0) {\r
- buildFileName = Path.Combine(directory, files[0].Name);\r
- }\r
- return buildFileName;\r
- }\r
-\r
- string _name;\r
- string _defaultTargetName;\r
- string _baseDirectory;\r
- string _buildFileName;\r
- bool _verbose = false;\r
-\r
- StringCollection _buildTargets = new StringCollection();\r
- TaskCollection _tasks = new TaskCollection();\r
- TargetCollection _targets = new TargetCollection();\r
- XPathTextPositionMap _positionMap; // created when Xml document is loaded\r
- TaskFactory _taskFactory; // created in constructor\r
- PropertyDictionary _properties = new PropertyDictionary();\r
-\r
- public Project() {\r
- _taskFactory = new TaskFactory(this);\r
- }\r
-\r
- /// <summary>\r
- /// The name of the project.\r
- /// </summary>\r
- public string Name {\r
- get { return _name; }\r
- set { _name = value; }\r
- }\r
-\r
- public string BaseDirectory {\r
- get { return _baseDirectory; }\r
- set { _baseDirectory = value; }\r
- }\r
-\r
- public string BuildFileName {\r
- get { return _buildFileName; }\r
- set { _buildFileName = value; }\r
- }\r
-\r
- /// <summary>\r
- /// When true tasks should output more output.\r
- /// </summary>\r
- public bool Verbose {\r
- get { return _verbose; }\r
- set { _verbose = value; }\r
- }\r
-\r
- /// <summary>\r
- /// The list of targets to built.\r
- /// </summary>\r
- /// <remarks>\r
- /// Targets are built in the order they appear in the collection. If\r
- /// the collection is empty the default target will be built.\r
- /// </remarks>\r
- public StringCollection BuildTargets {\r
- get { return _buildTargets; }\r
- }\r
-\r
- /// <summary>\r
- /// The list of tasks to perform before any targets executed.\r
- /// </summary>\r
- /// <remarks>\r
- /// Tasks are executed in the order they appear in the collection.\r
- /// </remarks>\r
- public TaskCollection Tasks {\r
- get { return _tasks; }\r
- }\r
-\r
- public PropertyDictionary Properties {\r
- get { return _properties; }\r
- }\r
-\r
- public TargetCollection Targets {\r
- get { return _targets; }\r
- }\r
-\r
- public bool Run() {\r
- bool buildResult = false;\r
- try {\r
- DateTime startTime = DateTime.Now;\r
-\r
- if (BaseDirectory == null) {\r
- BaseDirectory = Environment.CurrentDirectory;\r
- }\r
- BaseDirectory = Path.GetFullPath(BaseDirectory);\r
-\r
- if (BuildFileName == null || BuildFileName == String.Empty) {\r
- BuildFileName = FindBuildFileName(BaseDirectory);\r
- if (BuildFileName == null) {\r
- throw new BuildException(String.Format("Could not find a '{0}' file in '{1}'", BuildFilePattern, BaseDirectory));\r
- }\r
- }\r
-\r
- Log.WriteLine("Buildfile: {0}", BuildFileName);\r
- if (Verbose) {\r
- Log.WriteLine("Base Directory: {0}", BaseDirectory);\r
- }\r
-\r
- XmlDocument doc = new XmlDocument();\r
- try {\r
- doc.Load(BuildFileName);\r
- // TODO: validate against xsd schema\r
- } catch (XmlException e) {\r
- throw new BuildException(String.Format("Could not load '{0}'", BuildFileName), e);\r
- }\r
-\r
- Initialize(doc);\r
- Properties.Add("nant.buildfile", BuildFileName);\r
-\r
- Execute();\r
-\r
- Log.WriteLine();\r
- Log.WriteLine("BUILD SUCCEEDED");\r
-\r
- TimeSpan buildTime = DateTime.Now - startTime;\r
- Log.WriteLine();\r
- Log.WriteLine("Total time: {0} seconds", (int) buildTime.TotalSeconds);\r
-\r
- buildResult = true;\r
- } catch (BuildException e) {\r
- Log.WriteLine();\r
- Log.WriteLine("BUILD FAILED");\r
- Log.WriteLine(e.Message);\r
- if (e.InnerException != null) {\r
- Log.WriteLine(e.InnerException.Message);\r
- }\r
- } catch (Exception e) {\r
- // all other exceptions should have been caught\r
- Log.WriteLine();\r
- Log.WriteLine("INTERNAL ERROR");\r
- Log.WriteLine(e.ToString());\r
- }\r
- return buildResult;\r
- }\r
-\r
- public int AddTasks(string assemblyPath) {\r
-\r
- Assembly assembly;\r
- if (assemblyPath == null) {\r
- assembly = Assembly.GetExecutingAssembly();\r
- } else {\r
- assembly = Assembly.LoadFrom(assemblyPath);\r
- }\r
-\r
- int taskCount = 0;\r
- foreach(Type type in assembly.GetTypes()) {\r
- if (type.IsSubclassOf(typeof(Task)) && !type.IsAbstract) {\r
- if (_taskFactory.Builders.Add(new TaskBuilder(type.FullName, assemblyPath))) {\r
- taskCount++;\r
- }\r
- }\r
- }\r
- return taskCount;\r
- }\r
-\r
- public void Initialize(XmlDocument doc) {\r
-\r
- Name = doc.SelectSingleNode("project/@name").Value;\r
-\r
- // make it possible for user to override this value\r
- if (BaseDirectory == null) {\r
- BaseDirectory = doc.SelectSingleNode("project/@basedir").Value;\r
- }\r
-\r
- // used only if BuildTargets collection is empty\r
- _defaultTargetName = doc.SelectSingleNode("project/@default").Value;\r
-\r
- // initialize builtin tasks\r
- AddTasks(null);\r
-\r
- // init static built in properties\r
- Properties.Add("nant.project.name", Name);\r
- Properties.Add("nant.base.dir", BaseDirectory);\r
- Properties.Add("nant.default.name", _defaultTargetName);\r
-\r
- // add all environment variables\r
- IDictionary variables = Environment.GetEnvironmentVariables();\r
- foreach (string name in variables.Keys) {\r
- string value = (string) variables[name];\r
- Properties.Add("nant.env." + name, value);\r
- }\r
-\r
- // Load line Xpath to linenumber array\r
- _positionMap = new XPathTextPositionMap(doc.BaseURI);\r
-\r
- // process all the non-target nodes (these are global tasks for the project)\r
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");\r
- foreach (XmlNode taskNode in taskList) {\r
-\r
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location\r
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);\r
-\r
- Task task = CreateTask(taskNode);\r
- if (task != null) {\r
- Tasks.Add(task);\r
- }\r
- }\r
-\r
- // execute global tasks now - before anything else\r
- // this lets us include tasks that do things like add more tasks\r
- foreach (Task task in Tasks) {\r
- task.Execute();\r
- }\r
-\r
- // process all the targets\r
- XmlNodeList targetList = doc.SelectNodes("project/target");\r
- foreach (XmlNode targetNode in targetList) {\r
- Target target = new Target(this);\r
- target.Initialize(targetNode);\r
- Targets.Add(target);\r
- }\r
- }\r
-\r
- public void Execute() {\r
- if (BuildTargets.Count == 0) {\r
- BuildTargets.Add(_defaultTargetName);\r
- }\r
-\r
- foreach(string targetName in BuildTargets) {\r
- Execute(targetName);\r
- }\r
- }\r
-\r
- public void Execute(string targetName) {\r
- Target target = Targets.Find(targetName);\r
- if (target == null) {\r
- throw new BuildException(String.Format("unknown target '{0}'", targetName));\r
- }\r
- target.Execute();\r
- }\r
-\r
- public Task CreateTask(XmlNode taskNode) {\r
- return CreateTask(taskNode, null);\r
- }\r
-\r
- public Task CreateTask(XmlNode taskNode, Target target) {\r
- Task task = _taskFactory.CreateTask(taskNode, target);\r
- if (task != null) {\r
- // save task location in case of error\r
- TextPosition pos = _positionMap.GetTextPosition(taskNode);\r
-\r
- // initialize the task\r
- task.Initialize(taskNode, new Location(taskNode.BaseURI, pos.Line, pos.Column));\r
- }\r
- return task;\r
- }\r
-\r
- public string ExpandText(string input) {\r
- string output = input;\r
- if (input != null) {\r
- const string pattern = @"\$\{([^\}]*)\}";\r
- foreach (Match m in Regex.Matches(input, pattern)) {\r
- if (m.Length > 0) {\r
-\r
- string token = m.ToString();\r
- string propertyName = m.Groups[1].Captures[0].Value;\r
- string propertyValue = Properties[propertyName];\r
-\r
- if (propertyValue != null) {\r
- output = output.Replace(token, propertyValue);\r
- }\r
- }\r
- }\r
- }\r
- return output;\r
- }\r
-\r
- public string GetFullPath(string path) {\r
- string baseDir = ExpandText(BaseDirectory);\r
-\r
- if (path != null) {\r
- if (!Path.IsPathRooted(path)) {\r
- path = Path.Combine(baseDir, path);\r
- }\r
- } else {\r
- path = baseDir;\r
- }\r
- return Path.GetFullPath(path);\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System.Collections;\r
- using System.Collections.Specialized;\r
-\r
- public class PropertyDictionary : DictionaryBase {\r
-\r
- /// <summary>\r
- /// Maintains a list of the property names that are readonly.\r
- /// </summary>\r
- StringCollection _readOnlyProperties = new StringCollection();\r
-\r
- /// <summary>\r
- /// Adds a property that cannot be changed.\r
- /// </summary>\r
- /// <remarks>\r
- /// Properties added with this method can never be changed. Note that\r
- /// they are removed if the <c>Clear</c> method is called.\r
- /// </remarks>\r
- /// <param name="name">Name of property</param>\r
- /// <param name="value">Value of property</param>\r
- public void AddReadOnly(string name, string value) {\r
- if (!_readOnlyProperties.Contains(name)) {\r
- _readOnlyProperties.Add(name);\r
- Dictionary.Add(name, value);\r
- }\r
- }\r
-\r
- /// <summary>\r
- /// Adds a property to the collection.\r
- /// </summary>\r
- /// <param name="name">Name of property</param>\r
- /// <param name="value">Value of property</param>\r
- public void Add(string name, string value) {\r
- if (!_readOnlyProperties.Contains(name)) {\r
- Dictionary.Add(name, value);\r
- }\r
- }\r
-\r
- public string this[string name] {\r
- get { return (string) Dictionary[(object) name]; }\r
- set {\r
- if (!_readOnlyProperties.Contains(name)) {\r
- Dictionary[name] = value;\r
- }\r
- }\r
- }\r
-\r
- protected override void OnClear() {\r
- _readOnlyProperties.Clear();\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.Xml;\r
-\r
- public class Target {\r
-\r
- string _name;\r
- Project _project;\r
- bool _hasExecuted = false;\r
- TaskCollection _tasks = new TaskCollection();\r
- StringCollection _dependencies = new StringCollection();\r
-\r
- public Target(Project project) {\r
- Project = project;\r
- }\r
-\r
- public string Name {\r
- get { return _name; }\r
- set { _name = value; }\r
- }\r
-\r
- public Project Project {\r
- get { return _project; }\r
- set { _project = value; }\r
- }\r
-\r
- public bool HasExecuted {\r
- get { return _hasExecuted; }\r
- }\r
-\r
- public TaskCollection Tasks {\r
- get { return _tasks; }\r
- }\r
-\r
- public StringCollection Dependencies {\r
- get { return _dependencies; }\r
- }\r
-\r
- public void Initialize(XmlNode targetNode) {\r
- // get target name\r
- XmlNode nameNode = targetNode.SelectSingleNode("@name");\r
- if (nameNode == null) {\r
- // TODO: add Location to exception\r
- throw new BuildException("target must have a name attribute");\r
- }\r
- Name = nameNode.Value;\r
-\r
- // add dependicies\r
- XmlNode dependsNode = targetNode.SelectSingleNode("@depends");\r
- if (dependsNode != null) {\r
- string depends = dependsNode.Value;\r
- foreach (string str in depends.Split(new char[]{','})) {\r
- string dependency = str.Trim();\r
- if (dependency.Length > 0) {\r
- Dependencies.Add(dependency);\r
- }\r
- }\r
- }\r
-\r
- // select all the non-target nodes (these are global tasks for the project)\r
- XmlNodeList taskList = targetNode.SelectNodes("*");\r
- foreach (XmlNode taskNode in taskList) {\r
- Task task = Project.CreateTask(taskNode, this);\r
- if (task != null) {\r
- Tasks.Add(task);\r
- }\r
- }\r
- }\r
-\r
- public void Execute() {\r
- if (!HasExecuted) {\r
- try {\r
- foreach (string targetName in Dependencies) {\r
- Target target = Project.Targets.Find(targetName);\r
- if (target == null) {\r
- // TODO: add Location to exception\r
- throw new BuildException(String.Format("unknown dependent target '{0}' of target '{1}'", targetName, Name));\r
- }\r
- target.Execute();\r
- }\r
-\r
- Log.WriteLine();\r
- Log.WriteLine("{0}:", Name);\r
- foreach (Task task in Tasks) {\r
- task.Execute();\r
- }\r
- } finally {\r
- _hasExecuted = true;\r
- }\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections;\r
-\r
- public class TargetCollection : ArrayList {\r
-\r
- public Target Find(string targetName) {\r
- foreach(Target target in this) {\r
- if (target.Name == targetName)\r
- return target;\r
- }\r
- return null;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Mike Krueger (mike@icsharpcode.net)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
- using System.Xml;\r
-\r
- public abstract class Task {\r
-\r
- /// <summary>Gets and sets how much spacing log prefix names will be padded.</summary>\r
- /// <remarks>\r
- /// Includes characters for a space after the name and the [ ] brackets. Default is 12.\r
- /// </remarks>\r
- public static int LogPrefixPadding = Log.IndentSize;\r
-\r
- Location _location = Location.UnknownLocation;\r
- Target _target = null;\r
- Project _project = null;\r
-\r
- /// <summary>\r
- /// Location in build file where task is defined.\r
- /// </summary>\r
- protected Location Location {\r
- get { return _location; }\r
- set { _location = value; }\r
- }\r
-\r
- public string Name {\r
- get {\r
- string name = null;\r
- TaskNameAttribute taskName = (TaskNameAttribute) Attribute.GetCustomAttribute(GetType(), typeof(TaskNameAttribute));\r
- if (taskName != null) {\r
- name = taskName.Name;\r
- }\r
- return name;\r
- }\r
- }\r
-\r
- public string LogPrefix {\r
- get {\r
- string prefix = "[" + Name + "] ";\r
- return prefix.PadLeft(LogPrefixPadding);\r
- }\r
- }\r
-\r
- public Target Target {\r
- get { return _target; }\r
- set { _target = value; }\r
- }\r
-\r
- public Project Project {\r
- get { return _project; }\r
- set { _project = value; }\r
- }\r
-\r
- protected void AutoInitializeAttributes(XmlNode taskNode) {\r
-\r
- // TODO: BooleanValidatorAttribute and Int32ValidatorAttribute implementation in Task\r
-\r
- // Go down the inheritance tree to find the private fields in the object.\r
- // We are looking for task attributes to initialize.\r
- Type currentType = GetType();\r
- while (currentType != typeof(object)) {\r
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);\r
- foreach (FieldInfo fieldInfo in fieldInfoArray) {\r
-\r
- // process TaskAttribute attributes\r
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));\r
- if (taskAttribute != null) {\r
-\r
- // get value from xml file\r
- XmlNode node = taskNode.SelectSingleNode("@" + taskAttribute.Name);\r
-\r
- // check if its required\r
- if (node == null && taskAttribute.Required) {\r
- // TODO: add Location to exception\r
- throw new BuildException(String.Format("{0} is a required attribute.", taskAttribute.Name), Location);\r
- }\r
-\r
- if (node != null) {\r
- fieldInfo.SetValue(this, Convert.ChangeType(node.Value, fieldInfo.FieldType));\r
- }\r
- }\r
-\r
- // process TaskFileSet attributes\r
- TaskFileSetAttribute fileSetAttribute = (TaskFileSetAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskFileSetAttribute));\r
- if (fileSetAttribute != null) {\r
- // have file set initialize itself\r
- FileSet fileSet = (FileSet) fieldInfo.GetValue(this);\r
-\r
- // set task fileset belongs to\r
- fileSet.Task = this;\r
-\r
- // load values from build file\r
- XmlNode fileSetNode = taskNode.SelectSingleNode(fileSetAttribute.Name);\r
- if (fileSetNode != null) {\r
-\r
- XmlNode baseDirectoryNode = fileSetNode.SelectSingleNode("@basedir");\r
- if (baseDirectoryNode != null) {\r
- fileSet.BaseDirectory = baseDirectoryNode.Value;\r
- }\r
-\r
- foreach (XmlNode node in fileSetNode.SelectNodes("includes")) {\r
- string pathname = node.SelectSingleNode("@name").Value;\r
- fileSet.Includes.Add(pathname);\r
- }\r
-\r
- foreach (XmlNode node in fileSetNode.SelectNodes("excludes")) {\r
- fileSet.Excludes.Add(node.SelectSingleNode("@name").Value);\r
- }\r
- }\r
- }\r
- }\r
- currentType = currentType.BaseType;\r
- }\r
- }\r
-\r
- protected void AutoExpandAttributes() {\r
-\r
- // Go down the inheritance tree to find the private fields in the object.\r
- // We are looking for task attributes to initialize.\r
- Type currentType = GetType();\r
- while (currentType != typeof(object)) {\r
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);\r
- foreach (FieldInfo fieldInfo in fieldInfoArray) {\r
-\r
- // proces string parameters\r
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));\r
- if (taskAttribute != null) {\r
- if (taskAttribute.ExpandText) {\r
- string value = (string) fieldInfo.GetValue(this);\r
- value = Project.ExpandText(value);\r
- fieldInfo.SetValue(this, value);\r
- }\r
-\r
- // if a field also has a validator attribute then ensure that value is correct\r
- ValidatorAttribute[] validators = (ValidatorAttribute[]) Attribute.GetCustomAttributes(fieldInfo, typeof(ValidatorAttribute));\r
- foreach (ValidatorAttribute validator in validators) {\r
- string errorMessage = validator.Validate(fieldInfo.GetValue(this));\r
- if (errorMessage != null) {\r
- throw new BuildException(String.Format("Error processing '{0}' attribute in <{1}> task: {2}", taskAttribute.Name, Name, errorMessage), Location);\r
- }\r
- }\r
- }\r
- }\r
- currentType = currentType.BaseType;\r
- }\r
- }\r
-\r
- public void Initialize(XmlNode taskNode) {\r
- Initialize(taskNode, null);\r
- }\r
-\r
- public void Initialize(XmlNode taskNode, Location location) {\r
- if (location != null) {\r
- _location = location;\r
- }\r
- AutoInitializeAttributes(taskNode);\r
- InitializeTask(taskNode);\r
- }\r
-\r
- public void Execute() {\r
- AutoExpandAttributes();\r
- ExecuteTask();\r
- }\r
-\r
- protected virtual void InitializeTask(XmlNode taskNode) {\r
- }\r
-\r
- protected abstract void ExecuteTask();\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Reflection;\r
-\r
- public class TaskBuilder {\r
- \r
- string _className;\r
- string _assemblyFileName;\r
- string _taskName;\r
-\r
- public TaskBuilder(string className)\r
- : this(className, null) {\r
- }\r
-\r
- public TaskBuilder(string className, string assemblyFileName) {\r
- _className = className;\r
- _assemblyFileName = assemblyFileName;\r
-\r
- // get task name from attribute\r
- Assembly assembly = GetAssembly();\r
- TaskNameAttribute taskNameAttribute = (TaskNameAttribute) Attribute.GetCustomAttribute(assembly.GetType(ClassName), typeof(TaskNameAttribute));\r
- _taskName = taskNameAttribute.Name;\r
- }\r
-\r
- public string ClassName {\r
- get { return _className; }\r
- }\r
-\r
- public string AssemblyFileName {\r
- get { return _assemblyFileName; }\r
- }\r
-\r
- public string TaskName {\r
- get { return _taskName; }\r
- }\r
-\r
- private Assembly GetAssembly() {\r
- Assembly assembly;\r
- if (AssemblyFileName == null) {\r
- assembly = Assembly.GetExecutingAssembly();\r
- } else {\r
- assembly = Assembly.LoadFrom(AssemblyFileName);\r
- }\r
- return assembly;\r
- }\r
-\r
- public Task CreateTask(Project project, Target target) {\r
- Task task;\r
- try {\r
- Assembly assembly = GetAssembly();\r
-\r
- // create instance (ignore case)\r
- task = (Task) assembly.CreateInstance(ClassName, true);\r
-\r
- // set default values\r
- task.Project = project;\r
- task.Target = target;\r
- } catch (Exception) {\r
- task = null;\r
- }\r
- return task;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections;\r
-\r
- public class TaskBuilderCollection : ArrayList {\r
-\r
- public bool Add(TaskBuilder builder) {\r
- // prevent adding duplicate builders with the name task name\r
- bool taskAdded = false;\r
- if (GetBuilderForTask(builder.TaskName) == null) {\r
- base.Add(builder);\r
- taskAdded = true;\r
- }\r
- return taskAdded;\r
- }\r
-\r
- public TaskBuilder GetBuilderForTask(string taskName) {\r
- foreach (TaskBuilder builder in this) {\r
- if (builder.TaskName == taskName) {\r
- return builder;\r
- }\r
- }\r
- return null;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System.Collections;\r
-\r
- public class TaskCollection : ArrayList {\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Xml;\r
-\r
- internal class TaskFactory {\r
-\r
- TaskBuilderCollection _builders = new TaskBuilderCollection();\r
- Project _project;\r
-\r
- public TaskFactory(Project project) {\r
- Project = project;\r
- }\r
-\r
- public TaskBuilderCollection Builders {\r
- get { return _builders; }\r
- }\r
-\r
- public Project Project {\r
- get { return _project; }\r
- set { _project = value; }\r
- }\r
-\r
- public Task CreateTask(XmlNode taskNode, Target target) {\r
- string taskName = taskNode.Name;\r
- Task task = null;\r
-\r
- TaskBuilder builder = Builders.GetBuilderForTask(taskName);\r
- if (builder != null) {\r
- task = builder.CreateTask(Project, target);\r
- } else {\r
- throw new BuildException(String.Format("unknown task <{0}> in target <{1}>", taskName, target.Name));\r
- }\r
-\r
- return task;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.Diagnostics;\r
- using System.IO;\r
- using System.Xml;\r
-\r
- [TaskName("call")]\r
- public class CallTask : Task {\r
-\r
- [TaskAttribute("target", Required=true)]\r
- string _target = null;\r
-\r
- // Attribute properties\r
- public string TargetName { get { return _target; } }\r
-\r
- protected override void ExecuteTask() {\r
- Project.Execute(TargetName);\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * CompilerBase.cs (WriteOption): New virtual method. The default
- implementation writes CSC-style command line options, but it can
- be overridden in derived class to write mcs-style command line
- arguments.
- (ExecuteTask): Use the new virtual `WriteOption' method to write
- options.
-
- * CscTask.cs (WriteOptions): Use the new `WriteOption' method.
-
- * McsTask.cs: New file.
-
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Mike Krueger (mike@icsharpcode.net)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.Diagnostics;\r
- using System.IO;\r
-\r
- public abstract class CompilerBase : ExternalProgramBase {\r
-\r
- string _responseFileName;\r
-\r
- // Microsoft common compiler options\r
- [TaskAttribute("output", Required=true)]\r
- string _output = null;\r
-\r
- [TaskAttribute("target", Required=true)]\r
- string _target = null;\r
-\r
- [TaskAttribute("debug")]\r
- [BooleanValidator()]\r
- string _debug = Boolean.FalseString;\r
-\r
- [TaskAttribute("define")]\r
- string _define = null;\r
-\r
- [TaskAttribute("win32icon")]\r
- string _win32icon = null;\r
-\r
- [TaskFileSet("references")]\r
- FileSet _references = new FileSet(false);\r
-\r
- [TaskFileSet("resources")]\r
- FileSet _resources = new FileSet(false);\r
-\r
- [TaskFileSet("modules")]\r
- FileSet _modules = new FileSet(false);\r
-\r
- [TaskFileSet("sources")]\r
- FileSet _sources = new FileSet(true); // include all by default\r
-\r
- public string Output { get { return _output; } }\r
- public string OutputTarget { get { return _target; } }\r
- public bool Debug { get { return Convert.ToBoolean(_debug); } }\r
- public string Define { get { return _define; } }\r
- public string Win32Icon { get { return _win32icon; } }\r
- public FileSet References { get { return _references; } }\r
- public FileSet Resources { get { return _resources; } }\r
- public FileSet Modules { get { return _modules; } }\r
- public FileSet Sources { get { return _sources; } }\r
-\r
- public override string ProgramFileName { get { return Name; } }\r
- public override string ProgramArguments { get { return "@" + _responseFileName; } }\r
-\r
- protected virtual void WriteOptions(TextWriter writer) {\r
- }\r
-\r
- protected virtual void WriteOption(TextWriter writer, string name) {\r
- writer.WriteLine("/{0}", name);\r
- }\r
-\r
- protected virtual void WriteOption(TextWriter writer, string name, string arg) {\r
- writer.WriteLine("/{0}:{1}", name, arg);\r
- }\r
-\r
- protected string GetOutputPath() {\r
- return Path.GetFullPath(Path.Combine(BaseDirectory, Project.ExpandText(Output)));\r
- }\r
-\r
- protected virtual bool NeedsCompiling() {\r
- // return true as soon as we know we need to compile\r
-\r
- FileInfo outputFileInfo = new FileInfo(GetOutputPath());\r
- if (!outputFileInfo.Exists) {\r
- return true;\r
- }\r
-\r
- if (FileSet.MoreRecentLastWriteTime(Sources.FileNames, outputFileInfo.LastWriteTime)) {\r
- return true;\r
- }\r
- if (FileSet.MoreRecentLastWriteTime(References.FileNames, outputFileInfo.LastWriteTime)) {\r
- return true;\r
- }\r
- if (FileSet.MoreRecentLastWriteTime(Modules.FileNames, outputFileInfo.LastWriteTime)) {\r
- return true;\r
- }\r
-\r
- // if we made it here then we don't have to recompile\r
- return false;\r
- }\r
-\r
- protected override void ExecuteTask() {\r
- if (NeedsCompiling()) {\r
- // create temp response file to hold compiler options\r
- _responseFileName = Path.GetTempFileName();\r
- StreamWriter writer = new StreamWriter(_responseFileName);\r
-\r
- try {\r
- if (References.BaseDirectory == null) {\r
- References.BaseDirectory = BaseDirectory;\r
- }\r
- if (Modules.BaseDirectory == null) {\r
- Modules.BaseDirectory = BaseDirectory;\r
- }\r
- if (Sources.BaseDirectory == null) {\r
- Sources.BaseDirectory = BaseDirectory;\r
- }\r
-\r
- Log.WriteLine(LogPrefix + "Compiling {0} files to {1}", Sources.FileNames.Count, GetOutputPath());\r
-\r
- // specific compiler options\r
- WriteOptions(writer);\r
-\r
- // Microsoft common compiler options\r
- WriteOption(writer, "nologo");\r
- WriteOption(writer, "target", OutputTarget);\r
- WriteOption(writer, "out", GetOutputPath());\r
- if (Debug) {\r
- WriteOption(writer, "debug");\r
- WriteOption(writer, "define", "DEBUG");\r
- WriteOption(writer, "define", "TRACE");\r
- }\r
- if (Define != null) {\r
- WriteOption(writer, "define", Define);\r
- }\r
- if (Win32Icon != null) {\r
- WriteOption(writer, "win32icon", Win32Icon);\r
- }\r
- foreach (string fileName in References.FileNames) {\r
- WriteOption(writer, "reference", fileName);\r
- }\r
- foreach (string fileName in Modules.FileNames) {\r
- WriteOption(writer, "addmodule", fileName);\r
- }\r
- foreach (string fileName in Resources.FileNames) {\r
- WriteOption(writer, "resource", fileName);\r
- }\r
- foreach (string fileName in Sources.FileNames) {\r
- writer.WriteLine(fileName);\r
- }\r
- // Make sure to close the response file otherwise contents\r
- // will not be written to disc and EXecuteTask() will fail.\r
- writer.Close();\r
-\r
- if (Verbose) {\r
- // display response file contents\r
- Log.WriteLine(LogPrefix + "Contents of " + _responseFileName);\r
- /*\r
- StreamReader reader = File.OpenText(_responseFileName);\r
- string line = reader.ReadLine();\r
- while (line != null) {\r
- Log.WriteLine(LogPrefix + " " + line);\r
- line = reader.ReadLine();\r
- }\r
- reader.Close();\r
- */\r
-\r
- StreamReader reader = File.OpenText(_responseFileName);\r
- Log.WriteLine(reader.ReadToEnd());\r
- reader.Close();\r
-\r
- }\r
-\r
- // call base class to do the work\r
- base.ExecuteTask();\r
-\r
- } finally {\r
- // make sure we delete response file even if an exception is thrown\r
- writer.Close(); // make sure stream is closed or file cannot be deleted\r
- File.Delete(_responseFileName);\r
- _responseFileName = null;\r
- }\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
- using System.Xml;\r
- using System.Text;\r
- using System.Collections;\r
- using System.Collections.Specialized;\r
-\r
- [TaskName("copy")]\r
- public class CopyTask : Task {\r
-\r
- [TaskAttribute("file")]\r
- string _sourceFile = null;\r
-\r
- [TaskAttribute("tofile")]\r
- string _toFile = null;\r
-\r
- [TaskAttribute("todir")]\r
- string _toDirectory = null;\r
-\r
- [TaskAttribute("filtering")]\r
- [BooleanValidator()]\r
- string _filtering = Boolean.FalseString;\r
-\r
- [TaskAttribute("flatten")]\r
- [BooleanValidator()]\r
- string _flatten = Boolean.FalseString;\r
-\r
- [TaskAttribute("includeEmptyDirs")]\r
- [BooleanValidator()]\r
- string _includeEmptyDirs = Boolean.FalseString;\r
-\r
- [TaskFileSet("fileset")]\r
- FileSet _fileset = new FileSet(true); // include all by default\r
-\r
- [TaskAttribute("overwrite")]\r
- [BooleanValidator()]\r
- string _overwrite = Boolean.FalseString;\r
-\r
- [TaskAttribute("verbose")]\r
- [BooleanValidator()]\r
- string _verbose = Boolean.FalseString;\r
-\r
- [TaskAttribute("preserveLastModified")]\r
- [BooleanValidator()]\r
- string _preserveLastModified = Boolean.FalseString;\r
-\r
- Hashtable _fileCopyMap = new Hashtable();\r
-\r
- public string SourceFile { get { return _sourceFile; } }\r
- public string ToFile { get { return _toFile; } }\r
- public string ToDirectory { get { return _toDirectory; } }\r
- public bool Filtering { get { return Convert.ToBoolean(_filtering); } }\r
- public bool Flatten { get { return Convert.ToBoolean(_flatten); } }\r
- public bool IncludeEmptyDirs { get { return Convert.ToBoolean(_includeEmptyDirs); } }\r
- public bool Overwrite { get { return Convert.ToBoolean(_overwrite); } }\r
- public bool PreserveLastModified{ get { return Convert.ToBoolean(_preserveLastModified); } }\r
- public FileSet CopyFileSet { get { return _fileset; } }\r
-\r
- public bool Verbose { \r
- get {\r
- return (Project.Verbose || Convert.ToBoolean(_verbose));\r
- } \r
- }\r
-\r
- protected Hashtable FileCopyMap {\r
- get { return _fileCopyMap; }\r
- }\r
-\r
- /// <summary>\r
- /// Actually does the file (and possibly empty directory) copies.\r
- /// </summary>\r
- protected virtual void DoFileOperations() {\r
- int fileCount = FileCopyMap.Keys.Count;\r
- if (fileCount > 0) {\r
- if (ToDirectory != null) {\r
- Log.WriteLine(LogPrefix + "Copying {0} files to {1}", fileCount, Project.GetFullPath(ToDirectory));\r
- } else {\r
- Log.WriteLine(LogPrefix + "Copying {0} files", fileCount);\r
- }\r
-\r
- // loop thru our file list\r
- foreach (string sourcePath in FileCopyMap.Keys) {\r
- string dstPath = (string)FileCopyMap[sourcePath];\r
- if (sourcePath == dstPath) {\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "Skipping self-copy of {0}" + sourcePath);\r
- }\r
- continue;\r
- }\r
-\r
- try {\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "Copying {0} to {1}", sourcePath, dstPath);\r
- }\r
-\r
- // create directory if not present\r
- string dstDirectory = Path.GetDirectoryName(dstPath);\r
- if (!Directory.Exists(dstDirectory)) {\r
- Directory.CreateDirectory(dstDirectory);\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "Created directory {0}", dstDirectory);\r
- }\r
- }\r
-\r
- File.Copy(sourcePath, dstPath, true);\r
- } catch (IOException ioe) {\r
- string msg = String.Format("Cannot copy {0} to {1}", sourcePath, dstPath);\r
- throw new BuildException(msg, Location, ioe);\r
- }\r
- }\r
- }\r
-\r
- // TODO: handle empty directories in the fileset, refer to includeEmptyDirs attribute at\r
- // http://jakarta.apache.org/ant/manual/CoreTasks/copy.html\r
- }\r
-\r
- protected override void ExecuteTask() {\r
-\r
- string dstDirectoryPath = Project.GetFullPath(ToDirectory);\r
- string srcFilePath = Project.GetFullPath(SourceFile);\r
- FileInfo srcInfo = new FileInfo(srcFilePath);\r
-\r
- string dstFilePath;\r
- if (ToFile == null) {\r
- dstFilePath = dstDirectoryPath + Path.DirectorySeparatorChar + srcInfo.Name;\r
- } else {\r
- dstFilePath = Project.GetFullPath(ToFile);\r
- }\r
-\r
- FileInfo dstInfo = new FileInfo(dstFilePath);\r
- if (SourceFile != null) {\r
- if (srcInfo.Exists) {\r
- // do the outdated check\r
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);\r
-\r
- if (Overwrite || outdated) {\r
- // add to a copy map of absolute verified paths\r
- FileCopyMap.Add(srcFilePath, dstFilePath);\r
- }\r
- } else {\r
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);\r
- }\r
- } else {\r
- // get the complete path of the base directory of the fileset, ie, c:\work\nant\src\r
- string srcBasePath = Project.GetFullPath(CopyFileSet.BaseDirectory);\r
- string dstBasePath = Project.GetFullPath(ToDirectory);\r
-\r
- // if source file not specified use fileset\r
- foreach (string pathname in CopyFileSet.FileNames) {\r
- // replace the fileset path with the destination path\r
- // NOTE: big problems could occur if the file set base dir is rooted on a different drive\r
- string dstPath = pathname.Replace(srcBasePath, dstBasePath);\r
-\r
- srcInfo = new FileInfo(pathname);\r
- dstInfo = new FileInfo(dstPath);\r
-\r
- if (srcInfo.Exists) {\r
- // do the outdated check\r
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);\r
-\r
- if (Overwrite || outdated) {\r
- FileCopyMap.Add(pathname, dstPath);\r
- }\r
- } else {\r
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);\r
- }\r
- }\r
- }\r
-\r
- // do all the actual copy operations now...\r
- DoFileOperations();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Mike Krueger (mike@icsharpcode.net)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("csc")]\r
- public class CscTask : CompilerBase {\r
-\r
- // C# specific compiler options\r
- [TaskAttribute("doc")]\r
- string _doc = null;\r
-\r
- protected override void WriteOptions(TextWriter writer) {\r
- WriteOption(writer, "fullpaths");\r
- if (_doc != null) {\r
- WriteOption(writer, "doc", _doc);\r
- }\r
- }\r
-\r
- protected override bool NeedsCompiling() {\r
- // TODO: add checks for any referenced files OR return false to always compile\r
- return base.NeedsCompiling();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-\r
-// TODO: move this into the task documentation (once we figure out how tasks\r
-// should be documented - xml??\r
-/*\r
-\r
-verbose: Show name of each deleted file ("true"/"false"). Default is "false"\r
-when omitted.\r
-\r
-quiet: If the file does not exist, do not display a diagnostic message or\r
-modify the exit status to reflect an error (unless Ant has been invoked with\r
-the -verbose or -debug switches). This means that if a file or directory cannot\r
-be deleted, then no error is reported. This setting emulates the -f option to\r
-the Unix "rm" command. ("true"/"false"). Default is "false" meaning things are\r
-"noisy". Setting this to true, implies setting failonerror to false.\r
-\r
-failonerror: This flag (which is only of relevance if 'quiet' is false),\r
-controls whether an error -such as a failure to delete a file- stops the build\r
-task, or is merely reported to the screen. The default is "true"\r
-\r
-*/\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("delete")]\r
- public class DeleteTask : Task {\r
-\r
- [TaskAttribute("file")]\r
- string _file = null;\r
-\r
- [TaskAttribute("dir")]\r
- string _dir = null;\r
-\r
- [TaskAttribute("verbose")]\r
- [BooleanValidator()]\r
- string _verbose = Boolean.FalseString;\r
-\r
- [TaskAttribute("failonerror")]\r
- [BooleanValidator()]\r
- string _failOnError = Boolean.TrueString;\r
-\r
- /// <summary>If true then delete empty directories when using filesets.</summary>\r
- [TaskAttribute("includeEmptyDirs")]\r
- [BooleanValidator()]\r
- string _includeEmptyDirs = Boolean.FalseString;\r
-\r
- [TaskFileSet("fileset")]\r
- FileSet _fileset = new FileSet(false);\r
-\r
- public string FileName { get { return _file; } }\r
- public string DirectoryName { get { return _dir; } }\r
- public bool FailOnError { get { return Convert.ToBoolean(_failOnError); } }\r
- public bool IncludeEmptyDirectories { get { return Convert.ToBoolean(_includeEmptyDirs); } }\r
- public FileSet DeleteFileSet { get { return _fileset; } }\r
-\r
- public bool Verbose { \r
- get {\r
- return (Project.Verbose || Convert.ToBoolean(_verbose));\r
- } \r
- }\r
-\r
- protected override void ExecuteTask() {\r
-\r
- // limit task to deleting either a file or a directory or a file set\r
- if (FileName != null && DirectoryName != null) {\r
- throw new BuildException("Cannot specify 'file' and 'dir' in the same delete task", Location);\r
- }\r
-\r
- // try to delete specified file\r
- if (FileName != null) {\r
- string path = null;\r
- try {\r
- path = Project.GetFullPath(FileName);\r
- } catch (Exception e) {\r
- string msg = String.Format("Could not determine path from {0}", FileName);\r
- throw new BuildException(msg, Location, e);\r
- }\r
- DeleteFile(path);\r
-\r
- // try to delete specified directory\r
- } else if (DirectoryName != null) {\r
- string path = null;\r
- try {\r
- path = Project.GetFullPath(DirectoryName);\r
- } catch (Exception e) {\r
- string msg = String.Format("Could not determine path from {0}", DirectoryName);\r
- throw new BuildException(msg, Location, e);\r
- }\r
- DeleteDirectory(path);\r
-\r
- // delete files/directories in fileset\r
- } else {\r
- // only use the file set if file and dir attributes have NOT been set\r
- foreach (string path in DeleteFileSet.FileNames) {\r
- DeleteFile(path);\r
- }\r
-\r
- if (IncludeEmptyDirectories) {\r
- foreach (string path in DeleteFileSet.DirectoryNames) {\r
- // only delete EMPTY directories (no files, no directories)\r
- DirectoryInfo dirInfo = new DirectoryInfo(path);\r
-\r
- if ((dirInfo.GetFiles().Length == 0) && (dirInfo.GetDirectories().Length == 0)) {\r
- DeleteDirectory(path);\r
- }\r
- }\r
- }\r
- }\r
- }\r
-\r
- void DeleteDirectory(string path) {\r
- try {\r
- if (Directory.Exists(path)) {\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "Deleting directory {0}", path);\r
- }\r
- if (path.Length > 10) {\r
- Directory.Delete(path, true);\r
- } else {\r
- // TODO: remove this once this task is fully tested and NAnt is at 1.0\r
- Console.WriteLine(LogPrefix + "Path {0} is too close to root to delete this early in development", path);\r
- }\r
- } else {\r
- throw new DirectoryNotFoundException();\r
- }\r
- } catch (Exception e) {\r
- if (FailOnError) {\r
- string msg = String.Format("Cannot delete directory {0}", path);\r
- throw new BuildException(msg, Location, e);\r
- }\r
- }\r
- }\r
-\r
- void DeleteFile(string path) {\r
- try {\r
- if (File.Exists(path)) {\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "Deleting file {0}", path);\r
- }\r
- File.Delete(path);\r
- } else {\r
- throw new FileNotFoundException();\r
- }\r
- } catch (Exception e) {\r
- if (FailOnError) {\r
- string msg = String.Format("Cannot delete file {0}", path);\r
- throw new BuildException(msg, Location, e);\r
- }\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
-\r
- [TaskName("echo")]\r
- public class EchoTask : Task {\r
-\r
- [TaskAttribute("message", Required=true)]\r
- string _message = null;\r
-\r
- protected override void ExecuteTask() {\r
- Log.WriteLine(LogPrefix + _message);\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("exec")]\r
- public class ExecTask : ExternalProgramBase {\r
-\r
- [TaskAttribute("program", Required=true)]\r
- string _program = null;\r
-\r
- [TaskAttribute("commandline")]\r
- string _commandline = null;\r
-\r
- [TaskAttribute("basedir")]\r
- string _baseDirectory = null;\r
-\r
- // Stop the buildprocess if the command exits with a returncode other than 0.\r
- [TaskAttribute("failonerror")]\r
- [BooleanValidator()]\r
- string _failonerror = Boolean.TrueString;\r
-\r
- // TODO: change this to Int32Parameter to ensure value is a valid Int32 type after text expansion\r
- [TaskAttribute("timeout")]\r
- [Int32Validator()]\r
- string _timeout = Int32.MaxValue.ToString();\r
-\r
- public override string ProgramFileName { get { return Project.GetFullPath(_program); } }\r
- public override string ProgramArguments { get { return _commandline; } }\r
- public override string BaseDirectory { get { return Project.GetFullPath(_baseDirectory); } }\r
- public override int TimeOut { get { return Convert.ToInt32(_timeout); } }\r
- public override bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }\r
-\r
- protected override void ExecuteTask() {\r
- Log.WriteLine(LogPrefix + "{0} {1}", Path.GetFileName(ProgramFileName), GetCommandLine());\r
- base.ExecuteTask();\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.Diagnostics;\r
- using System.IO;\r
- using System.Text;\r
- using System.Xml;\r
-\r
- public abstract class ExternalProgramBase : Task {\r
-\r
- [TaskAttribute("verbose")]\r
- [BooleanValidator()]\r
- string _verbose = Boolean.FalseString;\r
-\r
- public abstract string ProgramFileName { get; }\r
- public abstract string ProgramArguments { get; }\r
-\r
- public virtual string BaseDirectory {\r
- get {\r
- if (Project != null) {\r
- return Project.BaseDirectory;\r
- } else {\r
- return null;\r
- }\r
- }\r
- }\r
-\r
- public virtual int TimeOut {\r
- get { return Int32.MaxValue; }\r
- }\r
-\r
- public virtual bool FailOnError {\r
- get { return true; }\r
- }\r
-\r
- public bool Verbose { \r
- get {\r
- return (Project.Verbose || Convert.ToBoolean(_verbose));\r
- } \r
- }\r
-\r
- StringCollection _args = new StringCollection();\r
-\r
- protected override void InitializeTask(XmlNode taskNode) {\r
- // initialize the _args collection\r
- foreach (XmlNode optionNode in taskNode.SelectNodes("arg")) {\r
-\r
- // TODO: decide if we should enforce arg elements not being able\r
- // to accept a file and value attribute on the same element.\r
- // Ideally this would be down via schema and since it doesn't\r
- // really hurt for now I'll leave it in.\r
-\r
- XmlNode valueNode = optionNode.SelectSingleNode("@value");\r
- if (valueNode != null) {\r
- _args.Add(Project.ExpandText(valueNode.Value));\r
- }\r
-\r
- XmlNode fileNode = optionNode.SelectSingleNode("@file");\r
- if (fileNode != null) {\r
- _args.Add(Project.GetFullPath(Project.ExpandText(fileNode.Value)));\r
- }\r
- }\r
- }\r
-\r
- public string GetCommandLine() {\r
- // append any nested <arg> arguments to command line\r
- StringBuilder arguments = new StringBuilder(ProgramArguments);\r
- foreach (string arg in _args) {\r
- arguments = arguments.Append(' ');\r
- arguments = arguments.Append(arg);\r
- }\r
- return arguments.ToString();\r
- }\r
-\r
- protected override void ExecuteTask() {\r
- try {\r
- // create process to launch compiler (redirect standard output to temp buffer)\r
- Process process = new Process();\r
- process.StartInfo.FileName = ProgramFileName;\r
- process.StartInfo.Arguments = GetCommandLine();\r
- process.StartInfo.RedirectStandardOutput = true;\r
- process.StartInfo.UseShellExecute = false;\r
- process.StartInfo.WorkingDirectory = BaseDirectory;\r
- if (Verbose) {\r
- Log.WriteLine(LogPrefix + "{0}>{1} {2}", process.StartInfo.WorkingDirectory, process.StartInfo.FileName, process.StartInfo.Arguments);\r
- }\r
- process.Start();\r
- \r
- // display standard output\r
- StreamReader reader = process.StandardOutput;\r
- string output = reader.ReadToEnd();\r
- if (output.Length > 0) {\r
- int indentLevel = Log.IndentLevel;\r
- Log.IndentLevel = 0;\r
- Log.WriteLine(output);\r
- Log.IndentLevel = indentLevel;\r
- }\r
-\r
- // wait for program to exit\r
- process.WaitForExit(TimeOut);\r
-\r
- if (FailOnError && process.ExitCode != 0) {\r
- throw new BuildException("Program error, see build log for details.");\r
- }\r
- } catch (Exception e) {\r
- throw new BuildException(e.Message, Location, e);\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
-\r
- [TaskName("fail")]\r
- public class FailTask : Task {\r
-\r
- [TaskAttribute("message")]\r
- string _message = null;\r
-\r
- protected override void ExecuteTask() {\r
- string message = _message;\r
- if (message == null) {\r
- message = "No message";\r
- }\r
- throw new BuildException(message);\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-\r
-namespace SourceForge.NAnt {\r
- \r
- using System;\r
- using System.Xml;\r
- using System.Collections;\r
- using System.Collections.Specialized;\r
- \r
- /// <summary>\r
- /// Summary description for IncludeTask.\r
- /// </summary>\r
- \r
- [TaskName("include")] // TODO make into ant:include\r
- public class IncludeTask : Task { \r
- \r
- /// <summary>hours to to add to the sleep time</summary>\r
- [TaskAttribute("href", Required=true)]\r
- string _href = null;\r
- \r
- // Attribute properties\r
- public string Href { get { return _href; } }\r
-\r
- XPathTextPositionMap _positionMap; // created when Xml document is loaded \r
- TaskCollection _tasks = new TaskCollection();\r
- \r
- // static members\r
- static System.Collections.Stack _includesStack = new Stack(); \r
- static bool IsIncluded( string href ) {\r
- bool result = false;\r
- IEnumerator stackenum = _includesStack.GetEnumerator();\r
- while ( stackenum.MoveNext()) {\r
- if ( href == (string)stackenum.Current ) {\r
- result = true; break;\r
- }\r
- }\r
- return result;\r
- }\r
- \r
- protected void InitializeIncludedDocument(XmlDocument doc) {\r
- \r
- // Load line Xpath to linenumber array\r
- _positionMap = new XPathTextPositionMap(doc.BaseURI); \r
- \r
- // process all the non-target nodes (these are global tasks for the project)\r
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");\r
- foreach (XmlNode taskNode in taskList) {\r
-\r
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location\r
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);\r
-\r
- Task task = Project.CreateTask(taskNode);\r
- if (task != null) {\r
- // Store a local copy also so we can execute only those\r
- _tasks.Add(task); \r
- }\r
- } \r
- \r
- // execute global tasks now - before anything else\r
- // this lets us include tasks that do things like add more tasks\r
- // Here is where we should check for recursive dependencies\r
- //\r
- foreach (Task task in _tasks ) {\r
- task.Execute(); \r
- }\r
-\r
- // process all the targets\r
- XmlNodeList targetList = doc.SelectNodes("project/target");\r
- foreach (XmlNode targetNode in targetList) {\r
- Target target = new Target(Project);\r
- target.Initialize(targetNode);\r
- Project.Targets.Add(target);\r
- }\r
- }\r
- \r
- /// <summary>\r
- /// verify parameters\r
- ///</summary>\r
- ///<param name="taskNode"> taskNode used to define this task instance </param>\r
- protected override void InitializeTask(XmlNode taskNode) {\r
- \r
- //TODO check where we are in document - if not at top level then bail out on error ... \r
- // basic recursion check\r
- if (IsIncluded( Project.GetFullPath(Href) )) {\r
- throw new BuildException("Recursive includes are not allowed", Location); \r
- } \r
- }\r
- \r
- protected override void ExecuteTask() {\r
- \r
- string fullpath = Project.GetFullPath(Href);\r
- // push ourselves onto the stack\r
- _includesStack.Push(fullpath);\r
- try {\r
- \r
- XmlDocument doc = new XmlDocument();\r
- \r
- // Handle local file case \r
- doc.Load(fullpath);\r
- \r
- InitializeIncludedDocument(doc);\r
- }\r
- // Handling the case where a nested include causes an exception during initialization\r
- catch ( BuildException ) {\r
- throw;\r
- } \r
- catch ( Exception e) {\r
- throw new BuildException(e.Message, Location, e);\r
- }\r
- finally {\r
- // Pop off the stack\r
- _includesStack.Pop(); \r
- }\r
- } \r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Mike Krueger (mike@icsharpcode.net)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("jsc")]\r
- public class JscTask : CompilerBase {\r
-\r
- // TODO: add JScript.NET specific compiler options here (see CscTask)\r
-\r
- protected override void WriteOptions(TextWriter writer) {\r
- // TODO: add support for compiler specific options\r
- }\r
-\r
- protected override bool NeedsCompiling() {\r
- // TODO: add checks for any referenced files OR return false to always compile\r
- return base.NeedsCompiling();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool
-// Copyright (C) 2002 Ximian, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Martin Baulig (martin@gnome.org)
-
-using System;
-using System.IO;
-
-namespace SourceForge.NAnt
-{
-
- [TaskName("mcs")]
- public class McsTask : CompilerBase
- {
- protected override void WriteOption(TextWriter writer, string name) {
- if (name.Equals("nologo")) {
- return;
- } else {
- writer.WriteLine("--{0}", name);
- }
- }
-
- protected override void WriteOption(TextWriter writer, string name, string arg) {
- if (name.Equals("out")) {
- writer.WriteLine("-o {0}", arg);
- } else if (name.Equals("reference")) {
- writer.WriteLine("-r {0}", arg);
- } else {
- writer.WriteLine("--{0} {1}", name, arg);
- }
- }
- }
-}
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- /// <summary>Creates a directory and any non-existent parent directories when necessary.</summary>\r
- [TaskName("mkdir")]\r
- public class MkDirTask : Task {\r
-\r
- [TaskAttribute("dir", Required=true)]\r
- string _dir = null; // the directory to create\r
-\r
- protected override void ExecuteTask() {\r
- try {\r
- string directory = Project.GetFullPath(_dir);\r
- if (!Directory.Exists(directory)) {\r
- Log.WriteLine(LogPrefix + "Creating directory {0}", directory);\r
- DirectoryInfo result = Directory.CreateDirectory(directory);\r
- if (result == null) {\r
- string msg = String.Format("Unknown error creating directory '{0}'", directory);\r
- throw new BuildException(msg, Location);\r
- }\r
- }\r
- } catch (Exception e) {\r
- throw new BuildException(e.Message, Location, e);\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("move")]\r
- public class MoveTask : CopyTask {\r
-\r
- /// <summary>\r
- /// Actually does the file (and possibly empty directory) copies.\r
- /// </summary>\r
- protected override void DoFileOperations() {\r
- if (FileCopyMap.Count > 0) {\r
-\r
- // loop thru our file list\r
- foreach (string sourcePath in FileCopyMap.Keys) {\r
- string destinationPath = (string)FileCopyMap[sourcePath];\r
- if (sourcePath == destinationPath) {\r
- Log.WriteLine(LogPrefix + "Skipping self-move of {0}" + sourcePath);\r
- continue;\r
- }\r
-\r
- try {\r
- // check if directory exists\r
- if (Directory.Exists(sourcePath)) {\r
- Log.WriteLine(LogPrefix + "moving directory {0} to {1}", sourcePath, destinationPath);\r
- Directory.Move(sourcePath, destinationPath);\r
- }\r
- else {\r
-\r
- DirectoryInfo todir = new DirectoryInfo(destinationPath);\r
- if ( !todir.Exists ) {\r
- Directory.CreateDirectory( Path.GetDirectoryName(destinationPath) );\r
- }\r
-\r
- Log.WriteLine(LogPrefix + "Moving {0} to {1}", sourcePath, destinationPath);\r
- // IM look into how Ant does this for directories\r
- File.Move(sourcePath, destinationPath);\r
- }\r
-\r
- } catch (IOException ioe) {\r
- string msg = String.Format("Failed to move {0} to {1}\n{2}", sourcePath, destinationPath, ioe.Message);\r
- throw new BuildException(msg, Location);\r
- }\r
- }\r
- }\r
- }\r
- }\r
-}\r
-\r
-\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections.Specialized;\r
- using System.Diagnostics;\r
- using System.IO;\r
- using System.Xml;\r
-\r
- [TaskName("nant")]\r
- public class NantTask : Task {\r
-\r
- [TaskAttribute("buildfile")]\r
- string _buildFileName = null;\r
-\r
- [TaskAttribute("basedir")]\r
- string _baseDirectory = null;\r
-\r
- // TODO: add support for multiple targets\r
- [TaskAttribute("target")]\r
- string _target = null;\r
-\r
- protected override void ExecuteTask() {\r
- string directory = Project.GetFullPath(_baseDirectory);\r
- string buildFileName = _buildFileName;\r
- if (buildFileName == null) {\r
- buildFileName = Project.FindBuildFileName(directory);\r
- }\r
-\r
- try {\r
- Log.WriteLine(LogPrefix + "{0} {1}", buildFileName, _target);\r
- Log.Indent();\r
- Project project = new Project();\r
- project.BaseDirectory = directory;\r
- project.BuildFileName = buildFileName;\r
- if (_target != null) {\r
- project.BuildTargets.Add(_target);\r
- }\r
- if (!project.Run()) {\r
- throw new BuildException("Nested build failed - refer to build log for exact reason.");\r
- }\r
- } finally {\r
- Log.Unindent();\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
-\r
- [TaskName("property")]\r
- public class PropertyTask : Task {\r
-\r
- [TaskAttribute("name", Required=true)]\r
- string _name = null;\r
-\r
- [TaskAttribute("value", Required=true)]\r
- string _value = String.Empty;\r
-\r
- protected override void ExecuteTask() {\r
- Project.Properties[_name] = _value;\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Ian MacLean (ian_maclean@another.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Xml;\r
- using System.Threading;\r
-\r
- /// <summary>\r
- /// A task for sleeping a short period of time, useful when a build or deployment process\r
- /// requires an interval between tasks.\r
- /// </summary>\r
-\r
- [TaskName("sleep")]\r
- public class SleepTask : Task {\r
-\r
- /// <summary>hours to to add to the sleep time</summary>\r
- [TaskAttribute("hours")]\r
- string _hours = null;\r
-\r
- /// <summary>minutes to add to the sleep time</summary>\r
- [TaskAttribute("minutes")]\r
- string _minutes = 0.ToString();\r
-\r
- /// <summary>seconds to add to the sleep time</summary>\r
- [TaskAttribute("seconds")]\r
- string _seconds = 0.ToString();\r
-\r
- /// <summary>milliseconds to add to the sleep time</summary>\r
- [TaskAttribute("milliseconds")]\r
- string _milliseconds = 0.ToString();\r
-\r
- /// <summary>flag controlling whether to break the build on an error</summary>\r
- [TaskAttribute("failonerror")]\r
- [BooleanValidator()]\r
- string _failonerror = Boolean.FalseString;\r
-\r
- // Attribute properties\r
- public int Hours { get { return Convert.ToInt32(_hours); } }\r
- public int Minutes { get { return Convert.ToInt32(_minutes); } }\r
- public int Seconds { get { return Convert.ToInt32(_seconds); } }\r
- public int Milliseconds { get { return Convert.ToInt32(_milliseconds); } }\r
- public bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }\r
-\r
- ///return time to sleep\r
- private int GetSleepTime() {\r
- return ((((int) Hours * 60) + Minutes) * 60 + Seconds) * 1000 + Milliseconds;\r
- }\r
-\r
- ///<summary> return time to sleep </summary>\r
- ///<param name="millis"> </param>\r
- private void DoSleep(int millis ) {\r
- Thread.Sleep(millis);\r
- }\r
-\r
- /// <summary>\r
- /// verify parameters\r
- ///</summary>\r
- ///<param name="taskNode"> taskNode used to define this task instance </param>\r
- protected override void InitializeTask(XmlNode taskNode) {\r
- if (GetSleepTime() < 0) {\r
- throw new BuildException("Negative sleep periods are not supported", Location);\r
- }\r
- }\r
-\r
- protected override void ExecuteTask() {\r
- int sleepTime = GetSleepTime();\r
- Log.WriteLine(LogPrefix + "sleeping for {0} milliseconds", sleepTime);\r
- DoSleep(sleepTime);\r
- }\r
- }\r
-}\r
-\r
-\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Serge (serge@wildwestsoftware.com)\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
- using System.Xml;\r
- using System.Xml.Xsl;\r
- using System.Xml.XPath;\r
- using System.Text.RegularExpressions;\r
-\r
- [TaskName("style")]\r
- public class StyleTask : Task {\r
-\r
- // TODO: consider prefixing private fields with _ to stay consistent (gs)\r
-\r
- [TaskAttribute("basedir", Required=false)]\r
- string baseDir = null;\r
-\r
- [TaskAttribute("destdir", Required=false)]\r
- string destDir = null;\r
-\r
- [TaskAttribute("extension", Required=false)]\r
- string extension = "html";\r
-\r
- [TaskAttribute("style", Required=true)]\r
- string xsltFile = null;\r
-\r
- [TaskAttribute("in", Required=true)]\r
- string srcFile = null;\r
-\r
- [TaskAttribute("out", Required=false)]\r
- string destFile = null;\r
-\r
- private static string GetPath(string dir, string file) {\r
- // TODO: remove platform dependencies by using System.IO.Path (gs)\r
- string d = (dir == null)\r
- ? ""\r
- : Regex.Replace(dir, "/", "\\");\r
-\r
- return (d==null || d=="")\r
- ? (file==null || file=="") ? "" : file\r
- : d.EndsWith("\\")\r
- ? d +file : d + "\\" + file;\r
- }\r
-\r
- private XmlReader CreateXmlReader(string dir, string file) {\r
- string xmlPath = GetPath(dir, file);\r
- XmlTextReader xmlReader = null;\r
-\r
- try {\r
- xmlReader = new XmlTextReader(new FileStream(xmlPath, FileMode.Open));\r
- } catch (Exception) {\r
- xmlReader = null;\r
- }\r
-\r
- return xmlReader;\r
- }\r
-\r
- private XmlWriter CreateXmlWriter(string dir, string file) {\r
- string xmlPath = GetPath(dir, file);\r
-\r
- XmlWriter xmlWriter = null;\r
-\r
- string targetDir = Path.GetDirectoryName(Path.GetFullPath(xmlPath));\r
- if (targetDir != null && targetDir != "" && !Directory.Exists(targetDir)) {\r
- Directory.CreateDirectory(targetDir);\r
- }\r
-\r
- try {\r
- // UTF-8 encoding will be used\r
- xmlWriter = new XmlTextWriter(xmlPath, null);\r
- } catch (Exception) {\r
- xmlWriter = null;\r
- }\r
-\r
- return xmlWriter;\r
- }\r
-\r
- protected override void ExecuteTask() {\r
- string destFile = this.destFile;\r
-\r
- if (destFile == null || destFile == "") {\r
- // TODO: use System.IO.Path (gs)\r
- string ext = extension[0]=='.'\r
- ? extension\r
- : "." + extension;\r
-\r
- int extPos = srcFile.LastIndexOf('.');\r
-\r
- if (extPos == -1) {\r
- destFile = srcFile + ext;\r
- } else {\r
- destFile = srcFile.Substring(0, extPos) + ext;\r
- }\r
- }\r
-\r
- string srcPath = GetPath(baseDir, srcFile);\r
- string destPath = GetPath(destDir, destFile);\r
- string xsltPath = GetPath(baseDir, xsltFile);\r
-\r
- FileInfo srcInfo = new FileInfo(srcPath);\r
- FileInfo destInfo = new FileInfo(destPath);\r
- FileInfo xsltInfo = new FileInfo(xsltPath);\r
-\r
- if (!srcInfo.Exists) {\r
- throw new BuildException("Unable to find source xml file.");\r
- }\r
- if (!xsltInfo.Exists) {\r
- throw new BuildException("Unable to find stylesheet file.");\r
- }\r
-\r
- bool destOutdated = !destInfo.Exists\r
- || srcInfo.LastWriteTime > destInfo.LastWriteTime\r
- || xsltInfo.LastWriteTime > destInfo.LastWriteTime;\r
-\r
- if (destOutdated) {\r
- XmlReader xmlReader = CreateXmlReader(baseDir, srcFile);\r
- XmlReader xslReader = CreateXmlReader(baseDir, xsltFile);\r
- XmlWriter xmlWriter = CreateXmlWriter(destDir, destFile);\r
-\r
- Log.WriteLine(LogPrefix + "Transforming into " + Path.GetFullPath(destDir));\r
-\r
- // TODO: remove assignments from conditional statement (gs)\r
- if (xmlReader != null && xslReader != null && xmlWriter != null) {\r
- XslTransform xslt = new XslTransform();\r
- XPathDocument xml = new XPathDocument(xmlReader);\r
-\r
- Log.WriteLine(LogPrefix + "Loading stylesheet " + Path.GetFullPath(xsltPath));\r
- try {\r
- xslt.Load(xslReader);\r
- } catch (XsltCompileException xce) {\r
- throw new BuildException(xce.Message, xce);\r
- } catch (Exception e) {\r
- throw new BuildException(e.Message, e);\r
- }\r
-\r
- Log.WriteLine(LogPrefix + "Processing " + Path.GetFullPath(srcPath) + " to " + Path.GetFullPath(destPath));\r
- try {\r
- xslt.Transform(xml, null, xmlWriter);\r
- } catch (Exception e) {\r
- throw new BuildException(e.Message, e);\r
- }\r
- } else {\r
- // not sure how to deal with this...\r
- // TODO: remove this statement or do something useful (gs)\r
- // Can this condition occur? I would have thought\r
- // that an exception would be thrown. (gs)\r
- }\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- /// <remarks>\r
- /// Sets the following properties:\r
- /// <ul>\r
- /// <li>nant.dateStamp to yyyyMMdd</li>\r
- /// <li>nant.timeStamp to HHmm</li>\r
- /// <li>nant.today using default DataTime.ToString() method</li>\r
- /// </ul>\r
- /// </remarks>\r
- [TaskName("tstamp")]\r
- public class TStampTask : Task {\r
- protected override void ExecuteTask() {\r
- DateTime now = DateTime.Now;\r
- Log.WriteLine(LogPrefix + now.ToString());\r
- Project.Properties["nant.dstamp"] = now.ToString("yyyyMMdd");\r
- Project.Properties["nant.tstamp"] = now.ToString("HHmm");\r
- Project.Properties["nant.today"] = now.ToString();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("taskdef")]\r
- public class TaskDefTask : Task {\r
-\r
- [TaskAttribute("assembly", Required=true)]\r
- string _assemblyFileName = null;\r
-\r
- protected override void ExecuteTask() {\r
- string assemblyFileName = Project.GetFullPath(_assemblyFileName);\r
- try {\r
- int taskCount = Project.AddTasks(assemblyFileName);\r
- Log.WriteLine(LogPrefix + "Added {0} tasks from {1}", taskCount, assemblyFileName);\r
- } catch (Exception e) {\r
- Log.WriteLine(LogPrefix + "Adding tasks from {0}", assemblyFileName);\r
- throw new BuildException(e.Message, Location, e);\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-// Mike Krueger (mike@icsharpcode.net)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
-\r
- [TaskName("vbc")]\r
- public class VbcTask : CompilerBase {\r
-\r
- // TODO: add JScript.NET specific compiler options here (see CscTask)\r
-\r
- protected override void WriteOptions(TextWriter writer) {\r
- // TODO: add support for compiler specific options\r
- }\r
-\r
- protected override bool NeedsCompiling() {\r
- // TODO: add checks for any referenced files OR return false to always compile\r
- return base.NeedsCompiling();\r
- }\r
- }\r
-}\r
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.Collections;\r
- using System.IO;\r
- using System.Text;\r
-\r
- public class TextWriterCollection : ArrayList {\r
- }\r
-\r
- public class Log {\r
-\r
- static bool _autoFlush = false;\r
- static int _indentLevel = 0;\r
- static int _indentSize = 4;\r
-\r
- static TextWriterCollection _listeners;\r
-\r
- protected Log() {\r
- }\r
-\r
- ~Log() {\r
- // make sure we release any open file handles\r
- Close();\r
- }\r
-\r
- public static bool AutoFlush {\r
- get { return _autoFlush; }\r
- set { _autoFlush = value; }\r
- }\r
-\r
- public static int IndentLevel {\r
- get { return _indentLevel; }\r
- set { _indentLevel = value; }\r
- }\r
-\r
- public static int IndentSize {\r
- get { return _indentSize; }\r
- set { _indentSize = value; }\r
- }\r
-\r
- public static TextWriterCollection Listeners {\r
- get {\r
- if (_listeners == null) {\r
- _listeners = new TextWriterCollection();\r
- _listeners.Add(Console.Out);\r
- }\r
- return _listeners;\r
- }\r
- }\r
-\r
- public static void Close() {\r
- foreach (TextWriter writer in Listeners) {\r
- // never close the Console.Out writer\r
- if (writer != Console.Out) {\r
- writer.Close();\r
- }\r
- }\r
- }\r
-\r
- public static void Flush() {\r
- foreach (TextWriter writer in Listeners) {\r
- writer.Flush();\r
- }\r
- }\r
-\r
- public static void Indent() {\r
- IndentLevel++;\r
- }\r
-\r
- public static void Unindent() {\r
- if (IndentLevel <= 0) {\r
- throw new InvalidOperationException("IndentLevel must be greater than zero before calling Unindent()");\r
- }\r
- IndentLevel--;\r
- }\r
-\r
- /// <summary>\r
- /// Flag to indicate next string will start on a new line so that it can be indented.\r
- /// </summary>\r
- private static bool _newline = true;\r
-\r
- private static void PreprocessValue(ref string value) {\r
- // if we are starting a new line then first indent the string\r
- if (_newline) {\r
- if (IndentLevel > 0) {\r
- StringBuilder sb = new StringBuilder(value);\r
- sb.Insert(0, " ", IndentLevel * IndentSize);\r
- value = sb.ToString();\r
- }\r
- _newline = false;\r
- }\r
- }\r
-\r
- public static void Write(string value) {\r
- PreprocessValue(ref value);\r
- foreach (TextWriter writer in Listeners) {\r
- writer.Write(value);\r
- }\r
-\r
- if (AutoFlush) {\r
- foreach (TextWriter writer in Listeners) {\r
- writer.Flush();\r
- }\r
- }\r
- }\r
-\r
- public static void WriteLine() {\r
- WriteLine(String.Empty);\r
- }\r
-\r
- public static void WriteLine(string value) {\r
- PreprocessValue(ref value);\r
- foreach (TextWriter writer in Listeners) {\r
- writer.WriteLine(value);\r
- }\r
-\r
- if (AutoFlush) {\r
- foreach (TextWriter writer in Listeners) {\r
- writer.Flush();\r
- }\r
- }\r
-\r
- // make sure we indent the next line\r
- _newline = true;\r
- }\r
-\r
- public static void Write(string format, params object[] arg) {\r
- Write(String.Format(format, arg));\r
- }\r
-\r
- public static void WriteLine(string format, params object[] arg) {\r
- WriteLine(String.Format(format, arg));\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-// NAnt - A .NET build tool\r
-// Copyright (C) 2001 Gerry Shaw\r
-//\r
-// This program is free software; you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation; either version 2 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-//\r
-// Gerry Shaw (gerry_shaw@yahoo.com)\r
-\r
-namespace SourceForge.NAnt {\r
-\r
- using System;\r
- using System.IO;\r
- using System.Text.RegularExpressions;\r
- using System.Xml;\r
- using System.Xml.XPath;\r
- using System.Collections;\r
-\r
- public struct TextPosition {\r
- public static readonly TextPosition InvalidPosition = new TextPosition(-1,-1);\r
-\r
- public TextPosition(int line, int column) {\r
- Line = line;\r
- Column = column;\r
- }\r
-\r
- public int Line;\r
- public int Column;\r
- }\r
-\r
- /// <summary>\r
- /// Maps XML nodes to the text positions from their original source.\r
- /// </summary>\r
- public class XPathTextPositionMap {\r
-\r
- Hashtable _map = new Hashtable();\r
-\r
- public XPathTextPositionMap(string url) {\r
- string parentXPath = "/"; // default to root\r
- string previousXPath = "";\r
- int previousDepth = 0;\r
-\r
- // Load text reader\r
- XmlTextReader reader = new XmlTextReader(url);\r
- ArrayList indexAtDepth = new ArrayList();\r
-\r
- // Explicitly load document XPath\r
- _map.Add((object) "/", (object) new TextPosition(1, 1));\r
-\r
- // loop thru all nodes in the document\r
- while (reader.Read()) {\r
- // reader to Node ...\r
- if ( (reader.NodeType.ToString() != "Whitespace") // Ignore those we aren't interested in\r
- && (reader.NodeType.ToString() != "EndElement")\r
- && (reader.NodeType.ToString() != "ProcessingInstruction")\r
- && (reader.NodeType.ToString() != "XmlDeclaration")\r
- ) {\r
- int level = reader.Depth;\r
- string currentXPath = "";\r
-\r
- // If we arr higher than before\r
- if (reader.Depth < previousDepth) {\r
- // Clear vars for new depth\r
- string[] list = parentXPath.Split('/');\r
- string newXPath = ""; // once appended to / will be root node ...\r
-\r
- for (int j = 1; j < level+1; j++) {\r
- newXPath += "/" + list[j];\r
- }\r
-\r
- // higher than before so trim xpath\\r
- parentXPath = newXPath; // one up from before\r
-\r
- // clear indexes for depth greater than ours\r
- indexAtDepth.RemoveRange(level+1, indexAtDepth.Count - (level+1));\r
-\r
- } else if (reader.Depth > previousDepth) {\r
- // we are lower\r
- parentXPath = previousXPath;\r
- }\r
-\r
- // End depth setup\r
- // Setup up index array\r
- // add any needed extra items ( usually only 1 )\r
- // would have uses array but not sure what maximum depth will be beforehand\r
- for (int index = indexAtDepth.Count; index < level+1; index++) {\r
- indexAtDepth.Add(0);\r
- }\r
- // Set child index\r
- if ((int) indexAtDepth[level] == 0) {\r
- // first time thru\r
- indexAtDepth[level] = 1;\r
- } else {\r
- indexAtDepth[level] = (int) indexAtDepth[level] + 1; // lower so append to xpath\r
- }\r
-\r
- // Do actual XPath generation\r
- if (parentXPath.EndsWith("/")) {\r
- currentXPath = parentXPath;\r
- } else {\r
- currentXPath = parentXPath + "/"; // add seperator\r
- }\r
-\r
- // Set the final XPath\r
- currentXPath += "child::node()[" + indexAtDepth[level] + "]";\r
-\r
- // Add to our hash structures\r
- _map.Add((object) currentXPath, (object) new TextPosition(reader.LineNumber, reader.LinePosition));\r
-\r
- // setup up loop vars for next iteration\r
- previousXPath = currentXPath;\r
- previousDepth = reader.Depth;\r
- }\r
- }\r
- }\r
-\r
- public TextPosition GetTextPosition(XmlNode node) {\r
- string xpath = GetXPathFromNode(node);\r
- return GetTextPosition(xpath);\r
- }\r
-\r
- public TextPosition GetTextPosition(string xpath) {\r
- TextPosition pos;\r
- if (_map.ContainsKey(xpath)) {\r
- pos = (TextPosition) _map[xpath];\r
- } else {\r
- pos = TextPosition.InvalidPosition;\r
- }\r
- return pos;\r
- }\r
-\r
- private string GetXPathFromNode(XmlNode node) {\r
- XPathNavigator nav = node.CreateNavigator();\r
-\r
- string xpath = "";\r
- int index = 0;\r
-\r
- while (nav.NodeType.ToString() != "Root") {\r
- // loop thru children until we find ourselves\r
- XPathNavigator navParent = nav.Clone();\r
- navParent.MoveToParent();\r
- int parentIndex = 0;\r
- navParent.MoveToFirstChild();\r
- if (navParent.IsSamePosition(nav)) {\r
- index = parentIndex;\r
- }\r
- while (navParent.MoveToNext()) {\r
- parentIndex++;\r
- if (navParent.IsSamePosition(nav)) {\r
- index = parentIndex;\r
- }\r
- }\r
-\r
- nav.MoveToParent(); // do loop condiditon here\r
-\r
- // if we are at doc and index = 0 then there is no xml proc instruction\r
- if ((nav.NodeType.ToString()) != "Root" || (index == 0)) {\r
- index = index + 1; // special case at root to avoid processing instruction ..\r
- }\r
-\r
- string thisNode = "child::node()[" + index + "]";\r
-\r
- if (xpath == "") {\r
- xpath = thisNode;\r
- } else {\r
- // build xpath string\r
- xpath = thisNode + "/" + xpath;\r
- }\r
- }\r
-\r
- // prepend slash to ...\r
- xpath = "/" + xpath;\r
-\r
- return xpath;\r
- }\r
- }\r
-}\r
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-class X {
- static IEnumerator GetIt ()
- {
- yield return 1;
- yield return 2;
- yield return 3;
- }
-
- static IEnumerable GetIt2 ()
- {
- yield return 1;
- yield return 2;
- yield return 3;
- }
-
- static int Main ()
- {
- IEnumerator e = GetIt ();
- int total = 0;
-
- while (e.MoveNext ()){
- Console.WriteLine ("Value=" + e.Current);
- total += (int) e.Current;
- }
-
- if (total != 6)
- return 1;
-
- total = 0;
- foreach (int i in GetIt2 ()){
- Console.WriteLine ("Value=" + i);
- total += i;
- }
- if (total != 6)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-namespace Foo
-{
- public class Hello
- {
- public static int World = 8;
- }
-}
-
-namespace Bar
-{
- public class Hello
- {
- public static int World = 9;
- }
-}
-
-namespace X
-{
- using Foo;
-
- public partial class Test
- {
- public static int FooWorld ()
- {
- return Hello.World;
- }
- }
-}
-
-namespace X
-{
- using Bar;
-
- public partial class Test
- {
- public static int BarWorld ()
- {
- return Hello.World;
- }
- }
-}
-
-class Y
-{
- static int Main ()
- {
- if (X.Test.FooWorld () != 8)
- return 1;
- if (X.Test.BarWorld () != 9)
- return 2;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-namespace Test1
-{
- public class Base
- { }
-
- public partial class Foo : Base
- { }
-
- public partial class Foo : Base
- { }
-}
-
-namespace Test2
-{
- public interface Base
- { }
-
- public partial class Foo : Base
- { }
-
- public partial class Foo : Base
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-public partial class Test
-{
- public readonly Foo TheFoo;
-
- public Test ()
- {
- this.TheFoo = new Foo ();
- }
-
- public partial interface IFoo
- {
- int Hello (Test foo);
- }
-
- public int TestFoo ()
- {
- return TheFoo.Hello (this);
- }
-}
-
-public partial class Test
-{
- public partial class Foo : IFoo
- {
- int IFoo.Hello (Test test)
- {
- return 2;
- }
-
- public int Hello (Test test)
- {
- return 1;
- }
- }
-
- public int TestIFoo (IFoo foo)
- {
- return foo.Hello (this);
- }
-}
-
-class X
-{
- static int Main ()
- {
- Test test = new Test ();
- if (test.TestFoo () != 1)
- return 1;
- if (test.TestIFoo (test.TheFoo) != 2)
- return 2;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-namespace A
-{
- interface IFoo
- {
- void Hello (IFoo foo);
- }
-}
-
-namespace B
-{
- partial class Test
- { }
-}
-
-namespace B
-{
- using A;
-
- partial class Test : IFoo
- {
- void IFoo.Hello (IFoo foo)
- { }
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-class B {
-}
-
-interface iface {
-}
-
-partial class A : B {
-}
-
-partial class A : iface {
-}
-
-class D { static void Main () {} }
+++ /dev/null
-// Compiler options: -langversion:default
-
-partial class Foo
-{
- ~Foo ()
- { }
-}
-
-partial class Foo
-{ }
-
-class B { static void Main () {} }
-
+++ /dev/null
-using System;
-using System.Collections;
-
-public class Tester
-{
- string[] ABC = { "A", "B", "C" };
- // D
- string [,] EFGH = { { "E", "F" }, { "G", "H"}};
- // I
- ArrayList al = new ArrayList ();
-
- public Tester ()
- {
- al.Add ("J");
- al.Add ("K");
- }
-
- public System.Collections.IEnumerator GetEnumerator()
- {
- foreach (string s in ABC){
- if (s == null)
- throw new Exception ();
- else
- yield return s;
- }
-
- yield return "D";
- foreach (string s in EFGH){
- if(s == null)
- throw new Exception ();
- else
- yield return s;
- }
-
- yield return "I";
- foreach (string s in al){
- if (s == null)
- throw new Exception ();
- else
- yield return s;
- }
-
- yield return "L";
- }
-}
-
-
-class Test
-{
- public static int Main()
- {
- Tester tester = new Tester();
- string [] list = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L" };
- int top = 0;
-
- foreach (string s in tester){
- if (s != list [top]){
- Console.WriteLine ("Failure, got {0} expected {1}", s, list [top]);
- return 1;
- }
- top++;
- }
- if (top != list.Length){
- Console.WriteLine ("Failure, expected {0} got {1}", list.Length, top);
- }
- Console.WriteLine ("Success");
- return 0;
- }
-}
+++ /dev/null
-using System;
-using System.Runtime.InteropServices;
-
-[Obsolete]
-public partial class Test
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public class Foo {
- delegate Inner foo_fn(string s);
- public static void Main()
- {
- foo_fn f = delegate (string s) {
- return new Inner(s + s);
- };
- f ("Test");
- }
-
- class Inner
- {
- public Inner (string s)
- { }
- }
-}
+++ /dev/null
-using System;
-using System.Collections;
-
-public class X
-{
- string[] ABC = { "A", "B", "C" };
- string [,] EFGH = { { "E", "F" }, { "G", "H"}};
-
- delegate string Foo ();
- delegate void Bar (string s);
-
- public string Hello ()
- {
- Foo foo = delegate {
- foreach (string s in ABC){
- Bar bar = delegate (string t) {
- Console.WriteLine (t);
- };
- bar (s);
- }
-
- foreach (string s in EFGH){
- Bar bar = delegate (string t) {
- Console.WriteLine (t);
- };
- bar (s);
- }
-
- return "Hello";
- };
- return foo ();
- }
-
- public static void Main ()
- {
- X x = new X ();
- Console.WriteLine (x.Hello ());
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-class X {
- static int start, end;
- static int i;
-
- static IEnumerator GetRange ()
- {
- yield return 1;
- for (i = start; i < end; i++)
- yield return i;
- yield return 100;
- }
-
- static int Main ()
- {
- start = 10;
- end = 30;
-
- int total = 0;
-
- IEnumerator e = GetRange ();
- while (e.MoveNext ()){
- Console.WriteLine ("Value=" + e.Current);
- total += (int) e.Current;
- }
-
- if (total != 491)
- return 1;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-//
-// Use
-
-using System;
-using System.Collections;
-
-class X {
- static IEnumerable GetIt (int [] args)
- {
- foreach (int a in args)
- yield return a;
- }
-
- static IEnumerable GetMulti (int [,] args)
- {
- foreach (int a in args)
- yield return a;
- }
-
- static int Main ()
- {
- int total = 0;
- foreach (int i in GetIt (new int [] { 1, 2, 3})){
- Console.WriteLine ("Got: " + i);
- total += i;
- }
-
- if (total != 6)
- return 1;
-
- total = 0;
- foreach (int i in GetMulti (new int [,] { { 10, 20 }, { 30, 40}})){
- Console.WriteLine ("Got: " + i);
- total += i;
- }
- if (total != 100)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-class X {
- static IEnumerable GetRange (int start, int end)
- {
- for (int i = start; i < end; i++)
- yield return i;
- }
-
- static void Main ()
- {
- Console.WriteLine ("GetRange 10..20");
-
- foreach (int i in GetRange (10, 20)){
- Console.WriteLine ("i=" + i);
- }
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-//
-// Anonymous method group conversions
-//
-
-class X {
- delegate void T ();
- static event T Click;
-
- static void Method ()
- {
- }
-
- static void Main ()
- {
- T t;
-
- // Method group assignment
- t = Method;
-
- Click += Method;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-//
-// Use
-
-using System;
-using System.Collections;
-
-class X {
- static IEnumerable GetIt ()
- {
- List l = new List (3);
- l.Add (1);
- l.Add (2);
- l.Add (3);
-
- foreach (int i in l)
- yield return i;
- }
-
- static int Main ()
- {
- int total = 0;
- foreach (int i in GetIt ()) {
- Console.WriteLine ("Got: " + i);
- total += i;
- }
-
- return total == 6 ? 0 : 1;
- }
-}
-
-public class List : IEnumerable {
-
- int pos = 0;
- int [] items;
-
- public List (int i)
- {
- items = new int [i];
- }
-
- public void Add (int value)
- {
- items [pos ++] = value;
- }
-
- public MyEnumerator GetEnumerator ()
- {
- return new MyEnumerator(this);
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public struct MyEnumerator : IEnumerator {
-
- List l;
- int p;
-
- public MyEnumerator (List l)
- {
- this.l = l;
- p = -1;
- }
-
- public object Current {
- get {
- return l.items [p];
- }
- }
-
- public bool MoveNext()
- {
- return ++p < l.pos;
- }
-
- public void Reset()
- {
- p = 0;
- }
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-struct S {
- int j;
-
- public IEnumerable Get (int a)
- {
- Console.WriteLine ("Sending: " + a);
- yield return a;
- j = 10;
- Console.WriteLine ("Sending: " + j);
- yield return j;
- }
-
- public static IEnumerable GetS (int a)
- {
- yield return 100;
- yield return a;
- yield return 1000;
- }
-}
-
-class X {
- IEnumerable Get (int a)
- {
- yield return 1;
- yield return 2;
- yield return a;
- }
-
- static IEnumerable GetS (int a)
- {
- yield return a;
- yield return a;
- yield return 1;
- }
-
- static int Main ()
- {
- X y = new X ();
-
- int total = 0;
- foreach (int x in y.Get (5)){
- total += x;
- }
- if (total != 8)
- return 1;
-
- total = 0;
- foreach (int x in GetS (3)){
- total += x;
- }
- if (total != 7)
- return 2;
-
- S s = new S();
- total = 0;
- foreach (int x in s.Get (100)){
- Console.WriteLine ("Got: " + x);
- total += x;
- }
- if (total != 110)
- return 3;
-
- total = 0;
- foreach (int x in S.GetS (1)){
- total += x;
- }
- if (total != 1101)
- return 4;
-
- Console.WriteLine ("OK");
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-public class Test
-{
- public IEnumerable Foo (int a)
- {
- try {
- try {
- yield return a;
- } finally {
- Console.WriteLine ("Hello World");
- }
-
- Console.WriteLine ("Next block");
-
- try {
- yield return a * a;
- } finally {
- Console.WriteLine ("Boston");
- }
- } finally {
- Console.WriteLine ("Outer finally");
- }
-
- Console.WriteLine ("Outer block");
- yield break;
- }
-}
-
-class X
-{
- static int Main ()
- {
- Test test = new Test ();
-
- ArrayList list = new ArrayList ();
- foreach (object o in test.Foo (5))
- list.Add (o);
-
- if (list.Count != 2)
- return 1;
- if ((int) list [0] != 5)
- return 2;
- if ((int) list [1] != 25)
- return 3;
-
- IEnumerable a = test.Foo (5);
-
- IEnumerator b = a as IEnumerator;
- if (b != null) {
- if (b.MoveNext ())
- return 4;
- }
-
- IEnumerator c = a.GetEnumerator ();
- if (!c.MoveNext ())
- return 5;
- if ((int) c.Current != 5)
- return 6;
- if (!c.MoveNext ())
- return 7;
- if ((int) c.Current != 25)
- return 8;
-
- IEnumerator d = a.GetEnumerator ();
-
- if ((int) c.Current != 25)
- return 9;
- if (!d.MoveNext ())
- return 10;
- if ((int) c.Current != 25)
- return 11;
- if ((int) d.Current != 5)
- return 12;
-
- if (c.MoveNext ())
- return 13;
-
- ((IDisposable) a).Dispose ();
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-
-using System;
-using System.Collections;
-
-public class Foo : IDisposable
-{
- public readonly int Data;
-
- public Foo (int data)
- {
- this.Data = data;
- }
-
- public bool disposed;
-
- public void Dispose ()
- {
- disposed = true;
- }
-}
-
-class X
-{
- public static IEnumerable Test (int a, int b)
- {
- Foo foo3, foo4;
-
- using (Foo foo1 = new Foo (a), foo2 = new Foo (b)) {
- yield return foo1.Data;
- yield return foo2.Data;
-
- foo3 = foo1;
- foo4 = foo2;
- }
-
- yield return foo3.disposed;
- yield return foo4.disposed;
- }
-
- static int Main ()
- {
- ArrayList list = new ArrayList ();
- foreach (object data in Test (3, 5))
- list.Add (data);
-
- if (list.Count != 4)
- return 1;
- if ((int) list [0] != 3)
- return 2;
- if ((int) list [1] != 5)
- return 3;
- if (!(bool) list [2])
- return 4;
- if (!(bool) list [3])
- return 5;
-
- return 0;
- }
-}
+++ /dev/null
-//
-// Parameter and return value compilation tests for anonymous methods
-//
-delegate void D (int x);
-delegate void E (out int x);
-
-class X {
- static int Main ()
- {
- // This should create an AnonymousMethod with the implicit argument
- D d1 = delegate {};
- D d2 = delegate (int a) {};
-
- return 0;
- }
-}
+++ /dev/null
-using System;
-
-delegate int D ();
-
-class X {
-
- static void Main ()
- {
- D x = T (1);
-
- Console.WriteLine ("Should be 2={0}", x ());
- }
-
- static D T (int a)
- {
- D d = delegate {
- a = a + 1;
- return a;
- };
-
- return d;
- }
-}
+++ /dev/null
-delegate void S ();
-
-class X {
-
- //
- // DO NOT ADD ANYTHING ELSE TO THIS TEST
- //
- static int Main ()
- {
- int a;
-
- S b = delegate {
- a = 2;
- };
-
- return 0;
- }
-}
+++ /dev/null
-delegate void S ();
-using System;
-
-class X {
- static int Main ()
- {
- int a = 1;
- Console.WriteLine ("A is = " + a);
- int c = a;
- Console.WriteLine (c);
- if (a != 1){
- return 1;
- }
-
- S b = delegate {
- if (a != 1)
- Environment.Exit (1);
- Console.WriteLine ("in Delegate");
- a = 2;
- if (a != 2)
- Environment.Exit (2);
- Console.WriteLine ("Inside = " + a);
- a = 3;
- Console.WriteLine ("After = " + a);
- };
- if (a != 1)
- return 3;
- b ();
- if (a != 3)
- return 4;
- Console.WriteLine ("Back, got " + a);
-
- return 0;
- }
-}
+++ /dev/null
-delegate void S ();
-using System;
-
-class X {
- static void Main ()
- {
- int a = 1;
- S b = delegate {
- a = 2;
- };
- b ();
- Console.WriteLine ("Back, got " + a);
- }
-}
+++ /dev/null
-delegate void S ();
-using System;
-
-class X {
- static void Main ()
- {
- int a = 1;
- S b = delegate {
- float f = 1;
- Console.WriteLine (a);
- if (f == 2)
- return;
- };
- b ();
- Console.WriteLine ("Back, got " + a);
- }
-}
+++ /dev/null
-//
-// Tests capturing of double nested variables
-//
-delegate void S ();
-using System;
-
-class X {
- static int Main ()
- {
- int i;
- S b = null;
-
- for (i = 0; i < 10; i++){
- int j = 0;
- b = delegate {
- Console.WriteLine ("i={0} j={1}", i, j);
- i = i + 1;
- j = j + 1;
- };
- }
- b ();
- Console.WriteLine ("i = {0}", i);
- if (!t (i, 11))
- return 1;
- b ();
- if (!t (i, 12))
- return 2;
- Console.WriteLine ("i = {0}", i);
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+++ /dev/null
-//
-// Tests capturing of variables
-//
-delegate void S ();
-using System;
-
-class X {
- static int Main ()
- {
- int a = 1;
- if (a != 1)
- return 1;
-
- Console.WriteLine ("A is = " + a);
- S b= delegate {
- Console.WriteLine ("on delegate");
- a = 2;
- };
- if (a != 1)
- return 2;
- b();
- if (a != 2)
- return 3;
- Console.WriteLine ("OK");
- return 0;
- }
-}
-
+++ /dev/null
-//
-// Tests havign more than one anonymous method that captures the same variable
-//
-using System;
-
-delegate void D ();
-
-class X {
- static int Main ()
- {
- int a = 0;
- D d1 = delegate {
- Console.WriteLine ("First");
- a = 1;
- };
-
- D d2 = delegate {
- Console.WriteLine ("Second");
- a = 2;
- };
- if (!t (a, 0))
- return 1;
- d1 ();
- if (!t (a, 1))
- return 2;
- d2 ();
- if (!t (a, 2))
- return 3;
- Console.WriteLine ("Test passes OK");
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+++ /dev/null
-//
-// Tests capturing of double nested variables
-//
-delegate void S ();
-using System;
-
-class X {
- static int Main ()
- {
- int i;
- int a = 0;
- S b = null;
-
- for (i = 0; i < 10; i++){
- int j = 0;
- b = delegate {
- Console.WriteLine ("i={0} j={1}", i, j);
- i = i + 1;
- j = j + 1;
- a = j;
- };
- }
- b ();
- Console.WriteLine ("i = {0}", i);
- if (!t (i, 11))
- return 1;
- b ();
- if (!t (i, 12))
- return 2;
- Console.WriteLine ("i = {0}", i);
- Console.WriteLine ("a = {0}", a);
- if (!t (a, 2))
- return 3;
-
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+2005-06-14 Marek Safar <marek.safar@seznam.cz>
+
+ * gen-*.cs: Renamed to gtest-*.cs.
+ * 2test-20: Renamed to gtest-163.cs.
+ * 2test-21: Renamed to gtest-164.cs.
+ * 2test-22: Renamed to gtest-165.cs.
+ * 2test-*.cs: Renamed to test-*.cs
+ * xml-*.cs: Renamed to test-xml*.cs.
+
+ * Makefile: Switch to compiler-tester.
+
+2005-06-08 Raja R Harinath <rharinath@novell.com>
+
+ * test-388.cs, test-389.cs: New tests from #75160. They're
+ actually interdependent. #75160 is a file-ordering bug, and we
+ use the two testcases to drive the two different orderings.
+ * Makefile (TEST_HARNESS_EXTRAS): Add test-388.cs and test-389.cs.
+
2005-06-03 Raja R Harinath <rharinath@novell.com>
* Makefile (TEST_SOURCES_common): Re-enable test-183: the runtime
# Martin Baulig will manually move them into TEST_SOURCES_common after merging the code into GMCS.
# He may also move some to TEST_EXCLUDE_net_2_0 if some of the merges are inappropriate for GMCS.
#
-NEW_TEST_SOURCES_common = test-386 test-387
+NEW_TEST_SOURCES_common = test-386 test-387 test-388 test-389
#
# Please do _not_ add any tests here - all new tests should go into NEW_TEST_SOURCES_common
TEST_SOURCES_net_2_0 = \
gen-13-dll gen-13-exe gen-17-dll gen-17-exe gen-31-dll gen-31-exe \
- gen-47-dll gen-47-exe gen-98-dll gen-98-exe \
- gen-156-dll gen-156-exe \
+ gen-47-dll gen-47-exe gen-98-dll gen-98-exe \
+ gen-156-dll gen-156-exe gen-161-dll gen-161-exe \
gen-1 gen-2 gen-3 gen-4 gen-5 gen-6 gen-7 gen-8 gen-9 gen-10 \
gen-11 gen-12 gen-14 gen-15 gen-16 gen-18 gen-19 gen-20 \
gen-21 gen-22 gen-23 gen-24 gen-25 gen-26 gen-27 gen-28 gen-29 gen-30 \
gen-121 gen-122 gen-123 gen-124 gen-125 gen-127 gen-128 gen-129 gen-130 \
gen-131 gen-132 gen-133 gen-134 gen-135 gen-136 gen-137 gen-138 gen-139 gen-140 \
gen-141 gen-142 gen-143 gen-144 gen-145 gen-146 gen-147 gen-148 gen-149 gen-150 \
- gen-151 gen-152 gen-153 gen-154 gen-155 gen-157 gen-158 \
+ gen-151 gen-152 gen-153 gen-154 gen-155 gen-157 gen-158 gen-159 gen-160 \
+ gen-162 \
cond-attr fixed-buffer-dll fixed-buffer-exe \
- 2test-19
+ 2test-19 2test-20 2test-21 2test-22
TEST_EXCLUDES_net_2_0 = $(NEW_TEST_SOURCES_common)
# Some tests may require additional files to be available in the current directory.
# To promote interoperability, we prefer that those files not be referred to with ../ or ..\\
# To that end, we will copy those files to the test-harness directory, so that we can refer to simple filenames.
-TEST_HARNESS_EXTRAS = $(wildcard *.inc) test-74.cs test-353-2.cs test-361-2.cs test-377-$(PROFILE)-il.dll
+TEST_HARNESS_EXTRAS = \
+ $(wildcard *.inc) \
+ test-74.cs test-353-2.cs test-361-2.cs test-388.cs test-389.cs \
+ test-377-$(PROFILE)-il.dll
all-local install-local uninstall-local:
test-casts: boot-casts.out mcs-casts.out
cmp $^
-test-local: xmldocdiff.exe casts-boot.exe
+test-local: casts-boot.exe
-run-test-local: ilasm test-harness test-casts
+ifeq (net_2_0, $(PROFILE))
+COMPILER_NAME = gmcs
+COMPILER = $(topdir)/gmcs/gmcs.exe
+TEST_PATTERN = '*test-*.cs'
+else
+COMPILER_NAME = mcs
+COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
+TEST_PATTERN = 'test-*.cs'
+endif
+
+run-test-local: ilasm
+ MONO_RUNTIME=mono $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe positive $(TEST_PATTERN) $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
# do nothing for this target
run-test-ondotnet-local:
clean-local:
-rm -fr dir-*
- -rm -f *.exe *.dll *.netmodule *.out *.pdb casts.cs
+ -rm -f *.exe *.dll *.netmodule *.out *.pdb casts.cs *.log
+ -rm -f xml-*.xml
dist-local: dist-default
rm -f $(distdir)/casts.cs
endif
.PHONY: test-harness test-harness-run
-test-harness: xmldocdiff.exe
+test-harness:
@$(MAKE) -s test-harness-run
exe_tests := $(filter %-exe, $(TEST_SOURCES))
xml-doc-tests := $(filter xml-%, $(TEST_SOURCES))
-xmldocdiff.exe:
- $(CSCOMPILE) xmldocdiff.cs
-
%-il.dll: %-il.il
$(ILASM) /dll $<
--- /dev/null
+// Compiler options: -t:library\r
+
+using System;
+
+public struct Result {
+ public int res;
+ // big enough that it won't be returned in registers
+ double duh;
+ long bah;
+
+ public Result (int val) {
+ res = val;
+ bah = val;
+ duh = val;
+ }
+}
+
+public class Vararg
+{
+ public static int AddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public static int AddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public static Result VtAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public static Result VtAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public int InstAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public int InstAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public Result InstVtAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public Result InstVtAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+}
+++ /dev/null
-using System;
-
-delegate void D ();
-
-class X {
- static void Main ()
- {
- X x = new X (1);
- X y = new X (100);
- D a = x.T ();
- D b = y.T ();
-
- a ();
- b ();
- }
-
- X (int start)
- {
- ins = start;
- }
-
- int ins;
-
- D T ()
- {
- D d = delegate () {
- Console.WriteLine ("My state is: " + CALL ());
- };
-
- return d;
- }
- string CALL ()
- {
- return "GOOD";
- }
-
-}
+++ /dev/null
-delegate void S ();
-
-class X {
-
- //
- // DO NOT ADD ANYTHING ELSE TO THIS TEST
- //
- static int Main ()
- {
- int a;
-
- S b = delegate {
- a = 2;
- };
-
- return 0;
- }
-}
+++ /dev/null
-//
-// This test exercises the access to a field instance from an instance
-// method that has an anonymous method.
-//
-using System;
-
-class S {
- delegate void T ();
-
- T t;
-
- int f;
-
- public void Test ()
- {
- // The loop just forces the creation of a helper class, so
- // that the anonymous method is not placed side-by-side this
- // method.
- int a = 1;
- for (int i = a; i < 10; i++){
- int j = i;
- t = delegate {
- Console.WriteLine ("Before: {0} {1} {2}", f, i, j);
- f = i;
- };
- }
- }
-
- static int Main ()
- {
- S s = new S ();
- s.Test ();
- s.t ();
- if (s.f == 10)
- return 0;
- Console.WriteLine ("Failed:" + s.f);
- return 1;
- }
-}
-
-
+++ /dev/null
-//
-// This test checks various uses of captured local variables
-//
-using System;
-
-delegate void S ();
-
-class X {
- static int Main ()
- {
- int a = 1;
- Console.WriteLine ("A is = " + a);
- int c = a;
- Console.WriteLine (c);
- if (a != 1){
- return 1;
- }
-
- S b = delegate {
- if (a != 1)
- Environment.Exit (1);
- Console.WriteLine ("in Delegate");
- a = 2;
- if (a != 2)
- Environment.Exit (2);
- Console.WriteLine ("Inside = " + a);
- a = 3;
- Console.WriteLine ("After = " + a);
- };
- if (a != 1)
- return 3;
- b ();
- if (a != 3)
- return 4;
- Console.WriteLine ("Back, got " + a);
- Console.WriteLine ("Test is ok");
- return 0;
- }
-}
+++ /dev/null
-//
-// Simple variable capturing
-//
-using System;
-
-delegate void S ();
-
-class X {
- static void Main ()
- {
- int a = 1;
- S b = delegate {
- a = 2;
- };
- b ();
- Console.WriteLine ("Back, got " + a);
- }
-}
+++ /dev/null
-//
-// Capturing test.
-//
-using System;
-
-delegate void S ();
-
-class X {
- static void Main ()
- {
- int a = 1;
- S b = delegate {
- float f = 1;
- Console.WriteLine (a);
- if (f == 2)
- return;
- };
- b ();
- Console.WriteLine ("Back, got " + a);
- }
-}
+++ /dev/null
-//
-// Tests capturing of double nested variables
-//
-using System;
-delegate void S ();
-
-class X {
- static int Main ()
- {
- int i;
- S b = null;
-
- for (i = 0; i < 10; i++){
- int j = 0;
- b = delegate {
- Console.WriteLine ("i={0} j={1}", i, j);
- i = i + 1;
- j = j + 1;
- };
- }
- Console.WriteLine ("i = {0}", i);
- b ();
- Console.WriteLine ("i = {0}", i);
- if (!t (i, 11))
- return 1;
- b ();
- if (!t (i, 12))
- return 2;
- Console.WriteLine ("i = {0}", i);
- Console.WriteLine ("Test is OK");
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+++ /dev/null
-//
-// Tests capturing of variables
-//
-using System;
-
-delegate void S ();
-
-class X {
- static int Main ()
- {
- int a = 1;
- if (a != 1)
- return 1;
-
- Console.WriteLine ("A is = " + a);
- S b= delegate {
- Console.WriteLine ("on delegate");
- a = 2;
- };
- if (a != 1)
- return 2;
- b();
- if (a != 2)
- return 3;
- Console.WriteLine ("OK");
- return 0;
- }
-}
-
+++ /dev/null
-//
-// Tests havign more than one anonymous method that captures the same variable
-//
-using System;
-
-delegate void D ();
-
-class X {
- static int Main ()
- {
- int a = 0;
- D d1 = delegate {
- Console.WriteLine ("First");
- a = 1;
- };
-
- D d2 = delegate {
- Console.WriteLine ("Second");
- a = 2;
- };
- if (!t (a, 0))
- return 1;
- d1 ();
- if (!t (a, 1))
- return 2;
- d2 ();
- if (!t (a, 2))
- return 3;
- Console.WriteLine ("Test passes OK");
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+++ /dev/null
-//
-// Tests assignment of a captured variable to another
-// Do not add anything else to this test.
-//
-delegate void S ();
-
-class X {
-
- //
- // DO NOT ADD ANYTHING ELSE TO THIS TEST
- //
- static int Main ()
- {
- int a = 2;
- int b = 1;
- S d = delegate {
- a = b;
- };
-
- return 0;
- }
-}
+++ /dev/null
-//
-// Tests unary mutator operators on captured variables
-//
-using System;
-
-class X {
- delegate void D ();
-
- static int gt, gj;
-
- static int Main ()
- {
- int times = 0;
-
- D d = delegate {
- int t = times++;
- int j = ++times;
-
- gt = t;
- gj = j;
- };
- d ();
-
- if (gt != 0)
- return 1;
- if (gj != 2)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-//
-// Tests the syntax for delegates and events
-//
-using System;
-
-delegate void ClickEvent ();
-
-class Button {
- public event ClickEvent Clicked;
-
- public void DoClick ()
- {
- Clicked ();
- }
-
-}
-
-class X {
- static bool called = false;
-
- static int Main ()
- {
- Button b = new Button ();
-
- b.Clicked += delegate {
- Console.WriteLine ("This worked!");
- called = true;
- };
-
- b.DoClick ();
-
- if (called)
- return 0;
- else
- return 1;
- }
-
-}
+++ /dev/null
-using System;
-
-delegate void A ();
-
-class DelegateTest {
- static void Main (string[] argv)
- {
- Console.WriteLine ("Test");
-
- foreach (string arg in argv) {
- Console.WriteLine ("OUT: {0}", arg);
- A a = delegate {
- Console.WriteLine ("arg: {0}", arg);
- };
- a ();
- }
- }
-}
-
+++ /dev/null
-//
-// Instance access.
-//
-using System;
-
-delegate void D ();
-
-class X {
- static void Main ()
- {
- X x = new X (1);
- X y = new X (100);
- D a = x.T ();
- D b = y.T ();
-
- a ();
- b ();
- }
-
- X (int start)
- {
- ins = start;
- }
-
- int ins;
-
- D T ()
- {
- D d = delegate () {
- Console.WriteLine ("My state is: " + ins);
- };
-
- return d;
- }
-}
+++ /dev/null
-//
-// Nested anonymous methods tests and capturing of different variables.
-//
-using System;
-
-delegate void D ();
-
-class X {
- static D GlobalStoreDelegate;
-
- static void Main ()
- {
- D d = MainHost ();
-
- d ();
- GlobalStoreDelegate ();
- GlobalStoreDelegate ();
- }
-
- static D MainHost ()
- {
- int toplevel_local = 0;
-
- D d = delegate () {
- int anonymous_local = 1;
-
- GlobalStoreDelegate = delegate {
- Console.WriteLine ("var1: {0} var2: {1}", toplevel_local, anonymous_local);
- anonymous_local = anonymous_local + 1;
- };
-
- toplevel_local = toplevel_local + 1;
- };
-
- return d;
- }
-}
+++ /dev/null
-//
-// Nested anonymous methods and capturing of variables test
-//
-using System;
-
-delegate void D ();
-
-class X {
-
- static int Main ()
- {
- X x = new X();
- x.M ();
- e ();
- Console.WriteLine ("J should be 101= {0}", j);
- if (j != 101)
- return 3;
- Console.WriteLine ("OK");
- return 0;
- }
-
- static int j = 0;
- static D e;
-
- void M ()
- {
- int l = 100;
-
- D d = delegate {
- int b;
- b = 1;
- Console.WriteLine ("Inside d");
- e = delegate {
- Console.WriteLine ("Inside e");
- j = l + b;
- Console.WriteLine ("j={0} l={1} b={2}", j, l, b);
- };
- };
- Console.WriteLine ("Calling d");
- d ();
- }
-
-}
+++ /dev/null
-//
-using System;
-
-delegate void D ();
-
-class X {
- static D r;
-
- static void Main ()
- {
- D d = T ();
-
- d ();
- r ();
- r ();
- }
-
- static D T ()
- {
- int var1 = 0;
-
- D d = delegate () {
- int var2 = 1;
-
- r = delegate {
- Console.WriteLine ("var1: {0} var2: {1}", var1, var2);
- var2 = var2 + 1;
- };
-
- var1 = var1 + 1;
- };
-
- return d;
- }
-}
+++ /dev/null
-using System;
-
-delegate void D ();
-
-class X {
-
- static int Main ()
- {
- X x = new X();
- x.M ();
- e ();
- Console.WriteLine ("J should be 101= {0}", j);
- if (j != 101)
- return 3;
- Console.WriteLine ("OK");
- return 0;
- }
-
- static int j;
- static D e;
-
- void M ()
- {
- int l = 100;
-
- D d = delegate {
- int b;
- b = 1;
- e = delegate {
- j = l + b;
- };
- };
- d ();
- }
-
-}
+++ /dev/null
-//
-// Tests capturing of double nested variables
-//
-using System;
-
-delegate void S ();
-
-class X {
- static int Main ()
- {
- int i;
- int a = 0;
- S b = null;
-
- for (i = 0; i < 10; i++){
- int j = 0;
- b = delegate {
- Console.WriteLine ("i={0} j={1}", i, j);
- i = i + 1;
- j = j + 1;
- a = j;
- };
- }
- b ();
- Console.WriteLine ("i = {0}", i);
- if (!t (i, 11))
- return 1;
- b ();
- if (!t (i, 12))
- return 2;
- Console.WriteLine ("i = {0}", i);
- Console.WriteLine ("a = {0}", a);
- if (!t (a, 2))
- return 3;
-
- return 0;
- }
-
- static bool t (int a, int b)
- {
- return a == b;
- }
-}
+++ /dev/null
-using System;
-
-delegate int D ();
-
-class X {
-
- static void Main ()
- {
- D x = T (1);
-
- Console.WriteLine ("Should be 2={0}", x ());
- }
-
- static D T (int a)
- {
- D d = delegate {
- a = a + 1;
- return a;
- };
-
- return d;
- }
-}
+++ /dev/null
-using System;
-
-delegate int D (int arg);
-
-class X {
-
- static int Main ()
- {
- D x = T (1);
-
- int v = x (10);
- Console.WriteLine ("Should be 11={0}", v);
- return v == 11 ? 0 : 1;
- }
-
- static D T (int a)
- {
- D d = delegate (int arg) {
- return arg + a;
- };
-
- return d;
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-using System;
-
-delegate int D ();
-
-unsafe class X {
-
- static int Main ()
- {
- D x = T (1);
-
- int v = x ();
- Console.WriteLine ("Should be 2={0}", v);
- return v == 2 ? 0 : 1;
- }
-
- static D T (int a)
- {
- D d = delegate {
- int *x = &a;
-
- *x = *x + 1;
- return *x;
- };
-
- return d;
- }
-}
+++ /dev/null
-using System;
-
-delegate void D ();
-
-class X {
-
- static int Main ()
- {
- X x = new X();
- x.M (10);
- e ();
- Console.WriteLine ("J should be 11= {0}", j);
- e ();
- Console.WriteLine ("J should be 11= {0}", j);
- x.M (100);
- e ();
- Console.WriteLine ("J should be 101= {0}", j);
- if (j != 101)
- return 3;
- Console.WriteLine ("OK");
- return 0;
- }
-
- static int j;
- static D e;
-
- void M (int a)
- {
- Console.WriteLine ("A is=" + a);
- D d = delegate {
- int b;
- b = 1;
- e = delegate {
- Console.WriteLine ("IN NESTED DELEGATE: {0}", a);
- j = a + b;
- };
- };
- d ();
- }
-
-}
+++ /dev/null
-using System;
-
-class Delegable {
- public event EventHandler MyDelegate;
-}
-
-class DelegateTest {
- static void Main (string[] argv)
- {
- Console.WriteLine ("Test");
-
- Delegable db = new Delegable ();
- db.MyDelegate += delegate (object o, EventArgs args) {
- Console.WriteLine ("{0}", argv);
- Console.WriteLine ("{0}", db);
- };
- }
-}
-
-
+++ /dev/null
-//
-// Parameter and return value compilation tests for anonymous methods
-//
-delegate void D (int x);
-delegate void E (out int x);
-
-class X {
- static int Main ()
- {
- // This should create an AnonymousMethod with the implicit argument
- D d1 = delegate {};
- D d2 = delegate (int a) {};
-
- return 0;
- }
-}
+++ /dev/null
-using System;
-using System.Collections;
-
-delegate bool predicate (object a);
-
-class X {
-
- static int Main ()
- {
- ArrayList a = new ArrayList ();
- for (int i = 0; i < 10; i++)
- a.Add (i);
-
- ArrayList even = Find (delegate (object arg) {
- return ((((int) arg) % 2) == 0);
- }, a);
-
- Console.WriteLine ("Even numbers");
- foreach (object r in even){
- Console.WriteLine (r);
- }
- if (even.Count != 5)
- return 1;
- if (((int)even [0]) != 0 ||
- ((int)even [1]) != 2 ||
- ((int)even [2]) != 4 ||
- ((int)even [3]) != 6 ||
- ((int)even [4]) != 8)
- return 2;
-
- return 0;
- }
-
- static ArrayList Find (predicate p, ArrayList source)
- {
- ArrayList result = new ArrayList ();
-
- foreach (object a in source){
- if (p (a))
- result.Add (a);
- }
-
- return result;
- }
-}
+++ /dev/null
-//
-// Test for access modifiers
-//
-
-using System;
-
- public class Tester {
-
- static void Main ()
- {
- A a = new A (8);
- B b = new B (9);
-
- b.SetCount (10);
- Console.WriteLine ("b.Count should be 9: {0}", b.Count);
- Console.WriteLine ("b [{0}] should return {0}: {1}", 10, b [10]);
-
- Console.WriteLine ("a.Message : {0}", a.Message);
- b.Message = "";
- Console.WriteLine ("b.Messasge : {0}", b.Message);
- }
-
- }
-
- public class A {
-
- protected int count;
-
- public A (int count)
- {
- this.count = count;
- }
-
- public virtual int Count {
- get {
- return count;
- }
- protected set {
- count = value;
- }
- }
-
- public virtual int this [int index] {
- get {
- return index;
- }
- }
-
- public virtual string Message {
- get {
- return "Hello Mono";
- }
- }
-
- }
-
- public class B : A {
-
- public B (int count) : base (count)
- {
- }
-
- public override int Count {
- protected set {
- }
- }
-
- public void SetCount (int value)
- {
- Count = value;
- }
-
- public override int this [int index] {
- get {
- return base [index];
- }
- }
-
- public new string Message {
- get {
- return "Hello Mono (2)";
- }
- internal set {
- }
- }
-
- }
-
+++ /dev/null
-//
-// acc-modifiers2.cs: We use reflection to test that the flags are the correct ones
-//
-
-using System;
-using System.Reflection;
-
- [AttributeUsage (AttributeTargets.Class)]
- public class TypeCheckAttribute : Attribute {
-
- public TypeCheckAttribute ()
- {
- }
- }
-
- [AttributeUsage (AttributeTargets.Property)]
- public class PropertyCheckAttribute : Attribute {
-
- public PropertyCheckAttribute ()
- {
- }
- }
-
- [AttributeUsage (AttributeTargets.Method)]
- public class AccessorCheckAttribute : Attribute {
- MethodAttributes flags;
-
- public AccessorCheckAttribute (MethodAttributes flags)
- {
- this.flags = flags;
- }
-
- public MethodAttributes Attributes {
- get {
- return flags;
- }
- }
- }
-
- public class Test {
-
- public static int Main (string [] args)
- {
- Type t = typeof (A);
-
- foreach (PropertyInfo pi in t.GetProperties ()) {
- object [] attrs = pi.GetCustomAttributes (typeof (PropertyCheckAttribute), true);
- if (attrs == null)
- return 0;
-
- MethodInfo get_accessor, set_accessor;
- get_accessor = pi.GetGetMethod (true);
- set_accessor = pi.GetSetMethod (true);
-
- if (get_accessor != null)
- CheckFlags (pi, get_accessor);
- if (set_accessor != null)
- CheckFlags (pi, set_accessor);
- }
-
- return 0;
- }
-
- static void CheckFlags (PropertyInfo pi, MethodInfo accessor)
- {
- object [] attrs = accessor.GetCustomAttributes (typeof (AccessorCheckAttribute), true);
- if (attrs == null)
- return;
-
- AccessorCheckAttribute accessor_attr = (AccessorCheckAttribute) attrs [0];
- MethodAttributes accessor_flags = accessor.Attributes;
-
- if ((accessor_flags & accessor_attr.Attributes) == accessor_attr.Attributes)
- Console.WriteLine ("Test for {0}.{1} PASSED", pi.Name, accessor.Name);
- else {
- string message = String.Format ("Test for {0}.{1} INCORRECT: MethodAttributes should be {2}, but are {3}",
- pi.Name, accessor.Name, accessor_attr.Attributes, accessor_flags);
- throw new Exception (message);
- }
- }
-
- }
-
- [TypeCheck]
- public class A {
-
- const MethodAttributes flags = MethodAttributes.HideBySig |
- MethodAttributes.SpecialName;
-
- [PropertyCheck]
- public int Value1 {
- [AccessorCheck (flags | MethodAttributes.Public)]
- get {
- return 0;
- }
- [AccessorCheck (flags | MethodAttributes.Public)]
- set {
- }
- }
-
- [PropertyCheck]
- public int Value2 {
- [AccessorCheck (flags | MethodAttributes.Public)]
- get {
- return 0;
- }
- [AccessorCheck (flags | MethodAttributes.FamORAssem)]
- protected internal set {
- }
- }
-
- [PropertyCheck]
- public int Value3 {
- [AccessorCheck (flags | MethodAttributes.Public)]
- get {
- return 0;
- }
- [AccessorCheck (flags | MethodAttributes.Family)]
- protected set {
- }
- }
-
- [PropertyCheck]
- public int Value4 {
- [AccessorCheck (flags | MethodAttributes.Assembly)]
- internal get {
- return 0;
- }
- [AccessorCheck (flags | MethodAttributes.Public)]
- set {
- }
- }
-
- [PropertyCheck]
- public int Value5 {
- [AccessorCheck (flags | MethodAttributes.Public)]
- get {
- return 0;
- }
- [AccessorCheck (flags | MethodAttributes.Private)]
- private set {
- }
- }
-
- }
-
+++ /dev/null
-// cs0146.cs: circular class definition
-// Line: 6
-class A : B {
-}
-
-class B : A {
-}
+++ /dev/null
-class X {
-}
+++ /dev/null
-using System;
-class Test {
-
- static void receive_int (int a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_uint (uint a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_short (short a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ushort (ushort a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_long (long a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ulong (ulong a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_sbyte (sbyte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_byte (byte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_char (char a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void probe_int()
- {
- int zero = (int) 0;
- int min = (int) int.MinValue;
- int max = (int) int.MaxValue;
-
- Console.WriteLine ("Testing: int");
-
- Console.WriteLine (" arg: int (int)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (int)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (int)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (int)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (int)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (int)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (int)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (int)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (int)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_uint()
- {
- uint zero = (uint) 0;
- uint min = (uint) uint.MinValue;
- uint max = (uint) uint.MaxValue;
-
- Console.WriteLine ("Testing: uint");
-
- Console.WriteLine (" arg: int (uint)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (uint)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (uint)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (uint)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (uint)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (uint)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (uint)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (uint)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (uint)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_short()
- {
- short zero = (short) 0;
- short min = (short) short.MinValue;
- short max = (short) short.MaxValue;
-
- Console.WriteLine ("Testing: short");
-
- Console.WriteLine (" arg: int (short)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (short)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (short)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (short)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (short)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (short)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (short)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (short)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (short)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_ushort()
- {
- ushort zero = (ushort) 0;
- ushort min = (ushort) ushort.MinValue;
- ushort max = (ushort) ushort.MaxValue;
-
- Console.WriteLine ("Testing: ushort");
-
- Console.WriteLine (" arg: int (ushort)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (ushort)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (ushort)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (ushort)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (ushort)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (ushort)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (ushort)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (ushort)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (ushort)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_long()
- {
- long zero = (long) 0;
- long min = (long) long.MinValue;
- long max = (long) long.MaxValue;
-
- Console.WriteLine ("Testing: long");
-
- Console.WriteLine (" arg: int (long)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (long)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (long)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (long)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (long)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (long)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (long)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (long)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (long)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_ulong()
- {
- ulong zero = (ulong) 0;
- ulong min = (ulong) ulong.MinValue;
- ulong max = (ulong) ulong.MaxValue;
-
- Console.WriteLine ("Testing: ulong");
-
- Console.WriteLine (" arg: int (ulong)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (ulong)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (ulong)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (ulong)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (ulong)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (ulong)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (ulong)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (ulong)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (ulong)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_sbyte()
- {
- sbyte zero = (sbyte) 0;
- sbyte min = (sbyte) sbyte.MinValue;
- sbyte max = (sbyte) sbyte.MaxValue;
-
- Console.WriteLine ("Testing: sbyte");
-
- Console.WriteLine (" arg: int (sbyte)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (sbyte)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (sbyte)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (sbyte)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (sbyte)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (sbyte)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (sbyte)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (sbyte)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (sbyte)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_byte()
- {
- byte zero = (byte) 0;
- byte min = (byte) byte.MinValue;
- byte max = (byte) byte.MaxValue;
-
- Console.WriteLine ("Testing: byte");
-
- Console.WriteLine (" arg: int (byte)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (byte)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (byte)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (byte)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (byte)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (byte)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (byte)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (byte)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (byte)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void probe_char()
- {
- char zero = (char) 0;
- char min = (char) char.MinValue;
- char max = (char) char.MaxValue;
-
- Console.WriteLine ("Testing: char");
-
- Console.WriteLine (" arg: int (char)");
-
- receive_int (unchecked((int) zero));
- receive_int (unchecked((int) min));
- receive_int (unchecked((int) max));
- Console.WriteLine (" arg: uint (char)");
-
- receive_uint (unchecked((uint) zero));
- receive_uint (unchecked((uint) min));
- receive_uint (unchecked((uint) max));
- Console.WriteLine (" arg: short (char)");
-
- receive_short (unchecked((short) zero));
- receive_short (unchecked((short) min));
- receive_short (unchecked((short) max));
- Console.WriteLine (" arg: ushort (char)");
-
- receive_ushort (unchecked((ushort) zero));
- receive_ushort (unchecked((ushort) min));
- receive_ushort (unchecked((ushort) max));
- Console.WriteLine (" arg: long (char)");
-
- receive_long (unchecked((long) zero));
- receive_long (unchecked((long) min));
- receive_long (unchecked((long) max));
- Console.WriteLine (" arg: ulong (char)");
-
- receive_ulong (unchecked((ulong) zero));
- receive_ulong (unchecked((ulong) min));
- receive_ulong (unchecked((ulong) max));
- Console.WriteLine (" arg: sbyte (char)");
-
- receive_sbyte (unchecked((sbyte) zero));
- receive_sbyte (unchecked((sbyte) min));
- receive_sbyte (unchecked((sbyte) max));
- Console.WriteLine (" arg: byte (char)");
-
- receive_byte (unchecked((byte) zero));
- receive_byte (unchecked((byte) min));
- receive_byte (unchecked((byte) max));
- Console.WriteLine (" arg: char (char)");
-
- receive_char (unchecked((char) zero));
- receive_char (unchecked((char) min));
- receive_char (unchecked((char) max));
- }
-
- static void Main ()
- {
- probe_int ();
- probe_uint ();
- probe_short ();
- probe_ushort ();
- probe_long ();
- probe_ulong ();
- probe_sbyte ();
- probe_byte ();
- probe_char ();
- }
-}
-
+++ /dev/null
-using System;
-using System.Reflection;
-using System.ComponentModel;
-
-[assembly: CLSCompliant(true)]
-[assembly: AssemblyTitle("")]
-
-public class CLSCLass_6 {
- private object disposedEvent = new object ();
- public EventHandlerList event_handlers;
-
- public event Delegate Disposed {
- add { event_handlers.AddHandler (disposedEvent, value); }
- remove { event_handlers.RemoveHandler (disposedEvent, value); }
- }
-}
-
-public delegate CLSDelegate Delegate ();
-
-[Serializable]
-public class CLSDelegate {
-}
-
-internal class CLSClass_5 {
- [CLSCompliant (true)]
- public uint Test () {
- return 1;
- }
-}
-
-[CLSCompliant (true)]
-public class CLSClass_4 {
- [CLSCompliant (false)]
- public uint Test () {
- return 1;
- }
-}
-
-public class CLSClass_3 {
- [CLSCompliant (false)]
- public uint Test_3 () {
- return 6;
- }
-}
-
-[CLSCompliant(false)]
-public class CLSClass_2 {
- public sbyte XX {
- get { return -1; }
- }
-}
-
-class CLSClass_1 {
- public UInt32 Valid() {
- return 5;
- }
-}
-
-[CLSCompliant(true)]
-public class CLSClass {
-
- private class C1 {
-
- [CLSCompliant(true)]
- public class C11 {
- protected ulong Foo3() {
- return 1;
- }
- }
-
- protected long Foo2() {
- return 1;
- }
- }
-
- [CLSCompliant(false)]
- protected internal class CLSClass_2 {
- public sbyte XX {
- get { return -1; }
- }
- }
-
-
- [CLSCompliant(true)]
- private ulong Valid() {
- return 1;
- }
-
- [CLSCompliant(true)]
- public byte XX {
- get { return 5; }
- }
-
-// protected internal sbyte FooProtectedInternal() {
-// return -4;
-// }
-
- internal UInt32 FooInternal() {
- return 1;
- }
-
- private ulong Foo() {
- return 1;
- }
-
-
- public static void Main() {}
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-public class CLSClass {
-
- public byte XX {
- get { return 5; }
- }
-
- public static void Main() {}
-}
\ No newline at end of file
+++ /dev/null
-using System;
-[assembly:CLSCompliant (true)]
-
-[CLSCompliant (false)]
-public interface I {
- [CLSCompliant (false)]
- void Error (ulong arg);
-}
-
-[CLSCompliant (false)]
-public interface I2 {
- [CLSCompliant (true)]
- void Error (long arg);
-}
-
-
-public class MainClass {
- public static void Main () {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-[assembly:CLSCompliant (true)]
-
-[CLSCompliant (true)]
-public abstract class CLSClass {
- [CLSCompliant (true)]
- public abstract void Test (IComparable arg);
-}
-
-public abstract class CLSCLass_2 {
- public abstract void Test ();
-}
-
-public class MainClass {
- public static void Main () {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-[module: CLSCompliant(true)]
-[assembly: CLSCompliant(true)]
-
-public class MainClass {
- public static void Main () {
- }
-}
+++ /dev/null
-using System;
-
-public class CLSClass {
- [CLSCompliant (false)]
- static public implicit operator CLSClass(byte value) {
- return new CLSClass();
- }
-
- [CLSCompliant (true)]
- private void Error (bool arg) {
- }
-}
-
-public class MainClass {
- public static void Main () {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-[assembly:CLSCompliant (true)]
-
-public class CLSAttribute_1: Attribute {
- public CLSAttribute_1(int[] array) {
- }
-
- public CLSAttribute_1(int array) {
- }
-}
-
-[CLSCompliant (false)]
-public class CLSAttribute_2: Attribute {
- private CLSAttribute_2(int arg) {
- }
-}
-
-internal class CLSAttribute_3: Attribute {
- public CLSAttribute_3(int[] array) {
- }
-}
-
-[CLSCompliant (false)]
-public class CLSAttribute_4: Attribute {
- private CLSAttribute_4(int[] args) {
- }
-}
-
-public class ClassMain {
- public static void Main () {}
-}
\ No newline at end of file
+++ /dev/null
-using System;
-[assembly:CLSCompliant (true)]
-
-[CLSCompliant (false)]
-[CLSAttribute (new bool [] {true, false})]
-public class CLSAttribute: Attribute {
- public CLSAttribute(bool[] array) {
- }
-}
-
-public class ClassMain {
- public static void Main () {}
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Reflection;
-
-[assembly: CLSCompliant (true)]
-
-public class CLSClass {
- [CLSCompliant(false)]
- public CLSClass(ulong l) {}
- internal CLSClass(uint i) {}
-
- [CLSCompliant(false)]
- public ulong X_0 {
- set {}
- }
-
- [CLSCompliant(false)]
- protected ulong this[ulong i] {
- set {}
- }
-
- [CLSCompliant(false)]
- public ulong X_1;
-
- internal ulong X_2;
-
- public static void Main() {
- }
-}
-public class InnerTypeClasss {
- public struct Struct {
- }
-
- public Struct Method () {
- return new Struct ();
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-[assembly:CLSCompliant(true)]
-
-public interface I1 {
-}
-
-public class CLSClass {
- protected internal I1 Foo() {
- return null;
- }
-
- static void Main() {}
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-[assembly:CLSCompliant(true)]
-
-class X1 {
- public bool AA;
- internal bool aa;
-}
-
-class X2: X1 {
- public bool aA;
-}
-
-public class X3 {
- internal void bb(bool arg) {}
- internal bool bB;
- public void BB() {}
-}
-
-class X4 {
- public void method(int arg) {}
- public void method(bool arg) {}
- public bool method() { return false; }
-}
-
-
-public class BaseClass {
- //protected internal bool mEthod() { return false; }
-}
-
-public class CLSClass: BaseClass {
- public CLSClass() {}
- public CLSClass(int arg) {}
-
- //public int this[int index] { set {} }
- //protected int this[bool index] { set {} }
-
- public bool setItem;
- static public implicit operator CLSClass(bool value) {
- return new CLSClass(2);
- }
-
- static public implicit operator CLSClass(int value) {
- return new CLSClass(2);
- }
-
- [CLSCompliant(false)]
- public void Method() {}
-
- internal int Method(bool arg) { return 1; }
- internal void methoD() {}
-
- public static void Main() {}
-}
-
-public class oBject: Object {
-}
-
-namespace A {
- public class C1 {
- }
-}
-
-namespace B {
- public class c1 {
- }
-}
-
-public class c1 {
-}
-// Test
-[System.CLSCompliant (false)]
-public interface I1 {
-}
-
-public interface i1 {
-}
-
-// Test
-enum AB {
-}
-
-[CLSCompliant (false)]
-public enum aB {
-}
-
-public interface ab {
-}
-
-// Test
-public class CLSClass_2 {
- [CLSCompliant (false)]
- public void Method () {}
- public void method () {}
-}
-
-// Test
-namespace System {
- public class sByte {
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-[assembly:CLSCompliant(true)]
-
-[CLSCompliant(false)]
-public delegate uint MyDelegate();
-
-[CLSCompliant(false)]
-public interface IFake {
- [CLSCompliant(true)]
- long AA(long arg);
- [CLSCompliant(false)]
- ulong BB { get; }
- //[CLSCompliant(false)]
- //sbyte this[ulong I] { set; }
- [CLSCompliant(false)]
- event MyDelegate MyEvent;
-}
-
-[CLSCompliant(false)]
-internal interface I {
- [CLSCompliant(false)]
- void Foo();
-
- [CLSCompliant(true)]
- ulong this[int indexA] { set; }
-}
-
-interface I2 {
- int Test(int arg1, bool arg2);
-}
-
-public class CLSClass {
- [CLSCompliant(false)]
- public delegate uint MyDelegate();
-
- public static void Main() {}
-}
-public class CLSClass_2 {
- [CLSCompliant (false)]
- public CLSClass_2(int[,,] b) {
- }
-
- public CLSClass_2(int[,] b) {
- }
-
- public void Test (int[,] b, int i) {}
- public void Test (int[,,] b, bool b2) {}
-}
-
-public class X1 {
- [CLSCompliant (false)]
- public void M2 (int i) {}
-}
-
-public class X2: X1 {
- public void M2 (ref int i) {}
-}
+++ /dev/null
-using System;
-
-[assembly:CLSCompliant(true)]
-
-namespace aa {
- public class I1 {
- }
-}
-
-namespace bb {
- public interface i1 {
- }
-}
-
-public class CLSClass {
- public static void Main() {}
-}
\ No newline at end of file
+++ /dev/null
-class X {\r
- const int x = 1;\r
- const string s = "Hello";\r
-}\r
+++ /dev/null
-#define DEBUG
-
-using System;
-using System.Diagnostics;
-
-[Conditional("DEBUG")]
-public class TestAttribute : Attribute {}
-
-[Conditional("RELEASE")]
-public class TestNotAttribute : Attribute {}
-
-[Conditional("A")]
-[Conditional("DEBUG")]
-[Conditional("B")]
-public class TestMultiAttribute : Attribute {}
-
-// TestAttribute is included
-[Test]
-class Class1 {}
-
-// TestNotAttribute is not included
-[TestNot]
-class Class2 {}
-
-// Is included
-[TestMulti]
-class Class3 {}
-
-
-public class TestClass
-{
- public static int Main ()
- {
- if (Attribute.GetCustomAttributes (typeof (Class1)).Length != 1)
- return 1;
-
- if (Attribute.GetCustomAttributes (typeof (Class2)).Length != 0)
- return 1;
-
- if (Attribute.GetCustomAttributes (typeof (Class3)).Length != 1)
- return 1;
-
- Console.WriteLine ("OK");
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public class A
-{
- public static bool operator==(A a1, A a2)
- {
- return true;
- }
-
- public static bool operator!=(A a1, A a2)
- {
- return false;
- }
-
- public override bool Equals (object o)
- {
- return true;
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- public int KK () { return 1; }
-}
-
-public class B : A {
-}
-
+++ /dev/null
-// Compiler options: -r:conv-dll.dll
-
-public class MainClass
-{
- public static int Main ()
- {
- A a = new A ();
- B b = new B ();
- bool r = (a == b);
-
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -langversion:default
-// Test for covariance support in delegates
-//
-
-using System;
-
- public class A {
- protected string name;
-
- public A (string name)
- {
- this.name = "A::" + name;
- }
-
- public A ()
- {
- }
-
- public string Name {
- get {
- return name;
- }
- }
- }
-
- public class B : A {
- public B (string name)
- {
- this.name = "B::" + name;
- }
-
- public B ()
- {
- }
- }
-
- public class C : B {
- public C (string name)
- {
- this.name = "C::" + name;
- }
- }
-
- public class Tester {
-
- delegate A MethodHandler (string name);
-
- static A MethodSampleA (string name)
- {
- return new A (name);
- }
-
- static B MethodSampleB (string name)
- {
- return new B (name);
- }
-
- static C MethodSampleC (string name)
- {
- return new C (name);
- }
-
- static void Main ()
- {
- MethodHandler a = MethodSampleA;
- MethodHandler b = MethodSampleB;
- MethodHandler c = MethodSampleC;
-
- A instance1 = a ("Hello");
- A instance2 = b ("World");
- A instance3 = c ("!");
-
- Console.WriteLine (instance1.Name);
- Console.WriteLine (instance2.Name);
- Console.WriteLine (instance3.Name);
- }
-
- }
-
+++ /dev/null
-// Compiler options: -langversion:default
-//
-// Test for contravariance support in delegates
-//
-
-using System;
-
- public class A {
- protected string name;
-
- public A (string name)
- {
- this.name = "A::" + name;
- }
-
- public A ()
- {
- }
-
- public string Name {
- get {
- return name;
- }
- }
- }
-
- public class B : A {
- public B (string name)
- {
- this.name = "B::" + name;
- }
-
- public B ()
- {
- }
- }
-
- public class C : B {
- string value;
-
- public C (string name, string value)
- {
- this.name = "C::" + name;
- this.value = value;
- }
-
- public string Value {
- get {
- return value;
- }
- }
- }
-
- public class Tester {
-
- delegate string MethodHandler (C c);
-
- static string MethodSampleA (A value)
- {
- return value.Name;
- }
-
- static string MethodSampleB (B value)
- {
- return value.Name;
- }
-
- static string MethodSampleC (C value)
- {
- return value.Name + " " + value.Value;
- }
-
- static void Main ()
- {
- MethodHandler da = MethodSampleA;
- MethodHandler db = MethodSampleB;
- MethodHandler dc = MethodSampleC;
-
- C a = new C ("Hello", "hello");
- C b = new C ("World", "world");
- C c = new C ("!", "!!!");
-
- Console.WriteLine (da (a));
- Console.WriteLine (db (b));
- Console.WriteLine (dc (c));
- }
-
- }
-
+++ /dev/null
-// Compiler options: -langversion:default
-//
-// Test for contravariance support in delegates
-//
-
-using System;
-
- public class A {
- protected string name;
-
- public A (string name)
- {
- this.name = "A::" + name;
- }
-
- public A ()
- {
- }
-
- public string Name {
- get {
- return name;
- }
- }
- }
-
- public class B : A {
- public B (string name)
- {
- this.name = "B::" + name;
- }
-
- public B ()
- {
- }
- }
-
- public class C : B {
- string value;
-
- public C (string name, string value)
- {
- this.name = "C::" + name;
- this.value = value;
- }
-
- public string Value {
- get {
- return value;
- }
- }
- }
-
- public class Tester {
-
- delegate void MethodHandler (C c1, C c2, C c3);
-
- static void MethodSample (B b, A a, C c)
- {
- Console.WriteLine ("b = {0}", b.Name);
- Console.WriteLine ("a = {0}", a.Name);
- Console.WriteLine ("c = {0}, {1}", c.Name, c.Value);
- }
-
- static void Main ()
- {
- MethodHandler mh = MethodSample;
-
- C a = new C ("Hello", "hello");
- C b = new C ("World", "world");
- C c = new C ("!", "!!!");
-
- mh (b, a, c);
- }
-
- }
-
+++ /dev/null
-class X {\r
-}\r
-\r
-struct Y {\r
-}\r
+++ /dev/null
-// Compiler options: -t:library -unsafe
-
-public unsafe struct ExternalStruct
-{
- public fixed double double_buffer [4];
-}
+++ /dev/null
-// Compiler options: -unsafe -r:fixed-buffer-dll.dll
-
-using System;
-
-public unsafe struct TestNew {
- private fixed char test_1 [128];
- public fixed bool test2 [4];
-
- public fixed int T [2];
- public fixed bool test20 [4], test21 [40];
-
- private int foo, foo2;
- public void SetTest () {
- fixed (char* c = test_1) {
- *c = 'g';
- }
- }
-}
-
-public class C {
- unsafe static int Test () {
- TestNew tt = new TestNew ();
- tt.SetTest ();
- tt.test2 [2] = false;
- tt.T [1] = 5544;
- if (tt.T [1] != 5544)
- return 2;
-
- ExternalStruct es = new ExternalStruct ();
- es.double_buffer [1] = 999999.8888;
- es.double_buffer [0] = es.double_buffer [1];
-
- // Attributes test
- if (Attribute.GetCustomAttribute (typeof (TestNew).GetField ("test2"), typeof (System.Runtime.CompilerServices.FixedBufferAttribute)) == null)
- return 3;
-
-
- if (typeof (TestNew).GetNestedTypes ().Length != 5)
- return 5;
-
- foreach (Type t in typeof (TestNew).GetNestedTypes ()) {
- if (Attribute.GetCustomAttribute (t, typeof (System.Runtime.CompilerServices.CompilerGeneratedAttribute)) == null)
- return 4;
- }
-
- Console.WriteLine ("OK");
- return 0;
- }
-
- public static int Main () {
- return Test ();
- }
-}
+++ /dev/null
-class Stack < type > {
-
-}
-
-class Boot {
- static void Main ()
- {
- }
-}
+++ /dev/null
-// Type parameters with constraints: check whether we can invoke
-// things on the constrained type.
-
-using System;
-
-interface I
-{
- void Hello ();
-}
-
-class J
-{
- public void Foo ()
- {
- Console.WriteLine ("Foo!");
- }
-}
-
-class Stack<T>
- where T : J, I
-{
- public void Test (T t)
- {
- t.Hello ();
- t.Foo ();
- }
-}
-
-class Test
-{
-}
-
-class X
-{
- static void Main()
- {
- }
-}
+++ /dev/null
-using System;
-
-// Runtime test for mono_class_setup_vtable()
-namespace C5
-{
- public interface ICollection<T>
- {
- void Test<U> ();
- }
-
- public abstract class ArrayBase<T> : ICollection<T>
- {
- void ICollection<T>.Test<U> ()
- { }
- }
-
- public class ArrayList<V> : ArrayBase<V>
- {
- }
-}
-
-class X
-{
- static void Main ()
- {
- C5.ArrayList<int> array = new C5.ArrayList<int> ();
- }
-}
+++ /dev/null
-using System;
-
-public class Test
-{
- static void Main ()
- {
- SimpleStruct <string> s = new SimpleStruct <string> ();
- }
-}
-
-public struct SimpleStruct <T>
-{
- T data;
-
- public SimpleStruct (T data)
- {
- this.data = data;
- }
-}
+++ /dev/null
-using System;
-
-class A<T>
- where T: IComparable
-{
-}
-
-class B<U,V>
- where U: IComparable
- where V: A<U>
-{
-}
-
-class Driver
-{
- public static void Main ()
- {
- A<int> a_int;
- B<int,A<int>> b_stuff;
- }
-}
+++ /dev/null
-public interface IFoo<T>
-{ }
-
-public class Foo : IFoo<string>
-{ }
-
-public class Hello
-{
- public void World<U> (U u, IFoo<U> foo)
- { }
-
- public void World<V> (IFoo<V> foo)
- { }
-
- public void Test (Foo foo)
- {
- World ("Canada", foo);
- World (foo);
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-class MainClass
-{
- class Gen<T>
- {
- public void Test ()
- { }
- }
-
- class Der : Gen<int>
- {
- }
-
- static void Main ()
- {
- object o = new Der ();
- Gen<int> b = (Gen<int>) o;
- b.Test ();
- }
-}
-
+++ /dev/null
-namespace A
-{
- public struct KeyValuePair<X,Y>
- {
- public KeyValuePair (X x, Y y)
- { }
- }
-
- public interface IComparer<T>
- {
- int Compare (T x);
- }
-
- public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
- {
- public int Compare (KeyValuePair<K,V> a)
- {
- return 0;
- }
- }
-
- public class TreeBag<T>
- {
- IComparer<T> comparer;
-
- public TreeBag (IComparer<T> comparer)
- {
- this.comparer = comparer;
- }
-
- public int Find (ref T item)
- {
- return comparer.Compare (item);
- }
- }
-
- public class X
- {
- public static void Test ()
- {
- KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
- KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
- TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer);
- bag.Find (ref pair);
- }
- }
-}
-
-namespace B
-{
- public class KeyValuePair<X,Y>
- {
- public KeyValuePair (X x, Y y)
- { }
- }
-
- public interface IComparer<T>
- {
- int Compare (T x);
- }
-
- public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
- {
- public int Compare (KeyValuePair<K,V> a)
- {
- return 0;
- }
- }
-
- public class TreeBag<T>
- {
- IComparer<T> comparer;
-
- public TreeBag (IComparer<T> comparer)
- {
- this.comparer = comparer;
- }
-
- public int Find (ref T item)
- {
- return comparer.Compare (item);
- }
- }
-
- public class X
- {
- public static void Test ()
- {
- KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
- KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
- TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer);
- bag.Find (ref pair);
- }
- }
-}
-
-class X
-{
- static void Main ()
- {
- A.X.Test ();
- B.X.Test ();
- }
-}
+++ /dev/null
-public struct KeyValuePair<X,Y>
-{
- public KeyValuePair (X x, Y y)
- { }
-}
-
-public interface IComparer<T>
-{
- int Compare (T x);
-}
-
-public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
-{
- public int Compare (KeyValuePair<K,V> a)
- {
- return 0;
- }
-}
-
-public class TreeBag<T>
-{
- IComparer<T> comparer;
- T item;
-
- public TreeBag (IComparer<T> comparer, T item)
- {
- this.comparer = comparer;
- this.item = item;
- }
-
- public int Find ()
- {
- return comparer.Compare (item);
- }
-}
-
-public class X
-{
- public static void Main ()
- {
- KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
- KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
- TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer, pair);
- bag.Find ();
- }
-}
+++ /dev/null
-using System;
-
-public delegate V Mapper<T,V> (T item);
-
-public interface ITree<T>
-{
- void Map<V> (Mapper<T,V> mapper);
-}
-
-public class Tree<T> : ITree<T>
-{
- T item;
-
- public Tree (T item)
- {
- this.item = item;
- }
-
- public void Map<V> (Mapper<T,V> mapper)
- {
- V new_item = mapper (item);
- }
-}
-
-class X
-{
- private string themap (int i)
- {
- return String.Format ("AA {0,4} BB", i);
- }
-
- void Test ()
- {
- Tree<int> tree = new Tree<int> (3);
- tree.Map (new Mapper<int,string> (themap));
- }
-
- static void Main ()
- {
- X x = new X ();
- x.Test ();
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-public class Test<T>
-{
- protected T item;
-
- public Test (T item)
- {
- this.item = item;
- }
-
- public IEnumerator<T> GetEnumerator()
- {
- yield return item;
- }
-}
-
-class X
-{
- static void Main ()
- {
- Test<int> test = new Test<int> (3);
- foreach (int a in test)
- ;
- }
-}
+++ /dev/null
-using System;
-
-class X {
- static void Main ()
- {
- int [] foo = null;
- Array.Resize (ref foo, 10);
- }
-}
+++ /dev/null
-class Stack<S>
-{
- public void Hello (S s)
- { }
-}
-
-class X
-{
- Stack<int> stack;
-
- void Test ()
- {
- stack.Hello (3);
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public interface IList<R>
-{
- int Map<S> (S item);
-}
-
-public class List<T> : IList<T>
-{
- public int Map<U> (U item)
- {
- return 1;
- }
-}
-
-public class SpecialList<V> : IList<V>
-{
- public int Map<W> (W item)
- {
- return 2;
- }
-}
-
-class X
-{
- static int Main ()
- {
- IList<int> list = new List<int> ();
- int result = list.Map ("Hello");
- if (result != 1)
- return 1;
-
- IList<int> list2 = new SpecialList<int> ();
- int result2 = list2.Map ("World");
- if (result2 != 2)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-using System;
-
-public struct KeyValuePair<K,V>
-{
- public K key;
- public V value;
-
- public KeyValuePair(K k, V v) { key = k; value = v; }
-
- public KeyValuePair(K k) { key = k; value = default(V); }
-}
-
-public class Collection<T>
-{
- public readonly T Item;
-
- public Collection (T item)
- {
- this.Item = item;
- }
-
- public void Find (ref T item)
- {
- item = Item;
- }
-}
-
-class X
-{
- static int Main ()
- {
- KeyValuePair<int,long> p = new KeyValuePair<int,long> (3);
- KeyValuePair<int,long> q = new KeyValuePair<int,long> (5, 9);
-
- Collection<KeyValuePair<int,long>> c = new Collection<KeyValuePair<int,long>> (q);
- c.Find (ref p);
-
- if (p.key != 5)
- return 1;
- if (p.value != 9)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-using System;
-
-public interface IComparer<T>
-{
- void Compare (T a);
-}
-
-class IC : IComparer<Foo<int>>
-{
- public void Compare (Foo<int> a)
- { }
-}
-
-public struct Foo<K>
-{
- public K Value;
-
- public Foo (K value)
- {
- Value = value;
- }
-}
-
-public class List<T>
-{
- public virtual void Sort (IComparer<T> c, T t)
- {
- Sorting.IntroSort<T> (c, t);
- }
-}
-
-public class Sorting
-{
- public static void IntroSort<T> (IComparer<T> c, T t)
- {
- new Sorter<T> (c, 4, t).InsertionSort (0);
- }
-
- class Sorter<T>
- {
- IComparer<T> c;
- T[] a;
-
- public Sorter (IComparer<T> c, int size, T item)
- {
- this.c = c;
- a = new T [size];
- }
-
- internal void InsertionSort (int i)
- {
- T other;
- c.Compare (other = a[i]);
- }
- }
-}
-
-class X
-{
- static void Main ()
- {
- List<Foo<int>> list = new List<Foo<int>> ();
- Foo<int> foo = new Foo<int> (3);
- list.Sort (new IC (), foo);
- }
-}
+++ /dev/null
-using System;
-
-public delegate V Mapper<T,V> (T item);
-
-public class List<T>
-{
- public void Map<V> (Mapper<T,V> mapper)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- List<int> list = new List<int> ();
- list.Map (new Mapper<int,double> (delegate (int i) { return i/10.0; }));
- }
-}
-
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-public class NaturalComparer<T> : IComparer<T>
- where T: IComparable<T>
-{
- public int Compare (T a, T b)
- {
- return a.CompareTo (b);
- }
-}
-
-public class X
-{
- class Test : IComparable<Test>
- {
- public int CompareTo (Test that)
- {
- return 0;
- }
-
- public bool Equals (Test that)
- {
- return false;
- }
- }
-
- static void Main ()
- {
- IComparer<Test> cmp = new NaturalComparer<Test> ();
- Test a = new Test ();
- Test b = new Test ();
- cmp.Compare (a, b);
- }
-}
+++ /dev/null
-//-- ex-gen-class-linkedlist
-//-- ex-anonymous-method-linkedlist
-//-- ex-gen-printable
-//-- ex-gen-interface-ilist
-//-- ex-gen-linkedlist-map
-//-- ex-gen-linkedlistenumerator
-//-- ex-gen-delegate-fun
-
-// A generic LinkedList class
-
-using System;
-using System.IO; // TextWriter
-using System.Collections;
-using System.Collections.Generic; // IEnumerable<T>, IEnumerator<T>
-
-public delegate R Mapper<A,R>(A x);
-
-public interface IMyList<T> : IEnumerable<T> {
- int Count { get; } // Number of elements
- T this[int i] { get; set; } // Get or set element at index i
- void Add(T item); // Add element at end
- void Insert(int i, T item); // Insert element at index i
- void RemoveAt(int i); // Remove element at index i
- IMyList<U> Map<U>(Mapper<T,U> f); // Map f over all elements
-}
-
-public class LinkedList<T> : IMyList<T> {
- protected int size; // Number of elements in the list
- protected Node first, last; // Invariant: first==null iff last==null
-
- protected class Node {
- public Node prev, next;
- public T item;
-
- public Node(T item) {
- this.item = item;
- }
-
- public Node(T item, Node prev, Node next) {
- this.item = item; this.prev = prev; this.next = next;
- }
- }
-
- public LinkedList() {
- first = last = null;
- size = 0;
- }
-
- public LinkedList(params T[] arr) : this() {
- foreach (T x in arr)
- Add(x);
- }
-
- public int Count {
- get { return size; }
- }
-
- public T this[int i] {
- get { return get(i).item; }
- set { get(i).item = value; }
- }
-
- private Node get(int n) {
- if (n < 0 || n >= size)
- throw new IndexOutOfRangeException();
- else if (n < size/2) { // Closer to front
- Node node = first;
- for (int i=0; i<n; i++)
- node = node.next;
- return node;
- } else { // Closer to end
- Node node = last;
- for (int i=size-1; i>n; i--)
- node = node.prev;
- return node;
- }
- }
-
- public void Add(T item) {
- Insert(size, item);
- }
-
- public void Insert(int i, T item) {
- if (i == 0) {
- if (first == null) // and thus last == null
- first = last = new Node(item);
- else {
- Node tmp = new Node(item, null, first);
- first.prev = tmp;
- first = tmp;
- }
- size++;
- } else if (i == size) {
- if (last == null) // and thus first = null
- first = last = new Node(item);
- else {
- Node tmp = new Node(item, last, null);
- last.next = tmp;
- last = tmp;
- }
- size++;
- } else {
- Node node = get(i);
- // assert node.prev != null;
- Node newnode = new Node(item, node.prev, node);
- node.prev.next = newnode;
- node.prev = newnode;
- size++;
- }
- }
-
- public void RemoveAt(int i) {
- Node node = get(i);
- if (node.prev == null)
- first = node.next;
- else
- node.prev.next = node.next;
- if (node.next == null)
- last = node.prev;
- else
- node.next.prev = node.prev;
- size--;
- }
-
- public override bool Equals(Object that) {
- if (that != null && GetType() == that.GetType()
- && this.size == ((IMyList<T>)that).Count) {
- Node thisnode = this.first;
- IEnumerator<T> thatenm = ((IMyList<T>)that).GetEnumerator();
- while (thisnode != null) {
- if (!thatenm.MoveNext())
- throw new ApplicationException("Impossible: LinkedList<T>.Equals");
- // assert MoveNext() was true (because of the above size test)
- if (!thisnode.item.Equals(thatenm.Current))
- return false;
- thisnode = thisnode.next;
- }
- // assert !MoveNext(); // because of the size test
- return true;
- } else
- return false;
- }
-
- public override int GetHashCode() {
- int hash = 0;
- foreach (T x in this)
- hash ^= x.GetHashCode();
- return hash;
- }
-
- public static explicit operator LinkedList<T>(T[] arr) {
- return new LinkedList<T>(arr);
- }
-
- public static LinkedList<T> operator +(LinkedList<T> xs1, LinkedList<T> xs2) {
- LinkedList<T> res = new LinkedList<T>();
- foreach (T x in xs1)
- res.Add(x);
- foreach (T x in xs2)
- res.Add(x);
- return res;
- }
-
- public IMyList<U> Map<U>(Mapper<T,U> f) {
- LinkedList<U> res = new LinkedList<U>();
- foreach (T x in this)
- res.Add(f(x));
- return res;
- }
-
- public IEnumerator<T> GetEnumerator() {
- return new LinkedListEnumerator(this);
- }
-
- IEnumerator IEnumerable.GetEnumerator() {
- return new LinkedListEnumerator(this);
- }
-
- private class LinkedListEnumerator : IEnumerator<T> {
- T curr; // The enumerator's current element
- bool valid; // Is the current element valid?
- Node next; // Node holding the next element, or null
-
- public LinkedListEnumerator(LinkedList<T> lst) {
- next = lst.first; valid = false;
- }
-
- public T Current {
- get {
- if (valid)
- return curr;
- else
- throw new InvalidOperationException();
- }
- }
-
- object IEnumerator.Current {
- get { return Current; }
- }
-
- public bool MoveNext() {
- if (next != null) {
- curr = next.item; next = next.next; valid = true;
- } else
- valid = false;
- return valid;
- }
-
- public void Reset() {
- throw new NotImplementedException ();
- }
-
- public void Dispose() {
- curr = default(T); next = null; valid = false;
- }
- }
-}
-
-class SortedList<T> : LinkedList<T> where T : IComparable<T> {
- // Sorted insertion
- public void Insert(T x) {
- Node node = first;
- while (node != null && x.CompareTo(node.item) > 0)
- node = node.next;
- if (node == null) // x > all elements; insert at end
- Add(x);
- else { // x <= node.item; insert before node
- Node newnode = new Node(x);
- if (node.prev == null) // insert as first element
- first = newnode;
- else
- node.prev.next = newnode;
- newnode.next = node;
- newnode.prev = node.prev;
- node.prev = newnode;
- }
- }
-}
-
-interface IPrintable {
- void Print(TextWriter fs);
-}
-class PrintableLinkedList<T> : LinkedList<T>, IPrintable where T : IPrintable {
- public void Print(TextWriter fs) {
- bool firstElement = true;
- foreach (T x in this) {
- x.Print(fs);
- if (firstElement)
- firstElement = false;
- else
- fs.Write(", ");
- }
- }
-}
-
-class MyString : IComparable<MyString> {
- private readonly String s;
- public MyString(String s) {
- this.s = s;
- }
- public int CompareTo(MyString that) {
- return String.Compare(that.Value, s); // Reverse ordering
- }
- public bool Equals(MyString that) {
- return that.Value == s;
- }
- public String Value {
- get { return s; }
- }
-}
-
-class MyTest {
- public static void Main(String[] args) {
- LinkedList<double> dLst = new LinkedList<double>(7.0, 9.0, 13.0, 0.0);
- foreach (double d in dLst)
- Console.Write("{0} ", d);
- Console.WriteLine();
- IMyList<int> iLst =
- dLst.Map<int>(new Mapper<double, int>(Math.Sign));
- foreach (int i in iLst)
- Console.Write("{0} ", i);
- Console.WriteLine();
- IMyList<String> sLst =
- dLst.Map<String>(delegate(double d) { return "s" + d; });
- foreach (String s in sLst)
- Console.Write("{0} ", s);
- Console.WriteLine();
- // Testing SortedList<MyString>
- SortedList<MyString> sortedLst = new SortedList<MyString>();
- sortedLst.Insert(new MyString("New York"));
- sortedLst.Insert(new MyString("Rome"));
- sortedLst.Insert(new MyString("Dublin"));
- sortedLst.Insert(new MyString("Riyadh"));
- sortedLst.Insert(new MyString("Tokyo"));
- foreach (MyString s in sortedLst)
- Console.Write("{0} ", s.Value);
- Console.WriteLine();
- }
-}
+++ /dev/null
-using System;
-
-namespace Slow
-{
- public interface ITest
- {
- void DoNothing<T>()
- where T : class;
- }
-
- public class Test : ITest
- {
- public void DoNothing<T>()
- where T : class
- {
- T x = null;
- }
- }
-
- class Program
- {
- static void Main(string[] args)
- {
- const int iterations = 10000;
-
- Test test = new Test ();
-
- DateTime start = DateTime.Now;
- Console.Write ("Calling Test.DoNothing<Program>() on an object reference... ");
- for (int i = 0; i < iterations; ++i)
- {
- test.DoNothing<Program> ();
- }
- DateTime end = DateTime.Now;
- TimeSpan duration = end - start;
- Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");
-
- ITest testInterface = test;
-
- start = DateTime.Now;
- Console.Write ("Calling Test.DoNothing<Program>() on an interface reference... ");
- for (int i = 0; i < iterations; ++i)
- {
- testInterface.DoNothing<Program> ();
- }
- end = DateTime.Now;
- duration = end - start;
- Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");
- }
- }
-}
+++ /dev/null
-using System;
-
-public interface IFoo<T>
-{ }
-
-public class Foo<T>
-{
- public static bool Test (T x)
- {
- return x is IFoo<T>;
- }
-}
-
-class X
-{
- static void Main ()
- {
- Foo<int>.Test (3);
- }
-}
+++ /dev/null
-//-- ex-gen-class-polynomial
-
-using System;
-
-// A type implements AddMul<A,R> if one can add an A to it, giving an R:
-
-interface AddMul<A,R> {
- R Add(A e); // Addition with A, giving R
- R Mul(A e); // Multiplication with A, giving R
-}
-
-// Polynomials over E, Polynomial<E>:
-
-// The base type E of the polynomial must support addition,
-// multiplication and zero (via the nullary constructor). That's what
-// the type parameter constraint on E says.
-
-// In return, one can add an E or a polynomial over E to a polynomial
-// over E. Similarly, a polynomial over E can be multiplied by an E
-// or by a polynomial over E. That's what the interface clauses say.
-
-class Polynomial<E> : AddMul<E,Polynomial<E>>,
- AddMul<Polynomial<E>,Polynomial<E>>
- where E : AddMul<E,E>, new() {
- // cs contains coefficients of x^0, x^1, ...; absent coefficients are zero.
- // Invariant: cs != null && cs.Length >= 0; cs.Length==0 represents zero.
- private readonly E[] cs;
-
- public Polynomial() {
- this.cs = new E[0];
- }
-
- public Polynomial(E[] cs) {
- this.cs = cs;
- }
-
- public Polynomial<E> Add(Polynomial<E> that) {
- int newlen = Math.Max(this.cs.Length, that.cs.Length);
- int minlen = Math.Min(this.cs.Length, that.cs.Length);
- E[] newcs = new E[newlen];
- if (this.cs.Length <= that.cs.Length) {
- for (int i=0; i<minlen; i++)
- newcs[i] = this.cs[i].Add(that.cs[i]);
- for (int i=minlen; i<newlen; i++)
- newcs[i] = that.cs[i];
- } else {
- for (int i=0; i<minlen; i++)
- newcs[i] = this.cs[i].Add(that.cs[i]);
- for (int i=minlen; i<newlen; i++)
- newcs[i] = this.cs[i];
- }
- return new Polynomial<E>(newcs);
- }
-
- public Polynomial<E> Add(E that) {
- return this.Add(new Polynomial<E>(new E[] { that }));
- }
-
- public Polynomial<E> Mul(E that) {
- E[] newcs = new E[cs.Length];
- for (int i=0; i<cs.Length; i++)
- newcs[i] = that.Mul(cs[i]);
- return new Polynomial<E>(newcs);
- }
-
- public Polynomial<E> Mul(Polynomial<E> that) {
- int newlen = Math.Max(1, this.cs.Length + that.cs.Length - 1);
- E[] newcs = new E[newlen];
- for (int i=0; i<newlen; i++) {
- E sum = new E(); // Permitted by constraint E : new()
- int start = Math.Max(0, i-that.cs.Length+1);
- int stop = Math.Min(i, this.cs.Length-1);
- for (int j=start; j<=stop; j++) {
- // assert 0<=j && j<this.cs.Length && 0<=i-j && i-j<that.cs.Length;
- sum = sum.Add(this.cs[j].Mul(that.cs[i-j]));
- }
- newcs[i] = sum;
- }
- return new Polynomial<E>(newcs);
- }
-
- public E Eval(E x) {
- E res = new E(); // Permitted by constraint E : new()
- for (int j=cs.Length-1; j>=0; j--)
- res = res.Mul(x).Add(cs[j]);
- return res;
- }
-}
-
-struct Int : AddMul<Int,Int> {
- private readonly int i;
- public Int(int i) {
- this.i = i;
- }
- public Int Add(Int that) {
- return new Int(this.i + that.i);
- }
- public Int Mul(Int that) {
- return new Int(this.i * that.i);
- }
- public override String ToString() {
- return i.ToString();
- }
-}
-
-class TestPolynomial {
- public static void Main(String[] args) {
- // The integer polynomial 2 + 5x + x^2
- Polynomial<Int> ip =
- new Polynomial<Int>(new Int[] { new Int(2), new Int(5), new Int(1) });
- Console.WriteLine(ip.Eval(new Int(10))); // 152
- Console.WriteLine(ip.Add(ip).Eval(new Int(10))); // 304 = 152 + 152
- Console.WriteLine(ip.Mul(ip).Eval(new Int(10))); // 23104 = 152 * 152
- }
-}
-
+++ /dev/null
-// Compiler options: -unsafe
-using System;
-
-public class Tests {
-
- public unsafe static void Main () {
- Console.WriteLine (typeof (void).Name);
- Console.WriteLine (typeof (void*).Name);
- Console.WriteLine (typeof (void**).Name);
- }
-}
+++ /dev/null
-// A generic type definition may have another generic type
-// definition as its parent.
-
-class Stack<S>
-{
- public void Hello (S s)
- { }
-}
-
-class Test<T> : Stack<T>
-{
- public void Foo (T t)
- { }
-}
-
-class X
-{
- Test<int> test;
-
- void Test ()
- {
- test.Foo (4);
- test.Hello (3);
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public interface ISequenced<T>
-{
- bool Equals (ISequenced<T> that);
-}
-
-public class SequencedHasher <S,W>
- where S : ISequenced<W>
-{
- public bool Equals (S i1, S i2)
- {
- return i1 == null ? i2 == null : i1.Equals (i2);
- }
-}
-
-public class Sequenced<T> : ISequenced<T>
-{
- public bool Equals (ISequenced<T> that)
- {
- return false;
- }
-}
-
-class X
-{
- static void Main ()
- {
- Sequenced<int> s = new Sequenced<int> ();
- SequencedHasher<Sequenced<int>,int> hasher = new SequencedHasher<Sequenced<int>,int> ();
- hasher.Equals (s, s);
- }
-}
+++ /dev/null
-public class B<T>
-{
- public int Add (T obj)
- {
- return -1;
- }
-
- public void AddRange (object o)
- {
- T obj = (T) o;
- Add (obj);
- }
-}
-
-public interface IA
-{
-}
-
-public class A : IA
-{
-}
-
-public class Test
-{
- public static void Main ()
- {
- B<IA> aux = new B<IA> ();
- aux.AddRange (new A ());
- }
-}
+++ /dev/null
- class Test
- {
- static void Main(string[] args)
- {
- A<int> a = new A<int>(new A<int>.B(D), 3);
- a.Run();
- }
- public static void D(int y)
- {
- System.Console.WriteLine("Hello " + 3);
- }
- }
- class A<T>
- {
- public delegate void B(T t);
-
- protected B _b;
- protected T _value;
-
- public A(B b, T value)
- {
- _b = b;
- _value = value;
- }
- public void Run()
- {
- _b(_value);
- }
- }
-
+++ /dev/null
-class A<T>
-{
- public delegate void Foo ();
- public delegate void Bar<U> ();
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-interface IFoo <T>
-{
- T this [int index] {
- get; set;
- }
-}
-
-public class FooCollection <T> : IFoo <T>
-{
- T IFoo<T>.this [int index] {
- get {
- return default(T);
- }
- set {
- }
- }
-}
-
-class X
-{
- static void Main ()
- {
- IFoo<int> foo = new FooCollection<int> ();
- int a = foo [3];
- Console.WriteLine (a);
- }
-}
+++ /dev/null
-using System;
-
-public interface IA<T> where T : struct {
-
-}
-
-public class B<T> : IA<T> where T:struct {
-
-}
-
-public class MainClass {
- public static void Main () {}
-
-}
-
+++ /dev/null
-using System.Collections.Generic;
-
-// comment this line to see another bug in gmcs (unrelated)
-interface IB { bool foo (); }
-
-
-class B : IB { public bool foo () { return true; } }
-
-interface Filter <T> where T : IB {
- T Is (IB x);
-
-}
-
-struct K : IB {
- public bool foo () { return false; }
-
-}
-
-class MyFilter : Filter <K> {
- public K Is (IB x) { return new K(); }
-}
-
-class MyBFilter : Filter <B> {
- public B Is (IB x) { return new B(); }
-}
-
-class M {
-
- static List<T> foo1 <T> (Filter <T> x) where T : IB {
- List <T> result = new List <T>();
- T maybe = x.Is (new B());
- if (maybe != null)
- result.Add (maybe);
- return result;
- }
-
- static void Main () {
- MyFilter m = new MyFilter ();
- System.Console.WriteLine (foo1 <K> (m).Count);
- MyBFilter mb = new MyBFilter ();
- System.Console.WriteLine (foo1 <B> (mb).Count);
- }
-}
+++ /dev/null
-public class A<T>
-{
- public delegate void Changed (A<T> a);
-
- protected event Changed _changed;
-
- public void Register (Changed changed)
- {
- _changed += changed;
- _changed (this);
- }
-}
-
-public class Test
-{
- public static void Main ()
- {
- A<int> a = new A<int> ();
- a.Register (new A<int>.Changed (Del));
- }
-
- public static void Del (A<int> a)
- {
- System.Console.WriteLine ("Solved");
- }
-}
+++ /dev/null
-using System;
-using System.Reflection;
-
-namespace FLMID.Bugs.ParametersOne
-{
- public class Class<T>
- {
- public void Add(T x)
- {
- System.Console.WriteLine("OK");
- }
- }
- public class Test
- {
-
- public static void Main(string [] args)
- {
- Class<string> instance = new Class<string>();
-
- MethodInfo _method = null;
-
- foreach(MethodInfo method in
-typeof(Class<string>).GetMethods(BindingFlags.Instance | BindingFlags.Public))
- {
- if(method.Name.Equals("Add") && method.GetParameters().Length==1)
- {
- _method = method;
- break;
- }
- }
- _method.Invoke(instance , new object[]{"1"});
- }
- }
-}
+++ /dev/null
-namespace B
-{
- using C;
-
- partial class Test <T>
- where T : IA, IB
- { }
-}
-
-namespace B
-{
- partial class Test <T>
- where T : C.IB, C.IA
- { }
-}
-
-namespace B
-{
- partial class Test <T>
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
-
-namespace C {
- interface IA { }
- interface IB { }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public class Stack<S>
-{
- public void Hello (S s)
- { }
-}
+++ /dev/null
-// Compiler options: -r:gen-13-dll.dll
-
-public class X
-{
- Stack<int> stack;
-
- void Test ()
- {
- stack.Hello (3);
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-//-- ex-nullable-bool
-
-using System;
-
-class MyTest {
- public static void Main(String[] args) {
- Console.WriteLine("Note that null prints as blank or []\n");
- bool? b1 = null, b2 = false, b3 = true;
- bool? b4 = b1^b2, b5 = b1&b2, b6 = b1|b2; // null false null
- Console.WriteLine("[{0}] [{1}] [{2}]", b4, b5, b6);
- bool? b7 = b1^b3, b8 = b1&b3, b9 = b1|b3; // null null true
- Console.WriteLine("[{0}] [{1}] [{2}]", b7, b8, b9);
- Console.WriteLine(b1 ? "null is true" : "null is false"); // null is false
- Console.WriteLine(!b1 ? "!null is true" : "!null is false"); // !null is false
-
- Console.WriteLine();
- bool?[] bvals = new bool?[] { null, false, true };
- Console.WriteLine("{0,-6} {1,-6} {2,-6} {3,-6} {4,-6}",
- "x", "y", "x&y", "x|y", "x^y");
- foreach (bool? x in bvals)
- foreach (bool? y in bvals)
- Console.WriteLine("{0,-6} {1,-6} {2,-6} {3,-6} {4,-6}",
- x, y, x&y, x|y, x^y);
- Console.WriteLine();
- Console.WriteLine("{0,-6} {1,-6}", "x", "!x");
- foreach (bool? x in bvals)
- Console.WriteLine("{0,-6} {1,-6}", x, !x);
- }
-}
+++ /dev/null
-//-- ex-nullable
-
-using System;
-
-class MyTest {
- public static void Main(String[] args) {
- Console.WriteLine("Note that null prints as blank or []\n");
- int? i1 = 11, i2 = 22, i3 = null, i4 = i1+i2, i5 = i1+i3;
- // Values: 11 22 null 33 null
- Console.WriteLine("[{0}] [{1}] [{2}] [{3}] [{4}]", i1, i2, i3, i4, i5);
- int i6 = (int)i1; // Legal
- // int i7 = (int)i5; // Legal but fails at run-time
- // int i8 = i1; // Illegal
-
- int?[] iarr = { i1, i2, i3, i4, i5 };
- i2 += i1;
- i2 += i4;
- Console.WriteLine("i2 = {0}", i2); // 66 = 11+22+33
-
- int sum = 0;
- for (int i=0; i<iarr.Length; i++)
- sum += iarr[i] != null ? iarr[i].Value : 0;
- // sum += iarr[i] ?? 0;
- Console.WriteLine("sum = {0}", sum); // 66 = 11+22+33
-
- for (int i=0; i<iarr.Length; i++)
- if (iarr[i] > 11)
- Console.Write("[{0}] ", iarr[i]); // 22 33
- Console.WriteLine();
-
- for (int i=0; i<iarr.Length; i++)
- if (iarr[i] != i1)
- Console.Write("[{0}] ", iarr[i]); // 22 null 33 null
- Console.WriteLine();
- Console.WriteLine();
- int?[] ivals = { null, 2, 5 };
- Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,-6} {5,-6} {6,-6} {7,-6}",
- "x", "y", "x+y", "x-y", "x<y", "x>=y", "x==y", "x!=y");
- Console.WriteLine();
- foreach (int? x in ivals)
- foreach (int? y in ivals)
- Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,-6} {5,-6} {6,-6} {7,-6}",
- x, y, x+y, x-y, (x<y), (x>=y), x==y, x!=y);
- }
-}
+++ /dev/null
-//-- ex-nullable-sqrt
-
-using System;
-
-class MyTest {
- public static int? Sqrt(int? x) {
- if (x.HasValue && x.Value >= 0)
- return (int)(Math.Sqrt(x.Value));
- else
- return null;
- }
-
- public static void Main(String[] args) {
- // Prints :2:::
- Console.WriteLine(":{0}:{1}:{2}:", Sqrt(5), Sqrt(null), Sqrt(-5));
- }
-}
+++ /dev/null
-// Not used -- ex-nullable-struct
-
-// Converting a struct from S to S? creates a copy of the struct.
-// Getting the struct out of the non-null value creates another copy.
-
-using System;
-
-struct S {
- private int x;
- public int X {
- get { return x; }
- set { this.x = value; } // Cannot be used on non-variable ns.Value
- }
- public void Set(int x) {
- this.x = x;
- }
-}
-
-class MyTest {
- public static void Main(String[] args) {
- S s = new S();
- s.Set(11);
- Console.WriteLine("s.X = {0}", s.X);
- S? ns = s;
- Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
- ns.Value.Set(22);
- Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
- s.Set(33);
- Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
- }
-}
+++ /dev/null
-// sestoft@dina.kvl.dk * 2004-08
-
-using System;
-
-class MyTest {
- public static void Main(String[] args) {
- Foo<int?> fni1 = new Foo<int?>(null);
- Console.WriteLine(fni1.Fmt());
- Foo<int?> fni2 = new Foo<int?>(17);
- Console.WriteLine(fni2.Fmt());
- Foo<int> fi = new Foo<int>(7);
- Console.WriteLine(fi.Fmt());
- Foo<String> fs1 = new Foo<String>(null);
- Console.WriteLine(fs1.Fmt());
- Foo<String> fs2 = new Foo<String>("haha");
- Console.WriteLine(fs2.Fmt());
- }
-}
-
-class Foo<T> {
- T x;
- public Foo(T x) {
- this.x = x;
- }
-
- // This shows how to deal with tests for null in a generic setting
- // where null may mean both `null reference' and `null value of a
- // nullable type'. Namely, the test (x == null) will always be
- // false if the generic type parameter t is instantiated with a
- // nullable type. Reason: the null literal will be considered a
- // null reference and x will be boxed if a value type, and hence the
- // comparison will be false...
-
- public String Fmt() {
- if (x is INullableValue && ((INullableValue)x).HasValue
- || !(x is INullableValue) && x != null)
- return x.ToString();
- else
- return "null";
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- int? a = null;
- int b = 3;
- long? c = a;
- Console.WriteLine (c);
- long? d = b;
- byte? f = (byte?) d;
- }
-}
+++ /dev/null
-using System;
-
-namespace Martin {
- public class A
- {
- public readonly long Data;
-
- public A (long data)
- {
- this.Data = data;
- }
-
- public static explicit operator B (A a)
- {
- return new B ((int) a.Data);
- }
- }
-
- public class B
- {
- public readonly int Data;
-
- public B (int data)
- {
- this.Data = data;
- }
-
- public static implicit operator A (B b)
- {
- return new A (b.Data);
- }
- }
-
- class X
- {
- static void Main ()
- {
- B? b = new B (5);
- A? a = b;
- B? c = (B?) a;
- B? d = (Martin.B?) a;
- }
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- int? a = 4;
- int? b = -a;
- Console.WriteLine (b);
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- int? a = 4;
- long b = 5;
- long? c = a * b;
- Console.WriteLine (c);
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- bool? a = true;
- int? b = a ? 3 : 4;
- Console.WriteLine (b);
- }
-}
+++ /dev/null
-public class Stack<S>
-{
- public Stack (S s)
- { }
-
- public void Push (S s)
- { }
-}
-
-public class X
-{
- static void Main ()
- {
- Stack<int> s1 = new Stack<int> (3);
- s1.Push (4);
-
- Stack<string> s2 = new Stack<string> ("Hello");
- s2.Push ("Test");
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- int?[] bvals = new int?[] { null, 3, 4 };
- foreach (long? x in bvals)
- Console.WriteLine (x);
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static void Main ()
- {
- int?[] bvals = new int? [] { null, 3, 4 };
- foreach (int? x in bvals)
- Console.WriteLine (x);
- }
-}
+++ /dev/null
-using System;
-
-public static class Assert
-{
- public static int Errors {
- get { return errors; }
- }
-
- static int errors = 0;
-
- static void Error (string method, string text)
- {
- Console.WriteLine ("Assert failed: {0} ({1})", method, text);
- errors++;
- }
-
- public static void IsTrue (string text, bool b)
- {
- if (!b)
- Error ("IsTrue", text);
- }
-
- public static void IsFalse (string text, bool b)
- {
- if (b)
- Error ("IsFalse", text);
- }
-
- public static void IsNull<T> (string text, Nullable<T> nullable)
- {
- if (nullable.HasValue)
- Error ("IsNull", text);
- }
-
- public static void IsNotNull<T> (string text, Nullable<T> nullable)
- {
- if (!nullable.HasValue)
- Error ("IsNotNull", text);
- }
-
- public static void IsTrue (string text, Nullable<bool> b)
- {
- if (!b.HasValue || !b.Value)
- Error ("IsTrue", text);
- }
-
- public static void IsFalse (string text, Nullable<bool> b)
- {
- if (!b.HasValue || b.Value)
- Error ("IsFalse", text);
- }
-}
-
-class X
-{
- static int Main ()
- {
- bool? a = null, b = false, c = true;
- bool? d = null, e = false, f = true;
-
- Assert.IsNull ("a", a);
- Assert.IsFalse ("b", b);
- Assert.IsTrue ("c", c);
- Assert.IsTrue ("a == d", a == d);
- Assert.IsTrue ("b == e", b == e);
- Assert.IsTrue ("c == f", c == f);
-
- Assert.IsFalse ("a != d", a != d);
- Assert.IsFalse ("a == b", a == b);
- Assert.IsTrue ("a != b", a != b);
-
- Assert.IsNull ("d & a", d & a);
- Assert.IsFalse ("d & b", d & b);
- Assert.IsNull ("d & c", d & c);
- Assert.IsFalse ("e & a", e & a);
- Assert.IsFalse ("e & b", e & b);
- Assert.IsFalse ("e & c", e & c);
- Assert.IsNull ("f & a", f & a);
- Assert.IsFalse ("f & b", f & b);
- Assert.IsTrue ("f & c", f & c);
-
- Assert.IsNull ("d | a", d | a);
- Assert.IsNull ("d | b", d | b);
- Assert.IsTrue ("d | c", d | c);
- Assert.IsNull ("e | a", e | a);
- Assert.IsFalse ("e | b", e | b);
- Assert.IsTrue ("e | c", e | c);
- Assert.IsTrue ("f | a", f | a);
- Assert.IsTrue ("f | b", f | b);
- Assert.IsTrue ("f | c", f | c);
-
- Assert.IsNull ("d && a", d && a);
- Assert.IsFalse ("d && b", d && b);
- Assert.IsNull ("d && c", d && c);
- Assert.IsFalse ("e && a", e && a);
- Assert.IsFalse ("e && b", e && b);
- Assert.IsFalse ("e && c", e && c);
- Assert.IsNull ("f && a", f && a);
- Assert.IsFalse ("f && b", f && b);
- Assert.IsTrue ("f && c", f && c);
-
- Assert.IsNull ("d || a", d || a);
- Assert.IsNull ("d || b", d || b);
- Assert.IsTrue ("d || c", d || c);
- Assert.IsNull ("e || a", e || a);
- Assert.IsFalse ("e || b", e || b);
- Assert.IsTrue ("e || c", e || c);
- Assert.IsTrue ("f || a", f || a);
- Assert.IsTrue ("f || b", f || b);
- Assert.IsTrue ("f || c", f || c);
-
- int? g = 3, h = null, i = 3, j = null;
-
- Assert.IsFalse ("g == null", g == null);
- Assert.IsTrue ("g != null", g != null);
- Assert.IsTrue ("h == null", h == null);
- Assert.IsFalse ("h != null", h != null);
-
- Assert.IsTrue ("g == i", g == i);
- Assert.IsFalse ("g != i", g != i);
- Assert.IsFalse ("g == j", g == j);
- Assert.IsTrue ("g != j", g != j);
- Assert.IsFalse ("h == i", h == i);
- Assert.IsTrue ("h != i", h != i);
- Assert.IsTrue ("h == j", h == j);
- Assert.IsFalse ("h != j", h != j);
-
- Console.WriteLine ("{0} errors.", Assert.Errors);
- return Assert.Errors;
- }
-}
+++ /dev/null
-using System;
-
-class X
-{
- static int Test ()
- {
- int? a = 5;
- int? b = a++;
-
- if (a != 6)
- return 1;
- if (b != 5)
- return 2;
-
- int? c = ++a;
-
- if (c != 7)
- return 3;
-
- b++;
- ++b;
-
- if (b != 7)
- return 4;
-
- int? d = b++ + ++a;
-
- if (a != 8)
- return 5;
- if (b != 8)
- return 6;
- if (d != 15)
- return 7;
-
- return 0;
- }
-
- static int Main ()
- {
- int result = Test ();
- if (result != 0)
- Console.WriteLine ("ERROR: {0}", result);
- return result;
- }
-}
+++ /dev/null
-using System;
-
-namespace Test
-{
- public class Application
- {
- public static void Main()
- {
- string[] array = new string[10];
-
- System.Collections.Generic.IEnumerable<string> enumer = array;
- }
- }
-}
+++ /dev/null
-using System;
-public class Test<T>{
- private T[,] data;
- public Test(T[,] data){
- this.data = data;
- }
-}
-public class Program{
- public static void Main(string[] args){
- Test<double> test = new Test<double>(new double[2,2]);
- }
-}
-
+++ /dev/null
-using System;
-
-public class MyLinkedList<T> {
- protected Node first;
-
- protected class Node
- {
- public T item;
-
- public Node (T item)
- {
- this.item = item;
- }
- }
-}
-
-class SortedList<U> : MyLinkedList<U>
-{
- public void Insert (U x) {
- Node node = first;
- }
-}
-
-class X {
- static void Main ()
- { }
-}
+++ /dev/null
-namespace A
-{
- interface IFoo
- {
- void Hello (IFoo foo);
- }
-}
-
-namespace B
-{
- partial class Test <T> : IDoo, A.IFoo where T : A.IFoo
- { }
-}
-
-namespace B
-{
- using A;
-
- partial class Test <T> : Y, IFoo where T : IFoo
- {
- void IFoo.Hello (IFoo foo)
- { }
- }
-}
-
-interface IDoo { }
-
-class Y { }
-
-class X
-{
- static void Main ()
- { }
-}
-
-
-
-
+++ /dev/null
-using System;
-
-static class Test1 {
- public class IOp<T> { }
- static void Foo<S,OP>(uint v) where OP : IOp<S> { }
-};
-
-static class Test2 {
- public class IOp<T> { }
- static void Foo<T,OP>(uint v) where OP : IOp<T> { }
-};
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-static class Test1 {
- public class IOp<T> { }
- static void Foo<S,OP>(uint v) where OP : IOp<S> { }
-};
-
-static class Test2 {
- public class IOp<T> { }
- static void Foo<T,OP>(uint v) where OP : IOp<T> { }
-};
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Very simple example of a generic method.
-
-class Stack<S>
-{
- public static void Hello<T,U> (S s, T t, U u)
- {
- U v = u;
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-using System;
-static class Test1 {
- public interface IOp<T> {
- T Func(uint v);
- }
- public struct Op : IOp<ushort>, IOp<uint> {
- ushort IOp<ushort>.Func(uint v) { return (ushort )(v * 2); }
- uint IOp<uint>.Func(uint v) { return v * 4; }
- }
- static void Foo<T,OP>(uint v) where T:struct where OP : IOp<T> {
- OP op = default(OP);
- System.Console.WriteLine( op.Func(v) );
- }
- static public void Main() {
- Foo<ushort, Op>(100);
- Foo<uint, Op>(100);
- }
-};
+++ /dev/null
-class Test<T> where T: struct{
- public Test(){
- T s = new T();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
-
+++ /dev/null
-using System;
-
-public interface IFoo
-{
- IFoo Hello ();
-}
-
-public interface IFoo<T> : IFoo
-{
- new IFoo<T> Hello ();
-}
-
-public interface ICollectionValue<T>: IFoo<T>
-{
-}
-
-public interface ICollection<T>: ICollectionValue<T>
-{ }
-
-public abstract class EnumerableBase<T> : IFoo<T>
-{
- public abstract IFoo<T> Hello();
-
- IFoo IFoo.Hello ()
- {
- return Hello ();
- }
-}
-
-public abstract class CollectionBase<T> : EnumerableBase<T>
-{
-}
-
-public class HashBag<T>: CollectionBase<T>, ICollection<T>
-{
- public override IFoo<T> Hello ()
- {
- return this;
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-public interface IBase
-{
- void DoSomeThing();
-}
-
-public interface IExtended : IBase
-{
- void DoSomeThingElse();
-}
-
-public class MyClass<T> where T: IExtended, new()
-{
- public MyClass()
- {
- T instance = new T();
- instance.DoSomeThing();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public delegate int T<X> (X x);
-
-public class B
-{
- public static T<X> M<X> ()
- {
- return delegate(X x) { return 5; };
- }
-
- public static T<long> N ()
- {
- return delegate(long x) { return 6; };
- }
-}
-
-public class D
-{
- public static void Main ()
- {
- B.M<int>();
- B.N ();
- }
-}
+++ /dev/null
-public interface IBase
-{
- void DoSomeThing();
-}
-
-public interface IExtended : IBase
-{
- void DoSomeThingElse();
-}
-
-public class MyClass<T> where T: IExtended, new()
-{
- public MyClass()
- {
- T instance = new T();
- instance.DoSomeThing();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-namespace FLMID.Bugs.Marshal15
-{
- public class A<T>
-
- {
-
- }
- public abstract class B
- {
- protected A<bool> _aux;
- }
- public class X : B
- {
- }
- public abstract class C
- {
- protected B _layout;
- }
-}
-
+++ /dev/null
-// Compiler options: -r:gen-156-dll.dll
-
-namespace FLMID.Bugs.Marshal15
-{
- public class D : C
- {
- public D()
- {
- _layout = new X();
- }
- public static void Main(string[] args)
- {
- System.Console.WriteLine("OK");
- }
- }
-}
-
+++ /dev/null
-interface a <t> { void x (); }
-
-interface b <t> : a <t> {}
-
-class kv <k,v> {} // type t
-
-interface c <k,v>: b <kv<k,v>>, // b <t>
- a <kv<k,v>> // a <t>
-{}
-
-class m <k,v> : c <k,v>,
- b <kv<k,v>> // b <t>
-{
- void a <kv <k,v>>.x () {} // a<t>.x ()
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public class Moo<C>
- where C : Moo<C>.Foo
-{
- public class Foo
- { }
-}
-
-public class Test : Moo<Test>.Foo
-{
-}
-
-class X
-{
- static void Main ()
- {
- Moo<Test> moo = new Moo<Test> ();
- }
-}
+++ /dev/null
-// A generic method may also use the type parameters
-// from its enclosing type.
-
-class Stack<S>
-{
- public static void Hello<T> (S s, T t)
- { }
-}
-
-class X
-{
- Stack<int> stack;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public class Stack
-{
- public Stack ()
- { }
-
- public void Hello<T> (T t)
- { }
-}
+++ /dev/null
-// Compiler options: -r:gen-17-dll.dll
-
-public class X
-{
- public static void Foo (Stack stack)
- {
- stack.Hello<string> ("Hello World");
- }
-
- static void Main ()
- {
- Stack stack = new Stack ();
- Foo (stack);
- }
-}
+++ /dev/null
-public class Stack
-{
- public Stack ()
- { }
-
- public void Hello<T> (T t)
- { }
-}
-
-public class X
-{
- public static void Foo (Stack stack)
- {
- stack.Hello<string> ("Hello World");
- }
-
- static void Main ()
- {
- Stack stack = new Stack ();
- Foo (stack);
- }
-}
+++ /dev/null
-// A very simple generic interface
-
-public interface IEnumerator<T> {
- T Current { get; }
- bool MoveNext();
- void Reset();
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-class Cell <X> {
- X value;
-
-}
-
-class D {
- static void Main ()
- {
- }
-}
+++ /dev/null
-struct Stack<S>
-{
- public void Hello (S s)
- { }
-}
-
-class X
-{
- Stack<int> stack;
-
- void Test ()
- {
- stack.Hello (3);
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-// Testing the default value expressions (14.5.13)
-
-using System;
-
-class Foo<T>
-{
- T[] t;
-
- public Foo (int n)
- {
- t = new T [n];
- for (int i = 0; i < n; i++)
- t [i] = default (T);
- }
-
- public void Test ()
- {
- X.Print (t [0]);
- }
-}
-
-class Bar<T>
-{
- public void Test ()
- {
- X.Print (default (X));
- X.Print (default (T));
- X.Print (default (S));
- }
-}
-
-struct S
-{
- public readonly string Hello;
-
- S (string hello)
- {
- this.Hello = hello;
- }
-
- public override string ToString ()
- {
- return String.Format ("S({0})", Hello);
- }
-
-}
-
-class X
-{
- public static void Print (object obj)
- {
- if (obj == null)
- Console.WriteLine ("NULL");
- else
- Console.WriteLine ("OBJECT: {0} {1}", obj, obj.GetType ());
- }
-
- static void Main ()
- {
- Foo<string> a = new Foo<string> (4);
- a.Test ();
-
- Bar<int> b = new Bar<int> ();
- b.Test ();
- Bar<X> c = new Bar<X> ();
- c.Test ();
- }
-}
+++ /dev/null
-// A non-generic type may have a closed constructed type as its parent
-
-class Foo<T>
-{
- public void Hello ()
- { }
-
- public void World (T t)
- {
- Hello ();
- }
-}
-
-class Bar : Foo<int>
-{
- public void Test ()
- {
- Hello ();
- World (4);
- }
-}
-
-class X
-{
- static void Main ()
- {
- Bar bar = new Bar ();
- bar.Test ();
- }
-}
+++ /dev/null
-class Foo<T>
-{
- public void Hello ()
- { }
-
- public void World (T t)
- {
- Hello ();
- }
-}
-
-//
-// This is some kind of a `recursive' declaration:
-//
-// Note that we're using the class we're currently defining (Bar)
-// as argument of its parent.
-//
-// Is is important to run the resulting executable since this is
-// both a test for the compiler and the runtime.
-//
-
-class Bar : Foo<Bar>
-{
- public void Test ()
- {
- Hello ();
- World (this);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-class Foo<T>
-{
- public Foo ()
- { }
-
- public void Hello (T t)
- {
- // We're boxing the type parameter `T' to an object here.
- Whatever (t);
- }
-
- public void Whatever (object o)
- {
- System.Console.WriteLine (o.GetType ());
- }
-}
-
-class X
-{
- static void Test (Foo<int> foo)
- {
- foo.Hello (4);
- }
-
- static void Main ()
- {
- Foo<int> foo = new Foo<int> ();
- Test (foo);
- }
-}
+++ /dev/null
-class Foo
-{
- public Foo ()
- { }
-
- public void Hello<T> (T t)
- {
- // We're boxing the type parameter `T' to an object here.
- Whatever (t);
- }
-
- public void Whatever (object o)
- {
- System.Console.WriteLine (o.GetType ());
- }
-}
-
-class X
-{
- static void Test (Foo foo)
- {
- foo.Hello<int> (531);
- }
-
- static void Main ()
- {
- Foo foo = new Foo ();
- Test (foo);
- }
-}
+++ /dev/null
-// Test access to class fields outside the generic type declaration.
-
-class Foo<T>
-{
- public T Hello;
-
- public Foo ()
- { }
-}
-
-class X
-{
- static void Main ()
- {
- Foo<int> foo = new Foo<int> ();
- foo.Hello = 9;
- }
-}
+++ /dev/null
-// A generic type declaration may have a non-generic base type.
-
-class TheBase
-{
- public void BaseFunc ()
- { }
-}
-
-class Stack<S> : TheBase
-{
- public void Hello (S s)
- { }
-}
-
-class Test<T> : Stack<T>
-{
- public void Foo (T t)
- { }
-}
-
-class X
-{
- Test<int> test;
-
- void Test ()
- {
- test.Foo (4);
- test.Hello (3);
- test.BaseFunc ();
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-class Stack<T>
-{
- T t;
-
- public Stack (T t)
- {
- this.t = t;
- }
-
- public object Test ()
- {
- // Boxing the type parameter `T' to an object.
- return t;
- }
-}
-
-class X
-{
- public static object Test (Stack<int> stack)
- {
- return stack.Test ();
- }
-
- static void Main ()
- {
- Stack<int> stack = new Stack<int> (9);
- System.Console.WriteLine (Test (stack));
- }
-}
+++ /dev/null
-class Stack<T>
-{
- T[] t;
-
- public Stack (int n)
- {
- t = new T [n];
- }
-
- public object Test ()
- {
- // Boxing the type parameter to an object; note that we're
- // an array !
- return t;
- }
-}
-
-class X
-{
- static void Main ()
- {
- Stack<int> stack = new Stack<int> (5);
- System.Console.WriteLine (stack.Test ());
- }
-}
+++ /dev/null
-class Stack<T> {
-}
-
-class Test {
-}
-
-class T {
- Stack<Test> a;
-
- static void Main()
- {
- }
-}
+++ /dev/null
-// Note how the order of type parameters is different
-// in the base class.
-
-class Foo<T>
-{
- public Foo ()
- { }
-
- public void Hello (T t)
- { }
-}
-
-class Bar<T,U> : Foo<U>
-{
- public Bar ()
- { }
-
- public void Test (T t, U u)
- { }
-}
-
-class X
-{
- static void Test (Bar<int,string> bar)
- {
- bar.Hello ("Test");
- bar.Test (7, "Hello");
- }
-
- static void Main ()
- {
- Bar<int,string> bar = new Bar<int,string> ();
- Test (bar);
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public class Foo<T>
-{
- public void Hello (T t)
- { }
-}
-
-public class Bar<T,U> : Foo<U>
-{
- public void Test (T t, U u)
- { }
-}
+++ /dev/null
-// Compiler options: -r:gen-31-dll.dll
-
-public class X
-{
- public static void Test (Bar<int,string> bar)
- {
- bar.Hello ("Test");
- bar.Test (7, "Hello");
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-// Generic interfaces
-
-interface Foo<S>
-{
- void Hello (S s);
-}
-
-interface Bar<T,U> : Foo<U>
-{
- void Test (T t, U u);
-}
-
-class X
-{
- static void Test (Bar<int,string> bar)
- {
- bar.Hello ("Test");
- bar.Test (7, "Hello");
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-// Generic interfaces
-
-interface Foo<R,S>
-{
- void Hello (R r, S s);
-}
-
-interface Bar<T,U,V> : Foo<V,float>
-{
- void Test (T t, U u, V v);
-}
-
-class X
-{
- static void Test (Bar<long,int,string> bar)
- {
- bar.Hello ("Test", 3.14F);
- bar.Test (512, 7, "Hello");
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-class Foo<T>
-{ }
-
-class Stack<T>
-{ }
-
-//
-// We may use a constructed type `Stack<T>' instead of
-// just a type parameter.
-//
-
-class Bar<T> : Foo<Stack<T>>
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// May use a constructed type as constraint.
-
-class Test<T>
-{ }
-
-class Foo<T>
- where T : Test<T>
-{ }
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-//
-// This is another "important" test: it checks whether we set
-// TypeContainer.CurrentType correctly when compiling the
-// declaration of `Stack'.
-//
-
-class Stack<T>
-{
- //
- // This must be encoded as a TypeSpec (Stack<!0>) and
- // not as a TypeDef.
- //
- // PEVerify the resulting executable on Windows to make sure !
- //
- void Hello (Stack<T> stack)
- {
- }
-
- void Test ()
- {
- Hello (this);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-//
-// Check whether we're correctly handling `this'.
-//
-//
-
-public class Foo<T,U>
-{
- public void Hello (Foo<T,U> foo)
- {
- }
-
- public virtual void Test ()
- {
- //
- // Again, this must be encoded as a TypeSpec (Foo<!0,!1>)
- // instead of a TypeDef.
- Hello (this);
- }
-}
-
-public class Bar<T> : Foo<T,long>
-{
- public void Test (Foo<T,long> foo)
- {
- Hello (foo);
- }
-}
-
-public class Baz<T> : Foo<T,string>
-{
- public override void Test ()
- {
- Hello (this);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-//
-// Another important test: nested generic types.
-//
-
-using System;
-
-class Queue<T>
-{
- public Queue (T first, T second)
- {
- head = new Node<T> (null, second);
- head = new Node<T> (head, first);
- }
-
- protected Node<T> head;
-
- protected Node<T> GetFoo ()
- {
- return head;
- }
-
- protected Node<T> Foo {
- get {
- return GetFoo ();
- }
- }
-
- protected void Test (T t)
- {
- Console.WriteLine (t);
- }
-
- public void Test ()
- {
- Test (head.Item);
- Test (head.Next.Item);
- Test (GetFoo ().Item);
- Test (Foo.Item);
- }
-
- protected class Node<U>
- {
- public readonly U Item;
- public readonly Node<U> Next;
-
- public Node (Node<U> next, U item)
- {
- this.Next = next;
- this.Item = item;
- }
- }
-}
-
-class X
-{
- static void Main ()
- {
- Queue<int> queue = new Queue<int> (5, 9);
- queue.Test ();
- }
-}
+++ /dev/null
-//
-// Important test for the runtime: check whether we're correctly
-// creating the vtable for nested types.
-//
-
-using System;
-
-interface IMonkey<T>
-{
- T Jump ();
-}
-
-class Zoo<T>
-{
- T t;
-
- public Zoo (T t)
- {
- this.t = t;
- }
-
- public T Name {
- get { return t; }
- }
-
- public IMonkey<U> GetTheMonkey<U> (U u)
- {
- return new Monkey<T,U> (this, u);
- }
-
- public class Monkey<V,W> : IMonkey<W>
- {
- public readonly Zoo<V> Zoo;
- public readonly W Data;
-
- public Monkey (Zoo<V> zoo, W data)
- {
- this.Zoo = zoo;
- this.Data = data;
- }
-
- public W Jump ()
- {
- Console.WriteLine ("Monkey {0} from {1} jumping!", Data, Zoo.Name);
- return Data;
- }
- }
-}
-
-class X
-{
- static void Main ()
- {
- Zoo<string> zoo = new Zoo<string> ("Boston");
- IMonkey<float> monkey = zoo.GetTheMonkey<float> (3.14F);
- monkey.Jump ();
- }
-}
+++ /dev/null
-class Stack<T> {
-}
-
-class Test {
-}
-
-class T {
- public void Foo (Stack<Test> a)
- { }
-
- static void Main()
- {
- }
-}
+++ /dev/null
-public interface INode<T>
-{
- void Hello (T t);
-}
-
-public class Stack<T>
-{
- public T TheData;
- public readonly Foo<T> TheFoo;
-
- public Stack (T t)
- {
- this.TheData = t;
- this.TheFoo = new Foo<T> (t);
- }
-
- public INode<T> GetNode ()
- {
- return new Node (this);
- }
-
- public Foo<T> GetFoo (T t)
- {
- return new Foo<T> (t);
- }
-
- public Bar<T> GetBar (T t)
- {
- return new Bar<T> (t);
- }
-
- protected class Node : INode<T>
- {
- public readonly Stack<T> Stack;
-
- public Node (Stack<T> stack)
- {
- this.Stack = stack;
- }
-
- public void Hello (T t)
- {
- }
- }
-
- public class Foo<T>
- {
- public readonly T Data;
-
- public Bar<T> GetBar ()
- {
- return new Bar<T> (Data);
- }
-
- public Foo (T t)
- {
- this.Data = t;
- }
- }
-
- public class Bar<U>
- {
- public readonly U Data;
-
- public Bar (U u)
- {
- this.Data = u;
- }
-
- public Foo<T> GetFoo (Stack<T> stack)
- {
- return stack.TheFoo;
- }
-
- public class Baz<V>
- {
- public readonly V Data;
-
- public Foo<T> GetFoo (Stack<T> stack)
- {
- return new Foo<T> (stack.TheData);
- }
-
- public Bar<V> GetBar ()
- {
- return new Bar<V> (Data);
- }
-
- public Baz (V v)
- {
- this.Data = v;
- }
- }
- }
-
- public void Test ()
- {
- Stack<T>.Foo<T> foo1 = GetFoo (TheData);
- Foo<T> foo2 = GetFoo (TheData);
-
- Stack<long>.Foo<T> foo3 = new Stack<long>.Foo<T> (TheData);
- Stack<long>.Foo<float> foo4 = new Stack<long>.Foo<float> (3.14F);
-
- Foo<double> foo5 = new Foo<double> (3.14);
- }
-}
-
-class X
-{
- static void Main ()
- {
- Stack<int> stack = new Stack<int> (1);
- INode<int> node = stack.GetNode ();
- Stack<int>.Foo<int> foo = stack.GetFoo (7);
- Stack<int>.Bar<int> bar = stack.GetBar (8);
- }
-}
+++ /dev/null
-// We may use type parameters as `params' type.
-
-class Stack<T>
-{
- public void Hello (int a, params T[] args)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- Stack<string> stack = new Stack<string> ();
- stack.Hello (1, "Hello", "World");
- }
-}
+++ /dev/null
-// Compare this to gcs0695-*.cs: these are the allowed cases.
-
-namespace A
-{
- interface I<X>
- { }
-
- interface J<X,Y> : I<X>
- { }
-
- class A<X> : I<X>, I<A<X>>
- { }
-
- class B<X> : I<B<X>>, I<X>, I<A<X>>
- { }
-
- class C<X> : I<int>, I<A<X>>
- { }
-
- class D<X> : I<A<float>>, I<B<X>>
- { }
-
- class E<X,Y> : J<X,Y>, J<I<X>,I<Y>>
- { }
-
- class F<X> : J<X,I<X>>, J<X,X>
- { }
-}
-
-// bug #69057
-namespace B
-{
- struct KeyValuePair<K,V>
- { }
-
- interface ITest<T>
- { }
-
- interface ITest2<K,V> : ITest<KeyValuePair<K,V>>
- { }
-
- class MyTest<K,V> : ITest2<K,V>, ITest<KeyValuePair<K,V>>
- { }
-}
-
-// bug #58303
-namespace C
-{
- class S <K> { }
-
- interface Z<T> { }
-
- interface I<K> : Z<S<K>> { }
-
- class C <K> : I<K>, Z<S<K>> { }
-}
-
-class Test
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Static fields in generic types: this is a runtime/JIT-only test
-//
-// We need to make sure that we're instantiating each closed generic
-// type (ie. "Test<int>") only once.
-
-using System;
-
-public class Test<T>
-{
- public static int Count;
-
- public void Foo ()
- {
- Count++;
- }
-
- public int GetCount ()
- {
- return Count;
- }
-}
-
-class X
-{
- static int DoTheTest<T> ()
- {
- Test<T> test = new Test<T> ();
-
- test.Foo ();
- if (test.GetCount () != 1)
- return 1;
- if (Test<T>.Count != 1)
- return 2;
-
- test.Foo ();
- if (test.GetCount () != 2)
- return 3;
- if (Test<T>.Count != 2)
- return 4;
-
- test.Foo ();
- if (test.GetCount () != 3)
- return 5;
- if (Test<T>.Count != 3)
- return 6;
-
- return 0;
- }
-
- static int Main ()
- {
- int result = DoTheTest<int> ();
- if (result != 0)
- return result;
-
- result = DoTheTest<long> () + 10;
- if (result != 10)
- return result;
-
- Test<int>.Count = 0;
- ++Test<long>.Count;
-
- result = DoTheTest<int> () + 20;
- if (result != 20)
- return result;
-
- if (Test<int>.Count != 3)
- return 31;
- if (Test<long>.Count != 4)
- return 32;
- Test<float>.Count = 5;
- if (Test<int>.Count != 3)
- return 33;
- if (Test<long>.Count != 4)
- return 34;
-
- return 0;
- }
-}
+++ /dev/null
-// Operators and generic types.
-
-using System;
-
-class X<T>
-{
- public int Count;
-
- public X (int count)
- {
- this.Count = count;
- }
-
- public static X<T> operator ++ (X<T> operand) {
- return new X<T> (operand.Count + 1);
- }
-}
-
-class Test
-{
- static void Main ()
- {
- X<long> x = new X<long> (5);
- Console.WriteLine (x.Count);
- x++;
- Console.WriteLine (x.Count);
- }
-}
+++ /dev/null
-// Important test: Type inference
-
-class Test<A,B>
-{
- public void Foo<U> (U u)
- { }
-
- public void Foo<V> (V[] v, V w)
- { }
-
- public void Hello<V,W> (V v, W w, Test<V,W> x)
- { }
-
- public void ArrayMethod<V> (params V[] args)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- Test<float,int> test = new Test<float,int> ();
- test.Foo ("Hello World");
- test.Foo (new long[] { 3, 4, 5 }, 9L);
- test.Hello (3.14F, 9, test);
- test.ArrayMethod (3.14F, (float) 9 / 3);
- }
-}
-
+++ /dev/null
-// Generic delegates.
-
-using System;
-
-delegate void Test<T> (T t);
-
-class Foo<T>
-{
- public event Test<T> MyEvent;
-
- public void Hello (T t)
- {
- if (MyEvent != null)
- MyEvent (t);
- }
-}
-
-class X
-{
- static void do_hello (string hello)
- {
- Console.WriteLine ("Hello: {0}", hello);
- }
-
- static void Main ()
- {
- Foo<string> foo = new Foo<string> ();
- foo.MyEvent += new Test<string> (do_hello);
- foo.Hello ("Boston");
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-namespace Foo
-{
- public class List
- {
- }
-}
-
-namespace Bar
-{
- public class List<T>
- {
- }
-}
+++ /dev/null
-// Compiler options: -r:gen-47-dll.dll
-
-// Important test: verify our namespace lookup rules
-//
-// There's a generic and a non-generic `List' type in two
-// different namespaces: make sure we pick the correct one.
-
-using Foo;
-using Bar;
-
-class X
-{
- static void Main ()
- {
- List<int> list = new List<int> ();
- }
-}
+++ /dev/null
-// This fixed a problem in the JIT.
-
-public class Stack<T>
-{
- T[] data;
-
- public Stack ()
- {
- data = new T [10];
- }
-
- public void Add (T t)
- {
- data [0] = t;
- }
-}
-
-struct Foo
-{
- int a;
-}
-
-class X
-{
- static void Main ()
- {
- Foo foo = new Foo ();
- Stack<Foo> stack = new Stack<Foo> ();
- stack.Add (foo);
- }
-}
+++ /dev/null
-// Important test: compare this to gcs0408-*.cs; these are the allowed cases.
-
-class X<T>
-{
- void A (T t)
- { }
-
- void A (T[] t)
- { }
-
- void A (T[,] t)
- { }
-
- void A (T[][] t)
- { }
-
- void B (T[] t)
- { }
-
- void B (int t)
- { }
-
- void C (T[] t)
- { }
-
- void C (T[,] t)
- { }
-
- void C (int[,,] t)
- { }
-
- void D (int x, T y)
- { }
-
- void D (T x, long y)
- { }
-}
-
-class Foo
-{
- static void Main ()
- { }
-}
+++ /dev/null
-class Stack<T> {
-}
-
-class Test {
-}
-
-class T {
- static void Main()
- {
- Stack<Test> a;
- }
-}
+++ /dev/null
-// Type inference when creating delegates
-
-using System;
-
-delegate int D (string s, int i);
-
-delegate int E ();
-
-class X
-{
- public static T F<T> (string s, T t)
- {
- return t;
- }
-
- public static T G<T> ()
- {
- throw new ArgumentException ();
- }
-
- static void Main ()
- {
- D d1 = new D (F<int>);
- D d2 = new D (F);
-
- E e1 = new E (G<int>);
- }
-}
+++ /dev/null
-using System;
-
-public class Foo<T>
- where T : A
-{
- public void Test (T t)
- {
- Console.WriteLine (t);
- Console.WriteLine (t.GetType ());
- t.Hello ();
- }
-}
-
-public class A
-{
- public void Hello ()
- {
- Console.WriteLine ("Hello World");
- }
-}
-
-public class B : A
-{
-}
-
-class X
-{
- static void Main ()
- {
- Foo<B> foo = new Foo<B> ();
- foo.Test (new B ());
- }
-}
+++ /dev/null
-// We create an instance of a type parameter which has the new() constraint.
-using System;
-
-public class Foo<T>
- where T : new ()
-{
- public T Create ()
- {
- return new T ();
- }
-}
-
-class X
-{
- public X ()
- { }
-
- void Hello ()
- {
- Console.WriteLine ("Hello World");
- }
-
- static void Main ()
- {
- Foo<X> foo = new Foo<X> ();
- foo.Create ().Hello ();
- }
-}
+++ /dev/null
-//
-// Important test: Type parameters and boxing (26.7.3).
-//
-// This tests the constrained_ prefix opcode.
-//
-using System;
-
-public interface ICounter
-{
- void Increment ();
-}
-
-namespace ValueTypeCounters
-{
- public struct SimpleCounter : ICounter
- {
- public int Value;
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-
- public struct PrintingCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-
- public struct ExplicitCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- void ICounter.Increment ()
- {
- Value++;
- }
- }
-
- public struct InterfaceCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- void ICounter.Increment ()
- {
- Value++;
- }
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-}
-
-namespace ReferenceTypeCounters
-{
- public class SimpleCounter : ICounter
- {
- public int Value;
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-
- public class PrintingCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-
- public class ExplicitCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- void ICounter.Increment ()
- {
- Value++;
- }
- }
-
- public class InterfaceCounter : ICounter
- {
- public int Value;
-
- public override string ToString ()
- {
- return Value.ToString ();
- }
-
- void ICounter.Increment ()
- {
- Value++;
- }
-
- public void Increment ()
- {
- Value += 2;
- }
- }
-}
-
-namespace Test
-{
- using V = ValueTypeCounters;
- using R = ReferenceTypeCounters;
-
- public class Test<T>
- where T : ICounter
- {
- public static void Foo (T x)
- {
- Console.WriteLine (x.ToString ());
- x.Increment ();
- Console.WriteLine (x.ToString ());
- }
- }
-
- public class X
- {
- static void Main ()
- {
- Test<V.SimpleCounter>.Foo (new V.SimpleCounter ());
- Test<V.PrintingCounter>.Foo (new V.PrintingCounter ());
- Test<V.ExplicitCounter>.Foo (new V.ExplicitCounter ());
- Test<V.InterfaceCounter>.Foo (new V.InterfaceCounter ());
- Test<R.SimpleCounter>.Foo (new R.SimpleCounter ());
- Test<R.PrintingCounter>.Foo (new R.PrintingCounter ());
- Test<R.ExplicitCounter>.Foo (new R.ExplicitCounter ());
- Test<R.InterfaceCounter>.Foo (new R.InterfaceCounter ());
- }
- }
-}
+++ /dev/null
-//
-// Conversions involving type parameters (26.7.4).
-// This is a compilation-only test since some of the explict
-// conversions would trigger an InvalidCastException.
-//
-
-using System;
-
-interface Foo
-{
- void Hello ();
-}
-
-class A
-{ }
-
-class B : A, Foo
-{
- public void Hello ()
- { }
-
- public static implicit operator C (B b)
- {
- return new C ();
- }
-}
-
-class C
-{
- public static explicit operator B (C c)
- {
- return new B ();
- }
-}
-
-class Test
-{
- static void Simple<T> (T t)
- {
- object o = t;
- t = (T) o;
- Foo foo = (Foo) t;
- t = (T) foo;
- }
-
- static void Interface<T> (T t)
- where T : Foo
- {
- Foo foo = t;
- }
-
- static void Class<T> (T t)
- where T : B
- {
- B b = t;
- A a = t;
- Foo foo = t;
- t = (T) b;
- t = (T) a;
- t = (T) foo;
- C c = t;
- t = (T) c;
- }
-
- static void Array<T> (T[] t)
- {
- object o = t;
- Array a = t;
- t = (T []) o;
- t = (T []) a;
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-// Using constructed types in a namespace alias.
-
-namespace N1
-{
- class A<T>
- {
- public class B { }
-
- public class C<U> { }
- }
-
- class C { }
-}
-
-namespace N2
-{
- using Y = N1.A<int>;
-
- class X
- {
- static void Main ()
- {
- Y y = new Y ();
- Y.B b = new Y.B ();
- Y.C<long> c = new Y.C<long> ();
- }
- }
-}
+++ /dev/null
-//-- ex-gen-logger
-//-- ex-gen-struct-pair
-//-- ex-gen-logging-pairs
-// 1.2 alpha
-
-using System;
-
-public class Log<T> {
- private const int SIZE = 5;
- private static int instanceCount = 0;
- private int count = 0;
- private T[] log = new T[SIZE];
- public Log() { instanceCount++; }
- public static int InstanceCount { get { return instanceCount; } }
- public void Add(T msg) { log[count++ % SIZE] = msg; }
- public int Count { get { return count; } }
- public T Last {
- get { // Return the last log entry, or null if nothing logged yet
- return count==0 ? default(T) : log[(count-1)%SIZE];
- }
- set { // Update the last log entry, or create one if nothing logged yet
- if (count==0)
- log[count++] = value;
- else
- log[(count-1)%SIZE] = value;
- }
- }
- public T[] All {
- get {
- int size = Math.Min(count, SIZE);
- T[] res = new T[size];
- for (int i=0; i<size; i++)
- res[i] = log[(count-size+i) % SIZE];
- return res;
- }
- }
-}
-
-class TestLog {
- class MyTest {
- public static void Main(String[] args) {
- Log<String> log1 = new Log<String>();
- log1.Add("Reboot");
- log1.Add("Coffee");
- Log<DateTime> log2 = new Log<DateTime>();
- log2.Add(DateTime.Now);
- log2.Add(DateTime.Now.AddHours(1));
- DateTime[] dts = log2.All;
- // Printing both logs:
- foreach (String s in log1.All)
- Console.Write("{0} ", s);
- Console.WriteLine();
- foreach (DateTime dt in dts)
- Console.Write("{0} ", dt);
- Console.WriteLine();
- }
- }
-}
+++ /dev/null
-using System;
-
-interface IHello<T>
-{
- void Print (T t);
-}
-
-interface Foo
-{
- IHello<U> Test<U> ();
-}
-
-class Hello<T> : IHello<T>, Foo
-{
- public void Print (T t)
- {
- Console.WriteLine ("Hello: {0}", t);
- }
-
- public IHello<U> Test<U> ()
- {
- return new Hello<U> ();
- }
-}
-
-class X
-{
- static void Main ()
- {
- Hello<int> hello = new Hello<int> ();
- hello.Print (5);
- hello.Test<float> ().Print (3.14F);
-
- IHello<string> foo = hello.Test<string> ();
- foo.Print ("World");
- }
-}
+++ /dev/null
-class Foo {
- static void Main () {}
-}
-
-class Foo <T> {
- static Foo <T> x;
- static Foo <T> Blah { get { return x; } }
-}
+++ /dev/null
-namespace N {
- interface A <T> {
- }
-}
-class X <T> : N.A <T> {
-}
-class Foo {
- static void Main () {}
-}
+++ /dev/null
-// Using an array of a type parameter.
-
-class Stack<T>
-{
- int size;
- T[] data;
-
- public Stack ()
- {
- data = new T [200];
- }
-
- public void Push (T item)
- {
- data [size++] = item;
- }
-
- public T Pop ()
- {
- return data [--size];
- }
-
- public void Hello (T t)
- {
- System.Console.WriteLine ("Hello: {0}", t);
- }
-}
-
-class Test
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-using System;
-
-interface IFoo
-{
- MyList<U> Map<U> ();
-}
-
-class MyList<T>
-{
- public void Hello (T t)
- {
- Console.WriteLine (t);
- }
-}
-
-class Foo : IFoo
-{
- public MyList<T> Map<T> ()
- {
- return new MyList<T> ();
- }
-}
-
-class X
-{
- static void Main ()
- {
- Foo foo = new Foo ();
- MyList<int> list = foo.Map<int> ();
- list.Hello (9);
- }
-}
+++ /dev/null
-using System;
-
-public delegate B Test<A,B> (A a);
-
-public class Foo<T>
-{
- T t;
-
- public Foo (T t)
- {
- this.t = t;
- }
-
- public U Method<U> (Test<T,U> test)
- {
- return test (t);
- }
-}
-
-class X
-{
- static void Main ()
- {
- Test<double,int> test = new Test<double,int> (Math.Sign);
-
- Foo<double> foo = new Foo<double> (Math.PI);
- Console.WriteLine (foo.Method<int> (test));
-
- string s = foo.Method<string> (delegate (double d) { return "s" + d; });
- Console.WriteLine (s);
- }
-}
+++ /dev/null
-using System.Collections.Generic;
-
-class X
-{
- public IEnumerable<int> Test (int a, long b)
- {
- while (a < b) {
- a++;
- yield return a;
- }
- }
-
- static int Main ()
- {
- X x = new X ();
- int sum = 0;
- foreach (int i in x.Test (3, 8L))
- sum += i;
-
- return sum == 30 ? 0 : 1;
- }
-}
+++ /dev/null
-using System;
-
-public class Test
-{
- public static int IndexOf (Array array, object value)
- {
- // This is picking the non-generic version.
- return IndexOf (array, value, 0, array.Length);
- }
-
- public static int IndexOf (Array array, object value, int startIndex, int count)
- {
- return 2;
- }
-
- public static int IndexOf<T> (T[] array, T value, int startIndex, int count)
- {
- return 1;
- }
-}
-
-class X
-{
- static int Main ()
- {
- Test test = new Test ();
- string[] array = new string [] { "Hello" };
-
- int result = Test.IndexOf (array, array);
- if (result != 2)
- return 1;
-
- string hello = "Hello World";
- // This is picking the generic version.
- result = Test.IndexOf (array, hello, 1, 2);
- if (result != 1)
- return 2;
-
- return 0;
- }
-}
+++ /dev/null
-using System;
-
-public interface IHello<T>
-{ }
-
-public interface IFoo<T>
-{
- IHello<T> GetHello ();
-}
-
-public interface IBar<T> : IFoo<T>
-{ }
-
-public class Foo<T> : IBar<T>, IFoo<T>
-{
- public Hello GetHello ()
- {
- return new Hello (this);
- }
-
- IHello<T> IFoo<T>.GetHello ()
- {
- return new Hello (this);
- }
-
- public class Hello : IHello<T>
- {
- public readonly Foo<T> Foo;
-
- public Hello (Foo<T> foo)
- {
- this.Foo = foo;
- }
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-//-- ex-gen-type-parameter-in-constraint
-
-using System;
-using System.Collections.Generic;
-
-// A constraint may involve type parameters
-// A type may have multiple constraints
-
-struct ComparablePair<T,U> : IComparable<ComparablePair<T,U>>
- where T : IComparable<T>
- where U : IComparable<U> {
- public readonly T Fst;
- public readonly U Snd;
-
- public ComparablePair(T fst, U snd) {
- Fst = fst; Snd = snd;
- }
-
- // Lexicographic ordering
- public int CompareTo(ComparablePair<T,U> that) {
- int firstCmp = this.Fst.CompareTo(that.Fst);
- return firstCmp != 0 ? firstCmp : this.Snd.CompareTo(that.Snd);
- }
-
- public bool Equals(ComparablePair<T,U> that) {
- return this.Fst.Equals(that.Fst) && this.Snd.Equals(that.Snd);
- }
-
- public override String ToString() {
- return "(" + Fst + ", " + Snd + ")";
- }
-}
-
-// Sorting soccer world champions by country and year
-
-class MyTest {
- static void Test ()
- {
- new ComparablePair<string,int>("Brazil", 2002);
- }
-
- public static void Main(string[] args) {
- List<ComparablePair<string,int>> lst
- = new List<ComparablePair<string,int>>();
- lst.Add(new ComparablePair<String,int>("Brazil", 2002));
- lst.Add(new ComparablePair<String,int>("Italy", 1982));
- lst.Add(new ComparablePair<String,int>("Argentina", 1978 ));
- lst.Add(new ComparablePair<String,int>("Argentina", 1986 ));
- lst.Add(new ComparablePair<String,int>("Germany", 1990));
- lst.Add(new ComparablePair<String,int>("Brazil", 1994));
- lst.Add(new ComparablePair<String,int>("France", 1998));
- // lst.Sort();
- foreach (ComparablePair<String,int> pair in lst)
- Console.WriteLine(pair);
- }
-}
+++ /dev/null
-using System;
-
-public class Foo<T>
-{
-}
-
-class X
-{
- static void Main ()
- {
- Console.WriteLine (typeof (Foo<>));
- }
-}
+++ /dev/null
-class Test
-{
- public delegate int Foo<T> (T t, T u);
-
- public void Hello<U> (Foo<U> foo, U u)
- { }
-}
-
-class X
-{
- static int Add (int a, int b)
- {
- return a + b;
- }
-
- static void Main ()
- {
- Test test = new Test ();
- test.Hello<int> (new Test.Foo<int> (Add), 5);
- }
-}
+++ /dev/null
-namespace Martin
-{
- public class Foo<T>
- { }
-}
-
-namespace Baulig
-{
- using M = Martin;
-
- class X
- {
- static void Main ()
- {
- M.Foo<int> foo;
- }
- }
-}
+++ /dev/null
-public interface IFoo
-{
- int GetHashCode ();
-}
-
-public interface IFoo<T>
-{
- int GetHashCode ();
-}
-
-public class Test<T>
-{
- public int Foo (IFoo<T> foo)
- {
- return foo.GetHashCode ();
- }
-
- public int Foo (IFoo foo)
- {
- return foo.GetHashCode ();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-class Stack<T> : X
-{
-}
-
-class Test
-{
-}
-
-class X
-{
- static void Main()
- {
- }
-}
+++ /dev/null
-namespace Martin
-{
- public class Test<T>
- {
- public static int Foo ()
- {
- return 0;
- }
- }
-}
-
-class Foo<T>
-{
- public Foo (int a)
- { }
-
- public Foo ()
- : this (Martin.Test<T>.Foo ())
- { }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-using System;
-
-class Foo<T>
-{
- public T Test<U> (U u)
- where U : T
- {
- return u;
- }
-}
-
-class X
-{
- static void Main ()
- {
- Foo<X> foo = new Foo<X> ();
-
- Y y = new Y ();
- X x = foo.Test<Y> (y);
- }
-}
-
-class Y : X
-{
-}
+++ /dev/null
-//-- ex-gen-logger
-//-- ex-gen-struct-pair
-//-- ex-gen-logging-pairs
-// 1.2 alpha
-
-using System;
-
-public class Log<T> {
- private const int SIZE = 5;
- private static int instanceCount = 0;
- private int count = 0;
- private T[] log = new T[SIZE];
- public Log() { instanceCount++; }
- public static int InstanceCount { get { return instanceCount; } }
- public void Add(T msg) { log[count++ % SIZE] = msg; }
- public int Count { get { return count; } }
- public T Last {
- get { // Return the last log entry, or null if nothing logged yet
- return count==0 ? default(T) : log[(count-1)%SIZE];
- }
- set { // Update the last log entry, or create one if nothing logged yet
- if (count==0)
- log[count++] = value;
- else
- log[(count-1)%SIZE] = value;
- }
- }
- public T[] All {
- get {
- int size = Math.Min(count, SIZE);
- T[] res = new T[size];
- for (int i=0; i<size; i++)
- res[i] = log[(count-size+i) % SIZE];
- return res;
- }
- }
-}
-
-class TestLog {
- class MyTest {
- public static void Main(String[] args) {
- Log<String> log1 = new Log<String>();
- log1.Add("Reboot");
- log1.Add("Coffee");
- Log<DateTime> log2 = new Log<DateTime>();
- log2.Add(DateTime.Now);
- log2.Add(DateTime.Now.AddHours(1));
- DateTime[] dts = log2.All;
- // Printing both logs:
- foreach (String s in log1.All)
- Console.Write("{0} ", s);
- Console.WriteLine();
- foreach (DateTime dt in dts)
- Console.Write("{0} ", dt);
- Console.WriteLine();
- TestPairLog();
- }
-
- public static void TestPairLog() {
- Log<Pair<DateTime,String>> log = new Log<Pair<DateTime,String>>();
- log.Add(new Pair<DateTime,String>(DateTime.Now, "Tea leaves"));
- log.Add(new Pair<DateTime,String>(DateTime.Now.AddMinutes(2), "Hot water"));
- log.Add(new Pair<DateTime,String>(DateTime.Now.AddMinutes(7), "Ready"));
- Pair<DateTime,String>[] allMsgs = log.All;
- foreach (Pair<DateTime,String> p in allMsgs)
- Console.WriteLine("At {0}: {1}", p.Fst, p.Snd);
- }
- }
-}
-
-public struct Pair<T,U> {
- public readonly T Fst;
- public readonly U Snd;
- public Pair(T fst, U snd) {
- this.Fst = fst;
- this.Snd = snd;
- }
-}
+++ /dev/null
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-class MyList<T> : IEnumerable<T>
-{
- public IEnumerator<T> GetEnumerator ()
- {
- yield break;
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-}
-
-struct Foo<T>
-{
- public readonly T Data;
-
- public Foo (T data)
- {
- this.Data = data;
- }
-}
-
-class X
-{
- static void Main ()
- {
- MyList<Foo<int>> list = new MyList <Foo<int>> ();
- foreach (Foo<int> foo in list)
- ;
- }
-}
+++ /dev/null
-using System;
-
-public struct Foo<T>
-{
- public T Data, Data2;
-
- public Foo (T a, T b)
- {
- this.Data = a;
- this.Data2 = b;
- }
-}
-
-public class Test<T>
-{
- public T Data, Data2;
-
- public Test (T a, T b)
- {
- this.Data = a;
- this.Data2 = b;
- }
-}
-
-class X
-{
- static int Main ()
- {
- Foo<long> foo = new Foo<long> (3, 5);
- if (foo.Data != 3)
- return 1;
- if (foo.Data2 != 5)
- return 2;
-
- Test<long> test = new Test<long> (3, 5);
- if (test.Data != 3)
- return 3;
- if (test.Data2 != 5)
- return 4;
-
- return 0;
- }
-}
+++ /dev/null
-public interface IExtensible<T>
-{
- void AddAll<U> (U item)
- where U : T;
-}
-
-public class ArrayList<T> : IExtensible<T>
-{
- void IExtensible<T>.AddAll<U> (U item)
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-struct Foo<T>
-{
- public T Data;
-
- public Foo (T data)
- {
- this.Data = data;
- }
-}
-
-class Test<T>
-{
- public Foo<T> GetFoo (T data)
- {
- return new Foo<T> (data);
- }
-}
-
-class X
-{
- static int Main ()
- {
- Test<long> test = new Test<long> ();
- Foo<long> foo = test.GetFoo (0x800);
- //
- // This is a very simple test, just make sure the struct
- // is returned correctly. This was broken until recently
- // and I just fixed it on amd64.
- if (foo.Data != 0x800)
- return 1;
- return 0;
- }
-}
-
+++ /dev/null
-// Compiler options: -r:System
-using System;
-using System.Collections.Generic;
-
-public class X {
- public static void Main(string[] args)
- {
- Collection<int> list = new Collection<int>();
- list.Add (3);
- foreach (int i in list) {
- Console.WriteLine(i);
- }
- }
-}
+++ /dev/null
-using System;
-using System.Collections;
-
-public class Test
-{
- public static void Main ()
- {
- foreach (object o in new Test ())
- Console.WriteLine (o);
- }
-
- public IEnumerator GetEnumerator ()
- {
- foreach (int i in new ArrayList ())
- yield return i;
- }
-}
+++ /dev/null
-namespace A
-{
- public interface IExtensible<T>
- {
- void AddAll<U> (U u)
- where U : T;
- }
-
- public class ArrayList<T> : IExtensible<T>
- {
- void IExtensible<T>.AddAll<U> (U u)
- {
- InsertAll (u);
- }
-
- void InsertAll (T t)
- { }
- }
-}
-
-namespace B
-{
- public interface IExtensible<S,T>
- {
- void AddAll<U> (U t)
- where U : S;
- }
-
- public class ArrayList<X,Y> : IExtensible<Y,X>
- {
- public void AddAll<Z> (Z z)
- where Z : Y
- {
- InsertAll (z);
- }
-
- void InsertAll (Y y)
- { }
- }
-}
-
-namespace C
-{
- public interface IExtensible<S>
- {
- void AddAll<T> (T t)
- where T : S;
- }
-
- public class Foo<U>
- { }
-
- public class ArrayList<X> : IExtensible<Foo<X>>
- {
- public void AddAll<Y> (Y y)
- where Y : Foo<X>
- {
- InsertAll (y);
- }
-
- void InsertAll (Foo<X> foo)
- { }
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-interface I
-{
- void Hello ();
-}
-
-class Stack<T>
- where T : I, new ()
-{
-}
-
-class Test
-{
-}
-
-class X
-{
- static void Main()
- {
- }
-}
+++ /dev/null
-public interface IFoo<X>
-{ }
-
-public class Test
-{
- public void Hello<T> (IFoo<T> foo)
- {
- InsertAll (foo);
- }
-
- public void InsertAll<U> (IFoo<U> foo)
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public class ArrayList<T>
-{
- void AddAll<U> (U u)
- where U : T
- {
- InsertAll (u);
- }
-
- void InsertAll (T t)
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public class Queue<T>
-{
- protected class Enumerator
- {
- Queue<T> queue;
-
- public Enumerator (Queue<T> queue)
- {
- this.queue = queue;
- }
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public class CollectionValueBase<T>
-{
- public virtual T[] ToArray()
- {
- return null;
- }
-}
-
-public class CollectionBase<T>: CollectionValueBase<T>
-{
-}
-
-public class SequencedBase<T>: CollectionBase<T>
-{
-}
-
-public class ArrayBase<T>: SequencedBase<T>
-{
- public override T[] ToArray()
- {
- return null;
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-namespace HasherBuilder
-{
- public class ByPrototype<S>
- {
- public static IHasher<S> Examine()
- {
- return null;
- }
- }
-}
-
-public interface IHasher<T>
-{
-}
-
-public class ArrayList<U>
-{
- public IHasher<U> GetHasher ()
- {
- return HasherBuilder.ByPrototype<U>.Examine();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
-
+++ /dev/null
-using System;
-
-public interface IFoo<S>
-{ }
-
-public class ArrayList<T>
-{
- public virtual int InsertAll (IFoo<T> foo)
- {
- return 0;
- }
-
- public virtual int InsertAll<U> (IFoo<U> foo)
- where U : T
- {
- return 1;
- }
-
- public virtual int AddAll (IFoo<T> foo)
- {
- return InsertAll (foo);
- }
-}
-
-class X
-{
- static int Main ()
- {
- ArrayList<int> list = new ArrayList<int> ();
- return list.AddAll (null);
- }
-}
+++ /dev/null
-public interface IFoo<S>
-{ }
-
-public class ArrayList<T>
-{
- public virtual int InsertAll (IFoo<T> foo)
- {
- return 0;
- }
-
- public virtual int InsertAll<U> (IFoo<U> foo)
- where U : T
- {
- return 1;
- }
-
- public virtual int AddAll (IFoo<T> foo)
- {
- return InsertAll (foo);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-namespace C5
-{
- public class HashedArrayList<T>
- {
- public void Test ()
- {
- new HashSet <KeyValuePair<T,int>> (new KeyValuePairHasher<T,int> ());
- }
- }
-
- public class HashSet<T>
- {
- public HashSet (IHasher<T> itemhasher)
- { }
- }
-
- public interface IHasher<T>
- {
- }
-
- public struct KeyValuePair<K,V>
- {
- }
-
- public sealed class KeyValuePairHasher<K,V>: IHasher<KeyValuePair<K,V>>
- {
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public struct KeyValuePair<K,V>
-{
- public KeyValuePair (K k, V v)
- { }
-
- public KeyValuePair (K k)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- new KeyValuePair<int,long> ();
- }
-}
+++ /dev/null
-using System;
-
-class Test<T>
-{
- public void Foo (T t, out int a)
- {
- a = 5;
- }
-
- public void Hello (T t)
- {
- int a;
-
- Foo (t, out a);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-interface I
-{
- void Hello ();
-}
-
-class Stack<T>
- where T : ICloneable
-{
- public object Test (T t)
- {
- return t.Clone ();
- }
-}
-
-class Test
-{
-}
-
-class X
-{
- static void Main()
- {
- }
-}
+++ /dev/null
-using System;
-
-public abstract class Foo<T>
-{
- public virtual T InsertAll<U> (U u)
- where U : T
- {
- return u;
- }
-}
-
-public class Bar<T> : Foo<T>
-{
- public override T InsertAll<U> (U u)
- {
- return u;
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public class Foo<T>
-{
- Node node;
-
- public Node Test<V> ()
- {
- return node;
- }
-
- public class Node
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public class Element<T>
-{
- public readonly T Item;
-
- public Element (T item)
- {
- this.Item = item;
- }
-
- public void GetItem (out T retval)
- {
- retval = Item;
- }
-
- public T GetItem (int a, ref T data)
- {
- return Item;
- }
-
- public void SetItem (T data)
- { }
-}
-
-public class Foo<T>
-{
- Element<Node> element;
-
- public Node Test ()
- {
- Node node = element.Item;
- element.GetItem (out node);
- element.SetItem (node);
- return element.GetItem (3, ref node);
- }
-
- public class Node
- {
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public class Foo<T>
-{
- public readonly T Item;
-
- public Foo (T item)
- {
- this.Item = item;
- }
-
- static void maketreer (out Node rest)
- {
- rest = new Node ();
- }
-
- class Node
- { }
-
- public void Hello<U> ()
- {
- Foo<U>.Node node;
- Foo<U>.maketreer (out node);
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-public class LinkedList<T>
-{
- protected class Node
- { }
-}
-
-public class HashedLinkedList<T> : LinkedList<T>
-{
- Node node;
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;
-
-public interface IDirectedEnumerable<T>
-{
- IDirectedEnumerable<T> Backwards();
-}
-
-public interface IDirectedCollectionValue<T> : IDirectedEnumerable<T>
-{
- new IDirectedCollectionValue<T> Backwards();
-}
-
-public class GuardedCollectionValue<T> : IDirectedCollectionValue<T>
-{
- IDirectedEnumerable<T> IDirectedEnumerable<T>.Backwards ()
- {
- return this;
- }
-
- public IDirectedCollectionValue<T> Backwards ()
- {
- return this;
- }
-}
-
-public interface ISequenced<T> : IDirectedCollectionValue<T>
-{
-}
-
-public class GuardedSequenced<T>
-{
- ISequenced<T> sequenced;
-
- public IDirectedCollectionValue<T> Test ()
- {
- return sequenced.Backwards();
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-using System;\r
-\r
-class Foo<T>\r
-{ }\r
-\r
-class Test\r
-{\r
- static void Hello<T> (Foo<T>[] foo, int i)\r
- {\r
- Foo<T> element = foo [0];\r
- Console.WriteLine (element);\r
- if (i > 0)\r
- Hello<T> (foo, i - 1);\r
- }\r
-\r
- public static void Quicksort<U> (Foo<U>[] arr)\r
- {\r
- Hello<U> (arr, 1);\r
- }\r
-\r
- static void Main ()\r
- {\r
- Foo<int>[] foo = new Foo<int> [1];\r
- foo [0] = new Foo<int> ();\r
- Quicksort (foo);\r
- }\r
-}\r
+++ /dev/null
-public interface IFoo
-{
- void Test<T> ();
-
- void Test<U,V> ();
-}
-
-public class Foo : IFoo
-{
- void IFoo.Test<X> ()
- { }
-
- void IFoo.Test<Y,Z> ()
- { }
-}
-
-public interface IBar<T>
-{
- void Test ();
-}
-
-public interface IBar<U,V>
-{
- void Test ();
-}
-
-public class Bar<X,Y,Z> : IBar<X>, IBar<Y,Z>
-{
- void IBar<X>.Test ()
- { }
-
- void IBar<Y,Z>.Test ()
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public interface IFoo
-{
- void Test<T> ();
-
- void Test<U,V> ();
-}
-
-public interface IBar<T>
-{
- void Test ();
-}
-
-public interface IBar<U,V>
-{
- void Test ();
-}
+++ /dev/null
-// Compiler options: /r:gen-98-dll.dll
-public class Foo : IFoo
-{
- void IFoo.Test<X> ()
- { }
-
- void IFoo.Test<Y,Z> ()
- { }
-}
-
-public class Bar<X,Y,Z> : IBar<X>, IBar<Y,Z>
-{
- void IBar<X>.Test ()
- { }
-
- void IBar<Y,Z>.Test ()
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
--- /dev/null
+class Stack < type > {
+
+}
+
+class Boot {
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+class Cell <X> {
+ X value;
+
+}
+
+class D {
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+ Stack<Test> a;
+
+ static void Main()
+ {
+ }
+}
--- /dev/null
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+ public void Foo (Stack<Test> a)
+ { }
+
+ static void Main()
+ {
+ }
+}
--- /dev/null
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+ static void Main()
+ {
+ Stack<Test> a;
+ }
+}
--- /dev/null
+// Using an array of a type parameter.
+
+class Stack<T>
+{
+ int size;
+ T[] data;
+
+ public Stack ()
+ {
+ data = new T [200];
+ }
+
+ public void Push (T item)
+ {
+ data [size++] = item;
+ }
+
+ public T Pop ()
+ {
+ return data [--size];
+ }
+
+ public void Hello (T t)
+ {
+ System.Console.WriteLine ("Hello: {0}", t);
+ }
+}
+
+class Test
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+class Stack<T> : X
+{
+}
+
+class Test
+{
+}
+
+class X
+{
+ static void Main()
+ {
+ }
+}
--- /dev/null
+interface I
+{
+ void Hello ();
+}
+
+class Stack<T>
+ where T : I, new ()
+{
+}
+
+class Test
+{
+}
+
+class X
+{
+ static void Main()
+ {
+ }
+}
--- /dev/null
+using System;
+
+interface I
+{
+ void Hello ();
+}
+
+class Stack<T>
+ where T : ICloneable
+{
+ public object Test (T t)
+ {
+ return t.Clone ();
+ }
+}
+
+class Test
+{
+}
+
+class X
+{
+ static void Main()
+ {
+ }
+}
--- /dev/null
+// Type parameters with constraints: check whether we can invoke
+// things on the constrained type.
+
+using System;
+
+interface I
+{
+ void Hello ();
+}
+
+class J
+{
+ public void Foo ()
+ {
+ Console.WriteLine ("Foo!");
+ }
+}
+
+class Stack<T>
+ where T : J, I
+{
+ public void Test (T t)
+ {
+ t.Hello ();
+ t.Foo ();
+ }
+}
+
+class Test
+{
+}
+
+class X
+{
+ static void Main()
+ {
+ }
+}
--- /dev/null
+class Stack<S>
+{
+ public void Hello (S s)
+ { }
+}
+
+class X
+{
+ Stack<int> stack;
+
+ void Test ()
+ {
+ stack.Hello (3);
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// A generic type definition may have another generic type
+// definition as its parent.
+
+class Stack<S>
+{
+ public void Hello (S s)
+ { }
+}
+
+class Test<T> : Stack<T>
+{
+ public void Foo (T t)
+ { }
+}
+
+class X
+{
+ Test<int> test;
+
+ void Test ()
+ {
+ test.Foo (4);
+ test.Hello (3);
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -t:library
+
+public class Stack<S>
+{
+ public void Hello (S s)
+ { }
+}
--- /dev/null
+// Compiler options: -r:gtest-013-lib.dll
+
+public class X
+{
+ Stack<int> stack;
+
+ void Test ()
+ {
+ stack.Hello (3);
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+public class Stack<S>
+{
+ public Stack (S s)
+ { }
+
+ public void Push (S s)
+ { }
+}
+
+public class X
+{
+ static void Main ()
+ {
+ Stack<int> s1 = new Stack<int> (3);
+ s1.Push (4);
+
+ Stack<string> s2 = new Stack<string> ("Hello");
+ s2.Push ("Test");
+ }
+}
--- /dev/null
+// Very simple example of a generic method.
+
+class Stack<S>
+{
+ public static void Hello<T,U> (S s, T t, U u)
+ {
+ U v = u;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// A generic method may also use the type parameters
+// from its enclosing type.
+
+class Stack<S>
+{
+ public static void Hello<T> (S s, T t)
+ { }
+}
+
+class X
+{
+ Stack<int> stack;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+public class Stack
+{
+ public Stack ()
+ { }
+
+ public void Hello<T> (T t)
+ { }
+}
--- /dev/null
+// Compiler options: -r:gtest-017-lib.dll
+
+public class X
+{
+ public static void Foo (Stack stack)
+ {
+ stack.Hello<string> ("Hello World");
+ }
+
+ static void Main ()
+ {
+ Stack stack = new Stack ();
+ Foo (stack);
+ }
+}
--- /dev/null
+public class Stack
+{
+ public Stack ()
+ { }
+
+ public void Hello<T> (T t)
+ { }
+}
+
+public class X
+{
+ public static void Foo (Stack stack)
+ {
+ stack.Hello<string> ("Hello World");
+ }
+
+ static void Main ()
+ {
+ Stack stack = new Stack ();
+ Foo (stack);
+ }
+}
--- /dev/null
+// A very simple generic interface
+
+public interface IEnumerator<T> {
+ T Current { get; }
+ bool MoveNext();
+ void Reset();
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+struct Stack<S>
+{
+ public void Hello (S s)
+ { }
+}
+
+class X
+{
+ Stack<int> stack;
+
+ void Test ()
+ {
+ stack.Hello (3);
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// Testing the default value expressions (14.5.13)
+
+using System;
+
+class Foo<T>
+{
+ T[] t;
+
+ public Foo (int n)
+ {
+ t = new T [n];
+ for (int i = 0; i < n; i++)
+ t [i] = default (T);
+ }
+
+ public void Test ()
+ {
+ X.Print (t [0]);
+ }
+}
+
+class Bar<T>
+{
+ public void Test ()
+ {
+ X.Print (default (X));
+ X.Print (default (T));
+ X.Print (default (S));
+ }
+}
+
+struct S
+{
+ public readonly string Hello;
+
+ S (string hello)
+ {
+ this.Hello = hello;
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("S({0})", Hello);
+ }
+
+}
+
+class X
+{
+ public static void Print (object obj)
+ {
+ if (obj == null)
+ Console.WriteLine ("NULL");
+ else
+ Console.WriteLine ("OBJECT: {0} {1}", obj, obj.GetType ());
+ }
+
+ static void Main ()
+ {
+ Foo<string> a = new Foo<string> (4);
+ a.Test ();
+
+ Bar<int> b = new Bar<int> ();
+ b.Test ();
+ Bar<X> c = new Bar<X> ();
+ c.Test ();
+ }
+}
--- /dev/null
+// A non-generic type may have a closed constructed type as its parent
+
+class Foo<T>
+{
+ public void Hello ()
+ { }
+
+ public void World (T t)
+ {
+ Hello ();
+ }
+}
+
+class Bar : Foo<int>
+{
+ public void Test ()
+ {
+ Hello ();
+ World (4);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Bar bar = new Bar ();
+ bar.Test ();
+ }
+}
--- /dev/null
+class Foo<T>
+{
+ public void Hello ()
+ { }
+
+ public void World (T t)
+ {
+ Hello ();
+ }
+}
+
+//
+// This is some kind of a `recursive' declaration:
+//
+// Note that we're using the class we're currently defining (Bar)
+// as argument of its parent.
+//
+// Is is important to run the resulting executable since this is
+// both a test for the compiler and the runtime.
+//
+
+class Bar : Foo<Bar>
+{
+ public void Test ()
+ {
+ Hello ();
+ World (this);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+class Foo<T>
+{
+ public Foo ()
+ { }
+
+ public void Hello (T t)
+ {
+ // We're boxing the type parameter `T' to an object here.
+ Whatever (t);
+ }
+
+ public void Whatever (object o)
+ {
+ System.Console.WriteLine (o.GetType ());
+ }
+}
+
+class X
+{
+ static void Test (Foo<int> foo)
+ {
+ foo.Hello (4);
+ }
+
+ static void Main ()
+ {
+ Foo<int> foo = new Foo<int> ();
+ Test (foo);
+ }
+}
--- /dev/null
+class Foo
+{
+ public Foo ()
+ { }
+
+ public void Hello<T> (T t)
+ {
+ // We're boxing the type parameter `T' to an object here.
+ Whatever (t);
+ }
+
+ public void Whatever (object o)
+ {
+ System.Console.WriteLine (o.GetType ());
+ }
+}
+
+class X
+{
+ static void Test (Foo foo)
+ {
+ foo.Hello<int> (531);
+ }
+
+ static void Main ()
+ {
+ Foo foo = new Foo ();
+ Test (foo);
+ }
+}
--- /dev/null
+// Test access to class fields outside the generic type declaration.
+
+class Foo<T>
+{
+ public T Hello;
+
+ public Foo ()
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<int> foo = new Foo<int> ();
+ foo.Hello = 9;
+ }
+}
--- /dev/null
+// A generic type declaration may have a non-generic base type.
+
+class TheBase
+{
+ public void BaseFunc ()
+ { }
+}
+
+class Stack<S> : TheBase
+{
+ public void Hello (S s)
+ { }
+}
+
+class Test<T> : Stack<T>
+{
+ public void Foo (T t)
+ { }
+}
+
+class X
+{
+ Test<int> test;
+
+ void Test ()
+ {
+ test.Foo (4);
+ test.Hello (3);
+ test.BaseFunc ();
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+class Stack<T>
+{
+ T t;
+
+ public Stack (T t)
+ {
+ this.t = t;
+ }
+
+ public object Test ()
+ {
+ // Boxing the type parameter `T' to an object.
+ return t;
+ }
+}
+
+class X
+{
+ public static object Test (Stack<int> stack)
+ {
+ return stack.Test ();
+ }
+
+ static void Main ()
+ {
+ Stack<int> stack = new Stack<int> (9);
+ System.Console.WriteLine (Test (stack));
+ }
+}
--- /dev/null
+class Stack<T>
+{
+ T[] t;
+
+ public Stack (int n)
+ {
+ t = new T [n];
+ }
+
+ public object Test ()
+ {
+ // Boxing the type parameter to an object; note that we're
+ // an array !
+ return t;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Stack<int> stack = new Stack<int> (5);
+ System.Console.WriteLine (stack.Test ());
+ }
+}
--- /dev/null
+// Note how the order of type parameters is different
+// in the base class.
+
+class Foo<T>
+{
+ public Foo ()
+ { }
+
+ public void Hello (T t)
+ { }
+}
+
+class Bar<T,U> : Foo<U>
+{
+ public Bar ()
+ { }
+
+ public void Test (T t, U u)
+ { }
+}
+
+class X
+{
+ static void Test (Bar<int,string> bar)
+ {
+ bar.Hello ("Test");
+ bar.Test (7, "Hello");
+ }
+
+ static void Main ()
+ {
+ Bar<int,string> bar = new Bar<int,string> ();
+ Test (bar);
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+public class Foo<T>
+{
+ public void Hello (T t)
+ { }
+}
+
+public class Bar<T,U> : Foo<U>
+{
+ public void Test (T t, U u)
+ { }
+}
--- /dev/null
+// Compiler options: -r:gtest-031-lib.dll
+
+public class X
+{
+ public static void Test (Bar<int,string> bar)
+ {
+ bar.Hello ("Test");
+ bar.Test (7, "Hello");
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// Generic interfaces
+
+interface Foo<S>
+{
+ void Hello (S s);
+}
+
+interface Bar<T,U> : Foo<U>
+{
+ void Test (T t, U u);
+}
+
+class X
+{
+ static void Test (Bar<int,string> bar)
+ {
+ bar.Hello ("Test");
+ bar.Test (7, "Hello");
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// Generic interfaces
+
+interface Foo<R,S>
+{
+ void Hello (R r, S s);
+}
+
+interface Bar<T,U,V> : Foo<V,float>
+{
+ void Test (T t, U u, V v);
+}
+
+class X
+{
+ static void Test (Bar<long,int,string> bar)
+ {
+ bar.Hello ("Test", 3.14F);
+ bar.Test (512, 7, "Hello");
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+class Foo<T>
+{ }
+
+class Stack<T>
+{ }
+
+//
+// We may use a constructed type `Stack<T>' instead of
+// just a type parameter.
+//
+
+class Bar<T> : Foo<Stack<T>>
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// May use a constructed type as constraint.
+
+class Test<T>
+{ }
+
+class Foo<T>
+ where T : Test<T>
+{ }
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+//
+// This is another "important" test: it checks whether we set
+// TypeContainer.CurrentType correctly when compiling the
+// declaration of `Stack'.
+//
+
+class Stack<T>
+{
+ //
+ // This must be encoded as a TypeSpec (Stack<!0>) and
+ // not as a TypeDef.
+ //
+ // PEVerify the resulting executable on Windows to make sure !
+ //
+ void Hello (Stack<T> stack)
+ {
+ }
+
+ void Test ()
+ {
+ Hello (this);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+//
+// Check whether we're correctly handling `this'.
+//
+//
+
+public class Foo<T,U>
+{
+ public void Hello (Foo<T,U> foo)
+ {
+ }
+
+ public virtual void Test ()
+ {
+ //
+ // Again, this must be encoded as a TypeSpec (Foo<!0,!1>)
+ // instead of a TypeDef.
+ Hello (this);
+ }
+}
+
+public class Bar<T> : Foo<T,long>
+{
+ public void Test (Foo<T,long> foo)
+ {
+ Hello (foo);
+ }
+}
+
+public class Baz<T> : Foo<T,string>
+{
+ public override void Test ()
+ {
+ Hello (this);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+//
+// Another important test: nested generic types.
+//
+
+using System;
+
+class Queue<T>
+{
+ public Queue (T first, T second)
+ {
+ head = new Node<T> (null, second);
+ head = new Node<T> (head, first);
+ }
+
+ protected Node<T> head;
+
+ protected Node<T> GetFoo ()
+ {
+ return head;
+ }
+
+ protected Node<T> Foo {
+ get {
+ return GetFoo ();
+ }
+ }
+
+ protected void Test (T t)
+ {
+ Console.WriteLine (t);
+ }
+
+ public void Test ()
+ {
+ Test (head.Item);
+ Test (head.Next.Item);
+ Test (GetFoo ().Item);
+ Test (Foo.Item);
+ }
+
+ protected class Node<U>
+ {
+ public readonly U Item;
+ public readonly Node<U> Next;
+
+ public Node (Node<U> next, U item)
+ {
+ this.Next = next;
+ this.Item = item;
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Queue<int> queue = new Queue<int> (5, 9);
+ queue.Test ();
+ }
+}
--- /dev/null
+//
+// Important test for the runtime: check whether we're correctly
+// creating the vtable for nested types.
+//
+
+using System;
+
+interface IMonkey<T>
+{
+ T Jump ();
+}
+
+class Zoo<T>
+{
+ T t;
+
+ public Zoo (T t)
+ {
+ this.t = t;
+ }
+
+ public T Name {
+ get { return t; }
+ }
+
+ public IMonkey<U> GetTheMonkey<U> (U u)
+ {
+ return new Monkey<T,U> (this, u);
+ }
+
+ public class Monkey<V,W> : IMonkey<W>
+ {
+ public readonly Zoo<V> Zoo;
+ public readonly W Data;
+
+ public Monkey (Zoo<V> zoo, W data)
+ {
+ this.Zoo = zoo;
+ this.Data = data;
+ }
+
+ public W Jump ()
+ {
+ Console.WriteLine ("Monkey {0} from {1} jumping!", Data, Zoo.Name);
+ return Data;
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Zoo<string> zoo = new Zoo<string> ("Boston");
+ IMonkey<float> monkey = zoo.GetTheMonkey<float> (3.14F);
+ monkey.Jump ();
+ }
+}
--- /dev/null
+public interface INode<T>
+{
+ void Hello (T t);
+}
+
+public class Stack<T>
+{
+ public T TheData;
+ public readonly Foo<T> TheFoo;
+
+ public Stack (T t)
+ {
+ this.TheData = t;
+ this.TheFoo = new Foo<T> (t);
+ }
+
+ public INode<T> GetNode ()
+ {
+ return new Node (this);
+ }
+
+ public Foo<T> GetFoo (T t)
+ {
+ return new Foo<T> (t);
+ }
+
+ public Bar<T> GetBar (T t)
+ {
+ return new Bar<T> (t);
+ }
+
+ protected class Node : INode<T>
+ {
+ public readonly Stack<T> Stack;
+
+ public Node (Stack<T> stack)
+ {
+ this.Stack = stack;
+ }
+
+ public void Hello (T t)
+ {
+ }
+ }
+
+ public class Foo<T>
+ {
+ public readonly T Data;
+
+ public Bar<T> GetBar ()
+ {
+ return new Bar<T> (Data);
+ }
+
+ public Foo (T t)
+ {
+ this.Data = t;
+ }
+ }
+
+ public class Bar<U>
+ {
+ public readonly U Data;
+
+ public Bar (U u)
+ {
+ this.Data = u;
+ }
+
+ public Foo<T> GetFoo (Stack<T> stack)
+ {
+ return stack.TheFoo;
+ }
+
+ public class Baz<V>
+ {
+ public readonly V Data;
+
+ public Foo<T> GetFoo (Stack<T> stack)
+ {
+ return new Foo<T> (stack.TheData);
+ }
+
+ public Bar<V> GetBar ()
+ {
+ return new Bar<V> (Data);
+ }
+
+ public Baz (V v)
+ {
+ this.Data = v;
+ }
+ }
+ }
+
+ public void Test ()
+ {
+ Stack<T>.Foo<T> foo1 = GetFoo (TheData);
+ Foo<T> foo2 = GetFoo (TheData);
+
+ Stack<long>.Foo<T> foo3 = new Stack<long>.Foo<T> (TheData);
+ Stack<long>.Foo<float> foo4 = new Stack<long>.Foo<float> (3.14F);
+
+ Foo<double> foo5 = new Foo<double> (3.14);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Stack<int> stack = new Stack<int> (1);
+ INode<int> node = stack.GetNode ();
+ Stack<int>.Foo<int> foo = stack.GetFoo (7);
+ Stack<int>.Bar<int> bar = stack.GetBar (8);
+ }
+}
--- /dev/null
+// We may use type parameters as `params' type.
+
+class Stack<T>
+{
+ public void Hello (int a, params T[] args)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Stack<string> stack = new Stack<string> ();
+ stack.Hello (1, "Hello", "World");
+ }
+}
--- /dev/null
+// Compare this to gcs0695-*.cs: these are the allowed cases.
+
+namespace A
+{
+ interface I<X>
+ { }
+
+ interface J<X,Y> : I<X>
+ { }
+
+ class A<X> : I<X>, I<A<X>>
+ { }
+
+ class B<X> : I<B<X>>, I<X>, I<A<X>>
+ { }
+
+ class C<X> : I<int>, I<A<X>>
+ { }
+
+ class D<X> : I<A<float>>, I<B<X>>
+ { }
+
+ class E<X,Y> : J<X,Y>, J<I<X>,I<Y>>
+ { }
+
+ class F<X> : J<X,I<X>>, J<X,X>
+ { }
+}
+
+// bug #69057
+namespace B
+{
+ struct KeyValuePair<K,V>
+ { }
+
+ interface ITest<T>
+ { }
+
+ interface ITest2<K,V> : ITest<KeyValuePair<K,V>>
+ { }
+
+ class MyTest<K,V> : ITest2<K,V>, ITest<KeyValuePair<K,V>>
+ { }
+}
+
+// bug #58303
+namespace C
+{
+ class S <K> { }
+
+ interface Z<T> { }
+
+ interface I<K> : Z<S<K>> { }
+
+ class C <K> : I<K>, Z<S<K>> { }
+}
+
+class Test
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Static fields in generic types: this is a runtime/JIT-only test
+//
+// We need to make sure that we're instantiating each closed generic
+// type (ie. "Test<int>") only once.
+
+using System;
+
+public class Test<T>
+{
+ public static int Count;
+
+ public void Foo ()
+ {
+ Count++;
+ }
+
+ public int GetCount ()
+ {
+ return Count;
+ }
+}
+
+class X
+{
+ static int DoTheTest<T> ()
+ {
+ Test<T> test = new Test<T> ();
+
+ test.Foo ();
+ if (test.GetCount () != 1)
+ return 1;
+ if (Test<T>.Count != 1)
+ return 2;
+
+ test.Foo ();
+ if (test.GetCount () != 2)
+ return 3;
+ if (Test<T>.Count != 2)
+ return 4;
+
+ test.Foo ();
+ if (test.GetCount () != 3)
+ return 5;
+ if (Test<T>.Count != 3)
+ return 6;
+
+ return 0;
+ }
+
+ static int Main ()
+ {
+ int result = DoTheTest<int> ();
+ if (result != 0)
+ return result;
+
+ result = DoTheTest<long> () + 10;
+ if (result != 10)
+ return result;
+
+ Test<int>.Count = 0;
+ ++Test<long>.Count;
+
+ result = DoTheTest<int> () + 20;
+ if (result != 20)
+ return result;
+
+ if (Test<int>.Count != 3)
+ return 31;
+ if (Test<long>.Count != 4)
+ return 32;
+ Test<float>.Count = 5;
+ if (Test<int>.Count != 3)
+ return 33;
+ if (Test<long>.Count != 4)
+ return 34;
+
+ return 0;
+ }
+}
--- /dev/null
+// Operators and generic types.
+
+using System;
+
+class X<T>
+{
+ public int Count;
+
+ public X (int count)
+ {
+ this.Count = count;
+ }
+
+ public static X<T> operator ++ (X<T> operand) {
+ return new X<T> (operand.Count + 1);
+ }
+}
+
+class Test
+{
+ static void Main ()
+ {
+ X<long> x = new X<long> (5);
+ Console.WriteLine (x.Count);
+ x++;
+ Console.WriteLine (x.Count);
+ }
+}
--- /dev/null
+// Important test: Type inference
+
+class Test<A,B>
+{
+ public void Foo<U> (U u)
+ { }
+
+ public void Foo<V> (V[] v, V w)
+ { }
+
+ public void Hello<V,W> (V v, W w, Test<V,W> x)
+ { }
+
+ public void ArrayMethod<V> (params V[] args)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Test<float,int> test = new Test<float,int> ();
+ test.Foo ("Hello World");
+ test.Foo (new long[] { 3, 4, 5 }, 9L);
+ test.Hello (3.14F, 9, test);
+ test.ArrayMethod (3.14F, (float) 9 / 3);
+ }
+}
+
--- /dev/null
+// Generic delegates.
+
+using System;
+
+delegate void Test<T> (T t);
+
+class Foo<T>
+{
+ public event Test<T> MyEvent;
+
+ public void Hello (T t)
+ {
+ if (MyEvent != null)
+ MyEvent (t);
+ }
+}
+
+class X
+{
+ static void do_hello (string hello)
+ {
+ Console.WriteLine ("Hello: {0}", hello);
+ }
+
+ static void Main ()
+ {
+ Foo<string> foo = new Foo<string> ();
+ foo.MyEvent += new Test<string> (do_hello);
+ foo.Hello ("Boston");
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+namespace Foo
+{
+ public class List
+ {
+ }
+}
+
+namespace Bar
+{
+ public class List<T>
+ {
+ }
+}
--- /dev/null
+// Compiler options: -r:gtest-047-lib.dll
+
+// Important test: verify our namespace lookup rules
+//
+// There's a generic and a non-generic `List' type in two
+// different namespaces: make sure we pick the correct one.
+
+using Foo;
+using Bar;
+
+class X
+{
+ static void Main ()
+ {
+ List<int> list = new List<int> ();
+ }
+}
--- /dev/null
+// This fixed a problem in the JIT.
+
+public class Stack<T>
+{
+ T[] data;
+
+ public Stack ()
+ {
+ data = new T [10];
+ }
+
+ public void Add (T t)
+ {
+ data [0] = t;
+ }
+}
+
+struct Foo
+{
+ int a;
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo foo = new Foo ();
+ Stack<Foo> stack = new Stack<Foo> ();
+ stack.Add (foo);
+ }
+}
--- /dev/null
+// Important test: compare this to gcs0408-*.cs; these are the allowed cases.
+
+class X<T>
+{
+ void A (T t)
+ { }
+
+ void A (T[] t)
+ { }
+
+ void A (T[,] t)
+ { }
+
+ void A (T[][] t)
+ { }
+
+ void B (T[] t)
+ { }
+
+ void B (int t)
+ { }
+
+ void C (T[] t)
+ { }
+
+ void C (T[,] t)
+ { }
+
+ void C (int[,,] t)
+ { }
+
+ void D (int x, T y)
+ { }
+
+ void D (T x, long y)
+ { }
+}
+
+class Foo
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Type inference when creating delegates
+
+using System;
+
+delegate int D (string s, int i);
+
+delegate int E ();
+
+class X
+{
+ public static T F<T> (string s, T t)
+ {
+ return t;
+ }
+
+ public static T G<T> ()
+ {
+ throw new ArgumentException ();
+ }
+
+ static void Main ()
+ {
+ D d1 = new D (F<int>);
+ D d2 = new D (F);
+
+ E e1 = new E (G<int>);
+ }
+}
--- /dev/null
+using System;
+
+public class Foo<T>
+ where T : A
+{
+ public void Test (T t)
+ {
+ Console.WriteLine (t);
+ Console.WriteLine (t.GetType ());
+ t.Hello ();
+ }
+}
+
+public class A
+{
+ public void Hello ()
+ {
+ Console.WriteLine ("Hello World");
+ }
+}
+
+public class B : A
+{
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<B> foo = new Foo<B> ();
+ foo.Test (new B ());
+ }
+}
--- /dev/null
+// We create an instance of a type parameter which has the new() constraint.
+using System;
+
+public class Foo<T>
+ where T : new ()
+{
+ public T Create ()
+ {
+ return new T ();
+ }
+}
+
+class X
+{
+ public X ()
+ { }
+
+ void Hello ()
+ {
+ Console.WriteLine ("Hello World");
+ }
+
+ static void Main ()
+ {
+ Foo<X> foo = new Foo<X> ();
+ foo.Create ().Hello ();
+ }
+}
--- /dev/null
+//
+// Important test: Type parameters and boxing (26.7.3).
+//
+// This tests the constrained_ prefix opcode.
+//
+using System;
+
+public interface ICounter
+{
+ void Increment ();
+}
+
+namespace ValueTypeCounters
+{
+ public struct SimpleCounter : ICounter
+ {
+ public int Value;
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+
+ public struct PrintingCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+
+ public struct ExplicitCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ void ICounter.Increment ()
+ {
+ Value++;
+ }
+ }
+
+ public struct InterfaceCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ void ICounter.Increment ()
+ {
+ Value++;
+ }
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+}
+
+namespace ReferenceTypeCounters
+{
+ public class SimpleCounter : ICounter
+ {
+ public int Value;
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+
+ public class PrintingCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+
+ public class ExplicitCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ void ICounter.Increment ()
+ {
+ Value++;
+ }
+ }
+
+ public class InterfaceCounter : ICounter
+ {
+ public int Value;
+
+ public override string ToString ()
+ {
+ return Value.ToString ();
+ }
+
+ void ICounter.Increment ()
+ {
+ Value++;
+ }
+
+ public void Increment ()
+ {
+ Value += 2;
+ }
+ }
+}
+
+namespace Test
+{
+ using V = ValueTypeCounters;
+ using R = ReferenceTypeCounters;
+
+ public class Test<T>
+ where T : ICounter
+ {
+ public static void Foo (T x)
+ {
+ Console.WriteLine (x.ToString ());
+ x.Increment ();
+ Console.WriteLine (x.ToString ());
+ }
+ }
+
+ public class X
+ {
+ static void Main ()
+ {
+ Test<V.SimpleCounter>.Foo (new V.SimpleCounter ());
+ Test<V.PrintingCounter>.Foo (new V.PrintingCounter ());
+ Test<V.ExplicitCounter>.Foo (new V.ExplicitCounter ());
+ Test<V.InterfaceCounter>.Foo (new V.InterfaceCounter ());
+ Test<R.SimpleCounter>.Foo (new R.SimpleCounter ());
+ Test<R.PrintingCounter>.Foo (new R.PrintingCounter ());
+ Test<R.ExplicitCounter>.Foo (new R.ExplicitCounter ());
+ Test<R.InterfaceCounter>.Foo (new R.InterfaceCounter ());
+ }
+ }
+}
--- /dev/null
+//
+// Conversions involving type parameters (26.7.4).
+// This is a compilation-only test since some of the explict
+// conversions would trigger an InvalidCastException.
+//
+
+using System;
+
+interface Foo
+{
+ void Hello ();
+}
+
+class A
+{ }
+
+class B : A, Foo
+{
+ public void Hello ()
+ { }
+
+ public static implicit operator C (B b)
+ {
+ return new C ();
+ }
+}
+
+class C
+{
+ public static explicit operator B (C c)
+ {
+ return new B ();
+ }
+}
+
+class Test
+{
+ static void Simple<T> (T t)
+ {
+ object o = t;
+ t = (T) o;
+ Foo foo = (Foo) t;
+ t = (T) foo;
+ }
+
+ static void Interface<T> (T t)
+ where T : Foo
+ {
+ Foo foo = t;
+ }
+
+ static void Class<T> (T t)
+ where T : B
+ {
+ B b = t;
+ A a = t;
+ Foo foo = t;
+ t = (T) b;
+ t = (T) a;
+ t = (T) foo;
+ C c = t;
+ t = (T) c;
+ }
+
+ static void Array<T> (T[] t)
+ {
+ object o = t;
+ Array a = t;
+ t = (T []) o;
+ t = (T []) a;
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// Using constructed types in a namespace alias.
+
+namespace N1
+{
+ class A<T>
+ {
+ public class B { }
+
+ public class C<U> { }
+ }
+
+ class C { }
+}
+
+namespace N2
+{
+ using Y = N1.A<int>;
+
+ class X
+ {
+ static void Main ()
+ {
+ Y y = new Y ();
+ Y.B b = new Y.B ();
+ Y.C<long> c = new Y.C<long> ();
+ }
+ }
+}
--- /dev/null
+//-- ex-gen-logger
+//-- ex-gen-struct-pair
+//-- ex-gen-logging-pairs
+// 1.2 alpha
+
+using System;
+
+public class Log<T> {
+ private const int SIZE = 5;
+ private static int instanceCount = 0;
+ private int count = 0;
+ private T[] log = new T[SIZE];
+ public Log() { instanceCount++; }
+ public static int InstanceCount { get { return instanceCount; } }
+ public void Add(T msg) { log[count++ % SIZE] = msg; }
+ public int Count { get { return count; } }
+ public T Last {
+ get { // Return the last log entry, or null if nothing logged yet
+ return count==0 ? default(T) : log[(count-1)%SIZE];
+ }
+ set { // Update the last log entry, or create one if nothing logged yet
+ if (count==0)
+ log[count++] = value;
+ else
+ log[(count-1)%SIZE] = value;
+ }
+ }
+ public T[] All {
+ get {
+ int size = Math.Min(count, SIZE);
+ T[] res = new T[size];
+ for (int i=0; i<size; i++)
+ res[i] = log[(count-size+i) % SIZE];
+ return res;
+ }
+ }
+}
+
+class TestLog {
+ class MyTest {
+ public static void Main(String[] args) {
+ Log<String> log1 = new Log<String>();
+ log1.Add("Reboot");
+ log1.Add("Coffee");
+ Log<DateTime> log2 = new Log<DateTime>();
+ log2.Add(DateTime.Now);
+ log2.Add(DateTime.Now.AddHours(1));
+ DateTime[] dts = log2.All;
+ // Printing both logs:
+ foreach (String s in log1.All)
+ Console.Write("{0} ", s);
+ Console.WriteLine();
+ foreach (DateTime dt in dts)
+ Console.Write("{0} ", dt);
+ Console.WriteLine();
+ }
+ }
+}
--- /dev/null
+using System;
+
+interface IHello<T>
+{
+ void Print (T t);
+}
+
+interface Foo
+{
+ IHello<U> Test<U> ();
+}
+
+class Hello<T> : IHello<T>, Foo
+{
+ public void Print (T t)
+ {
+ Console.WriteLine ("Hello: {0}", t);
+ }
+
+ public IHello<U> Test<U> ()
+ {
+ return new Hello<U> ();
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Hello<int> hello = new Hello<int> ();
+ hello.Print (5);
+ hello.Test<float> ().Print (3.14F);
+
+ IHello<string> foo = hello.Test<string> ();
+ foo.Print ("World");
+ }
+}
--- /dev/null
+class Foo {
+ static void Main () {}
+}
+
+class Foo <T> {
+ static Foo <T> x;
+ static Foo <T> Blah { get { return x; } }
+}
--- /dev/null
+namespace N {
+ interface A <T> {
+ }
+}
+class X <T> : N.A <T> {
+}
+class Foo {
+ static void Main () {}
+}
--- /dev/null
+using System;
+
+interface IFoo
+{
+ MyList<U> Map<U> ();
+}
+
+class MyList<T>
+{
+ public void Hello (T t)
+ {
+ Console.WriteLine (t);
+ }
+}
+
+class Foo : IFoo
+{
+ public MyList<T> Map<T> ()
+ {
+ return new MyList<T> ();
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo foo = new Foo ();
+ MyList<int> list = foo.Map<int> ();
+ list.Hello (9);
+ }
+}
--- /dev/null
+using System;
+
+public delegate B Test<A,B> (A a);
+
+public class Foo<T>
+{
+ T t;
+
+ public Foo (T t)
+ {
+ this.t = t;
+ }
+
+ public U Method<U> (Test<T,U> test)
+ {
+ return test (t);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Test<double,int> test = new Test<double,int> (Math.Sign);
+
+ Foo<double> foo = new Foo<double> (Math.PI);
+ Console.WriteLine (foo.Method<int> (test));
+
+ string s = foo.Method<string> (delegate (double d) { return "s" + d; });
+ Console.WriteLine (s);
+ }
+}
--- /dev/null
+using System.Collections.Generic;
+
+class X
+{
+ public IEnumerable<int> Test (int a, long b)
+ {
+ while (a < b) {
+ a++;
+ yield return a;
+ }
+ }
+
+ static int Main ()
+ {
+ X x = new X ();
+ int sum = 0;
+ foreach (int i in x.Test (3, 8L))
+ sum += i;
+
+ return sum == 30 ? 0 : 1;
+ }
+}
--- /dev/null
+using System;
+
+public class Test
+{
+ public static int IndexOf (Array array, object value)
+ {
+ // This is picking the non-generic version.
+ return IndexOf (array, value, 0, array.Length);
+ }
+
+ public static int IndexOf (Array array, object value, int startIndex, int count)
+ {
+ return 2;
+ }
+
+ public static int IndexOf<T> (T[] array, T value, int startIndex, int count)
+ {
+ return 1;
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ Test test = new Test ();
+ string[] array = new string [] { "Hello" };
+
+ int result = Test.IndexOf (array, array);
+ if (result != 2)
+ return 1;
+
+ string hello = "Hello World";
+ // This is picking the generic version.
+ result = Test.IndexOf (array, hello, 1, 2);
+ if (result != 1)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+using System;
+
+public interface IHello<T>
+{ }
+
+public interface IFoo<T>
+{
+ IHello<T> GetHello ();
+}
+
+public interface IBar<T> : IFoo<T>
+{ }
+
+public class Foo<T> : IBar<T>, IFoo<T>
+{
+ public Hello GetHello ()
+ {
+ return new Hello (this);
+ }
+
+ IHello<T> IFoo<T>.GetHello ()
+ {
+ return new Hello (this);
+ }
+
+ public class Hello : IHello<T>
+ {
+ public readonly Foo<T> Foo;
+
+ public Hello (Foo<T> foo)
+ {
+ this.Foo = foo;
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+//-- ex-gen-type-parameter-in-constraint
+
+using System;
+using System.Collections.Generic;
+
+// A constraint may involve type parameters
+// A type may have multiple constraints
+
+struct ComparablePair<T,U> : IComparable<ComparablePair<T,U>>
+ where T : IComparable<T>
+ where U : IComparable<U> {
+ public readonly T Fst;
+ public readonly U Snd;
+
+ public ComparablePair(T fst, U snd) {
+ Fst = fst; Snd = snd;
+ }
+
+ // Lexicographic ordering
+ public int CompareTo(ComparablePair<T,U> that) {
+ int firstCmp = this.Fst.CompareTo(that.Fst);
+ return firstCmp != 0 ? firstCmp : this.Snd.CompareTo(that.Snd);
+ }
+
+ public bool Equals(ComparablePair<T,U> that) {
+ return this.Fst.Equals(that.Fst) && this.Snd.Equals(that.Snd);
+ }
+
+ public override String ToString() {
+ return "(" + Fst + ", " + Snd + ")";
+ }
+}
+
+// Sorting soccer world champions by country and year
+
+class MyTest {
+ static void Test ()
+ {
+ new ComparablePair<string,int>("Brazil", 2002);
+ }
+
+ public static void Main(string[] args) {
+ List<ComparablePair<string,int>> lst
+ = new List<ComparablePair<string,int>>();
+ lst.Add(new ComparablePair<String,int>("Brazil", 2002));
+ lst.Add(new ComparablePair<String,int>("Italy", 1982));
+ lst.Add(new ComparablePair<String,int>("Argentina", 1978 ));
+ lst.Add(new ComparablePair<String,int>("Argentina", 1986 ));
+ lst.Add(new ComparablePair<String,int>("Germany", 1990));
+ lst.Add(new ComparablePair<String,int>("Brazil", 1994));
+ lst.Add(new ComparablePair<String,int>("France", 1998));
+ // lst.Sort();
+ foreach (ComparablePair<String,int> pair in lst)
+ Console.WriteLine(pair);
+ }
+}
--- /dev/null
+using System;
+
+public class Foo<T>
+{
+}
+
+class X
+{
+ static void Main ()
+ {
+ Console.WriteLine (typeof (Foo<>));
+ }
+}
--- /dev/null
+class Test
+{
+ public delegate int Foo<T> (T t, T u);
+
+ public void Hello<U> (Foo<U> foo, U u)
+ { }
+}
+
+class X
+{
+ static int Add (int a, int b)
+ {
+ return a + b;
+ }
+
+ static void Main ()
+ {
+ Test test = new Test ();
+ test.Hello<int> (new Test.Foo<int> (Add), 5);
+ }
+}
--- /dev/null
+namespace Martin
+{
+ public class Foo<T>
+ { }
+}
+
+namespace Baulig
+{
+ using M = Martin;
+
+ class X
+ {
+ static void Main ()
+ {
+ M.Foo<int> foo;
+ }
+ }
+}
--- /dev/null
+public interface IFoo
+{
+ int GetHashCode ();
+}
+
+public interface IFoo<T>
+{
+ int GetHashCode ();
+}
+
+public class Test<T>
+{
+ public int Foo (IFoo<T> foo)
+ {
+ return foo.GetHashCode ();
+ }
+
+ public int Foo (IFoo foo)
+ {
+ return foo.GetHashCode ();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+namespace Martin
+{
+ public class Test<T>
+ {
+ public static int Foo ()
+ {
+ return 0;
+ }
+ }
+}
+
+class Foo<T>
+{
+ public Foo (int a)
+ { }
+
+ public Foo ()
+ : this (Martin.Test<T>.Foo ())
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+using System;
+
+class Foo<T>
+{
+ public T Test<U> (U u)
+ where U : T
+ {
+ return u;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<X> foo = new Foo<X> ();
+
+ Y y = new Y ();
+ X x = foo.Test<Y> (y);
+ }
+}
+
+class Y : X
+{
+}
--- /dev/null
+//-- ex-gen-logger
+//-- ex-gen-struct-pair
+//-- ex-gen-logging-pairs
+// 1.2 alpha
+
+using System;
+
+public class Log<T> {
+ private const int SIZE = 5;
+ private static int instanceCount = 0;
+ private int count = 0;
+ private T[] log = new T[SIZE];
+ public Log() { instanceCount++; }
+ public static int InstanceCount { get { return instanceCount; } }
+ public void Add(T msg) { log[count++ % SIZE] = msg; }
+ public int Count { get { return count; } }
+ public T Last {
+ get { // Return the last log entry, or null if nothing logged yet
+ return count==0 ? default(T) : log[(count-1)%SIZE];
+ }
+ set { // Update the last log entry, or create one if nothing logged yet
+ if (count==0)
+ log[count++] = value;
+ else
+ log[(count-1)%SIZE] = value;
+ }
+ }
+ public T[] All {
+ get {
+ int size = Math.Min(count, SIZE);
+ T[] res = new T[size];
+ for (int i=0; i<size; i++)
+ res[i] = log[(count-size+i) % SIZE];
+ return res;
+ }
+ }
+}
+
+class TestLog {
+ class MyTest {
+ public static void Main(String[] args) {
+ Log<String> log1 = new Log<String>();
+ log1.Add("Reboot");
+ log1.Add("Coffee");
+ Log<DateTime> log2 = new Log<DateTime>();
+ log2.Add(DateTime.Now);
+ log2.Add(DateTime.Now.AddHours(1));
+ DateTime[] dts = log2.All;
+ // Printing both logs:
+ foreach (String s in log1.All)
+ Console.Write("{0} ", s);
+ Console.WriteLine();
+ foreach (DateTime dt in dts)
+ Console.Write("{0} ", dt);
+ Console.WriteLine();
+ TestPairLog();
+ }
+
+ public static void TestPairLog() {
+ Log<Pair<DateTime,String>> log = new Log<Pair<DateTime,String>>();
+ log.Add(new Pair<DateTime,String>(DateTime.Now, "Tea leaves"));
+ log.Add(new Pair<DateTime,String>(DateTime.Now.AddMinutes(2), "Hot water"));
+ log.Add(new Pair<DateTime,String>(DateTime.Now.AddMinutes(7), "Ready"));
+ Pair<DateTime,String>[] allMsgs = log.All;
+ foreach (Pair<DateTime,String> p in allMsgs)
+ Console.WriteLine("At {0}: {1}", p.Fst, p.Snd);
+ }
+ }
+}
+
+public struct Pair<T,U> {
+ public readonly T Fst;
+ public readonly U Snd;
+ public Pair(T fst, U snd) {
+ this.Fst = fst;
+ this.Snd = snd;
+ }
+}
--- /dev/null
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+class MyList<T> : IEnumerable<T>
+{
+ public IEnumerator<T> GetEnumerator ()
+ {
+ yield break;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return GetEnumerator ();
+ }
+}
+
+struct Foo<T>
+{
+ public readonly T Data;
+
+ public Foo (T data)
+ {
+ this.Data = data;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ MyList<Foo<int>> list = new MyList <Foo<int>> ();
+ foreach (Foo<int> foo in list)
+ ;
+ }
+}
--- /dev/null
+using System;
+
+public struct Foo<T>
+{
+ public T Data, Data2;
+
+ public Foo (T a, T b)
+ {
+ this.Data = a;
+ this.Data2 = b;
+ }
+}
+
+public class Test<T>
+{
+ public T Data, Data2;
+
+ public Test (T a, T b)
+ {
+ this.Data = a;
+ this.Data2 = b;
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ Foo<long> foo = new Foo<long> (3, 5);
+ if (foo.Data != 3)
+ return 1;
+ if (foo.Data2 != 5)
+ return 2;
+
+ Test<long> test = new Test<long> (3, 5);
+ if (test.Data != 3)
+ return 3;
+ if (test.Data2 != 5)
+ return 4;
+
+ return 0;
+ }
+}
--- /dev/null
+public interface IExtensible<T>
+{
+ void AddAll<U> (U item)
+ where U : T;
+}
+
+public class ArrayList<T> : IExtensible<T>
+{
+ void IExtensible<T>.AddAll<U> (U item)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+struct Foo<T>
+{
+ public T Data;
+
+ public Foo (T data)
+ {
+ this.Data = data;
+ }
+}
+
+class Test<T>
+{
+ public Foo<T> GetFoo (T data)
+ {
+ return new Foo<T> (data);
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ Test<long> test = new Test<long> ();
+ Foo<long> foo = test.GetFoo (0x800);
+ //
+ // This is a very simple test, just make sure the struct
+ // is returned correctly. This was broken until recently
+ // and I just fixed it on amd64.
+ if (foo.Data != 0x800)
+ return 1;
+ return 0;
+ }
+}
+
--- /dev/null
+// Compiler options: -r:System
+using System;
+using System.Collections.Generic;
+
+public class X {
+ public static void Main(string[] args)
+ {
+ Collection<int> list = new Collection<int>();
+ list.Add (3);
+ foreach (int i in list) {
+ Console.WriteLine(i);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections;
+
+public class Test
+{
+ public static void Main ()
+ {
+ foreach (object o in new Test ())
+ Console.WriteLine (o);
+ }
+
+ public IEnumerator GetEnumerator ()
+ {
+ foreach (int i in new ArrayList ())
+ yield return i;
+ }
+}
--- /dev/null
+namespace A
+{
+ public interface IExtensible<T>
+ {
+ void AddAll<U> (U u)
+ where U : T;
+ }
+
+ public class ArrayList<T> : IExtensible<T>
+ {
+ void IExtensible<T>.AddAll<U> (U u)
+ {
+ InsertAll (u);
+ }
+
+ void InsertAll (T t)
+ { }
+ }
+}
+
+namespace B
+{
+ public interface IExtensible<S,T>
+ {
+ void AddAll<U> (U t)
+ where U : S;
+ }
+
+ public class ArrayList<X,Y> : IExtensible<Y,X>
+ {
+ public void AddAll<Z> (Z z)
+ where Z : Y
+ {
+ InsertAll (z);
+ }
+
+ void InsertAll (Y y)
+ { }
+ }
+}
+
+namespace C
+{
+ public interface IExtensible<S>
+ {
+ void AddAll<T> (T t)
+ where T : S;
+ }
+
+ public class Foo<U>
+ { }
+
+ public class ArrayList<X> : IExtensible<Foo<X>>
+ {
+ public void AddAll<Y> (Y y)
+ where Y : Foo<X>
+ {
+ InsertAll (y);
+ }
+
+ void InsertAll (Foo<X> foo)
+ { }
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public interface IFoo<X>
+{ }
+
+public class Test
+{
+ public void Hello<T> (IFoo<T> foo)
+ {
+ InsertAll (foo);
+ }
+
+ public void InsertAll<U> (IFoo<U> foo)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public class ArrayList<T>
+{
+ void AddAll<U> (U u)
+ where U : T
+ {
+ InsertAll (u);
+ }
+
+ void InsertAll (T t)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public class Queue<T>
+{
+ protected class Enumerator
+ {
+ Queue<T> queue;
+
+ public Enumerator (Queue<T> queue)
+ {
+ this.queue = queue;
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public class CollectionValueBase<T>
+{
+ public virtual T[] ToArray()
+ {
+ return null;
+ }
+}
+
+public class CollectionBase<T>: CollectionValueBase<T>
+{
+}
+
+public class SequencedBase<T>: CollectionBase<T>
+{
+}
+
+public class ArrayBase<T>: SequencedBase<T>
+{
+ public override T[] ToArray()
+ {
+ return null;
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+namespace HasherBuilder
+{
+ public class ByPrototype<S>
+ {
+ public static IHasher<S> Examine()
+ {
+ return null;
+ }
+ }
+}
+
+public interface IHasher<T>
+{
+}
+
+public class ArrayList<U>
+{
+ public IHasher<U> GetHasher ()
+ {
+ return HasherBuilder.ByPrototype<U>.Examine();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
+
--- /dev/null
+using System;
+
+public interface IFoo<S>
+{ }
+
+public class ArrayList<T>
+{
+ public virtual int InsertAll (IFoo<T> foo)
+ {
+ return 0;
+ }
+
+ public virtual int InsertAll<U> (IFoo<U> foo)
+ where U : T
+ {
+ return 1;
+ }
+
+ public virtual int AddAll (IFoo<T> foo)
+ {
+ return InsertAll (foo);
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ ArrayList<int> list = new ArrayList<int> ();
+ return list.AddAll (null);
+ }
+}
--- /dev/null
+public interface IFoo<S>
+{ }
+
+public class ArrayList<T>
+{
+ public virtual int InsertAll (IFoo<T> foo)
+ {
+ return 0;
+ }
+
+ public virtual int InsertAll<U> (IFoo<U> foo)
+ where U : T
+ {
+ return 1;
+ }
+
+ public virtual int AddAll (IFoo<T> foo)
+ {
+ return InsertAll (foo);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+namespace C5
+{
+ public class HashedArrayList<T>
+ {
+ public void Test ()
+ {
+ new HashSet <KeyValuePair<T,int>> (new KeyValuePairHasher<T,int> ());
+ }
+ }
+
+ public class HashSet<T>
+ {
+ public HashSet (IHasher<T> itemhasher)
+ { }
+ }
+
+ public interface IHasher<T>
+ {
+ }
+
+ public struct KeyValuePair<K,V>
+ {
+ }
+
+ public sealed class KeyValuePairHasher<K,V>: IHasher<KeyValuePair<K,V>>
+ {
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public struct KeyValuePair<K,V>
+{
+ public KeyValuePair (K k, V v)
+ { }
+
+ public KeyValuePair (K k)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ new KeyValuePair<int,long> ();
+ }
+}
--- /dev/null
+using System;
+
+class Test<T>
+{
+ public void Foo (T t, out int a)
+ {
+ a = 5;
+ }
+
+ public void Hello (T t)
+ {
+ int a;
+
+ Foo (t, out a);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public abstract class Foo<T>
+{
+ public virtual T InsertAll<U> (U u)
+ where U : T
+ {
+ return u;
+ }
+}
+
+public class Bar<T> : Foo<T>
+{
+ public override T InsertAll<U> (U u)
+ {
+ return u;
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public class Foo<T>
+{
+ Node node;
+
+ public Node Test<V> ()
+ {
+ return node;
+ }
+
+ public class Node
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public class Element<T>
+{
+ public readonly T Item;
+
+ public Element (T item)
+ {
+ this.Item = item;
+ }
+
+ public void GetItem (out T retval)
+ {
+ retval = Item;
+ }
+
+ public T GetItem (int a, ref T data)
+ {
+ return Item;
+ }
+
+ public void SetItem (T data)
+ { }
+}
+
+public class Foo<T>
+{
+ Element<Node> element;
+
+ public Node Test ()
+ {
+ Node node = element.Item;
+ element.GetItem (out node);
+ element.SetItem (node);
+ return element.GetItem (3, ref node);
+ }
+
+ public class Node
+ {
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public class Foo<T>
+{
+ public readonly T Item;
+
+ public Foo (T item)
+ {
+ this.Item = item;
+ }
+
+ static void maketreer (out Node rest)
+ {
+ rest = new Node ();
+ }
+
+ class Node
+ { }
+
+ public void Hello<U> ()
+ {
+ Foo<U>.Node node;
+ Foo<U>.maketreer (out node);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public class LinkedList<T>
+{
+ protected class Node
+ { }
+}
+
+public class HashedLinkedList<T> : LinkedList<T>
+{
+ Node node;
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+public interface IDirectedEnumerable<T>
+{
+ IDirectedEnumerable<T> Backwards();
+}
+
+public interface IDirectedCollectionValue<T> : IDirectedEnumerable<T>
+{
+ new IDirectedCollectionValue<T> Backwards();
+}
+
+public class GuardedCollectionValue<T> : IDirectedCollectionValue<T>
+{
+ IDirectedEnumerable<T> IDirectedEnumerable<T>.Backwards ()
+ {
+ return this;
+ }
+
+ public IDirectedCollectionValue<T> Backwards ()
+ {
+ return this;
+ }
+}
+
+public interface ISequenced<T> : IDirectedCollectionValue<T>
+{
+}
+
+public class GuardedSequenced<T>
+{
+ ISequenced<T> sequenced;
+
+ public IDirectedCollectionValue<T> Test ()
+ {
+ return sequenced.Backwards();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+class Foo<T>
+{ }
+
+class Test
+{
+ static void Hello<T> (Foo<T>[] foo, int i)
+ {
+ Foo<T> element = foo [0];
+ Console.WriteLine (element);
+ if (i > 0)
+ Hello<T> (foo, i - 1);
+ }
+
+ public static void Quicksort<U> (Foo<U>[] arr)
+ {
+ Hello<U> (arr, 1);
+ }
+
+ static void Main ()
+ {
+ Foo<int>[] foo = new Foo<int> [1];
+ foo [0] = new Foo<int> ();
+ Quicksort (foo);
+ }
+}
--- /dev/null
+public interface IFoo
+{
+ void Test<T> ();
+
+ void Test<U,V> ();
+}
+
+public class Foo : IFoo
+{
+ void IFoo.Test<X> ()
+ { }
+
+ void IFoo.Test<Y,Z> ()
+ { }
+}
+
+public interface IBar<T>
+{
+ void Test ();
+}
+
+public interface IBar<U,V>
+{
+ void Test ();
+}
+
+public class Bar<X,Y,Z> : IBar<X>, IBar<Y,Z>
+{
+ void IBar<X>.Test ()
+ { }
+
+ void IBar<Y,Z>.Test ()
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -t:library
+
+public interface IFoo
+{
+ void Test<T> ();
+
+ void Test<U,V> ();
+}
+
+public interface IBar<T>
+{
+ void Test ();
+}
+
+public interface IBar<U,V>
+{
+ void Test ();
+}
--- /dev/null
+// Compiler options: /r:gtest-098-lib.dll
+public class Foo : IFoo
+{
+ void IFoo.Test<X> ()
+ { }
+
+ void IFoo.Test<Y,Z> ()
+ { }
+}
+
+public class Bar<X,Y,Z> : IBar<X>, IBar<Y,Z>
+{
+ void IBar<X>.Test ()
+ { }
+
+ void IBar<Y,Z>.Test ()
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+// Runtime test for mono_class_setup_vtable()
+namespace C5
+{
+ public interface ICollection<T>
+ {
+ void Test<U> ();
+ }
+
+ public abstract class ArrayBase<T> : ICollection<T>
+ {
+ void ICollection<T>.Test<U> ()
+ { }
+ }
+
+ public class ArrayList<V> : ArrayBase<V>
+ {
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ C5.ArrayList<int> array = new C5.ArrayList<int> ();
+ }
+}
--- /dev/null
+using System;
+
+public class Test
+{
+ static void Main ()
+ {
+ SimpleStruct <string> s = new SimpleStruct <string> ();
+ }
+}
+
+public struct SimpleStruct <T>
+{
+ T data;
+
+ public SimpleStruct (T data)
+ {
+ this.data = data;
+ }
+}
--- /dev/null
+using System;
+
+class A<T>
+ where T: IComparable
+{
+}
+
+class B<U,V>
+ where U: IComparable
+ where V: A<U>
+{
+}
+
+class Driver
+{
+ public static void Main ()
+ {
+ A<int> a_int;
+ B<int,A<int>> b_stuff;
+ }
+}
--- /dev/null
+public interface IFoo<T>
+{ }
+
+public class Foo : IFoo<string>
+{ }
+
+public class Hello
+{
+ public void World<U> (U u, IFoo<U> foo)
+ { }
+
+ public void World<V> (IFoo<V> foo)
+ { }
+
+ public void Test (Foo foo)
+ {
+ World ("Canada", foo);
+ World (foo);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+class MainClass
+{
+ class Gen<T>
+ {
+ public void Test ()
+ { }
+ }
+
+ class Der : Gen<int>
+ {
+ }
+
+ static void Main ()
+ {
+ object o = new Der ();
+ Gen<int> b = (Gen<int>) o;
+ b.Test ();
+ }
+}
+
--- /dev/null
+namespace A
+{
+ public struct KeyValuePair<X,Y>
+ {
+ public KeyValuePair (X x, Y y)
+ { }
+ }
+
+ public interface IComparer<T>
+ {
+ int Compare (T x);
+ }
+
+ public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
+ {
+ public int Compare (KeyValuePair<K,V> a)
+ {
+ return 0;
+ }
+ }
+
+ public class TreeBag<T>
+ {
+ IComparer<T> comparer;
+
+ public TreeBag (IComparer<T> comparer)
+ {
+ this.comparer = comparer;
+ }
+
+ public int Find (ref T item)
+ {
+ return comparer.Compare (item);
+ }
+ }
+
+ public class X
+ {
+ public static void Test ()
+ {
+ KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
+ KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
+ TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer);
+ bag.Find (ref pair);
+ }
+ }
+}
+
+namespace B
+{
+ public class KeyValuePair<X,Y>
+ {
+ public KeyValuePair (X x, Y y)
+ { }
+ }
+
+ public interface IComparer<T>
+ {
+ int Compare (T x);
+ }
+
+ public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
+ {
+ public int Compare (KeyValuePair<K,V> a)
+ {
+ return 0;
+ }
+ }
+
+ public class TreeBag<T>
+ {
+ IComparer<T> comparer;
+
+ public TreeBag (IComparer<T> comparer)
+ {
+ this.comparer = comparer;
+ }
+
+ public int Find (ref T item)
+ {
+ return comparer.Compare (item);
+ }
+ }
+
+ public class X
+ {
+ public static void Test ()
+ {
+ KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
+ KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
+ TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer);
+ bag.Find (ref pair);
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ A.X.Test ();
+ B.X.Test ();
+ }
+}
--- /dev/null
+public struct KeyValuePair<X,Y>
+{
+ public KeyValuePair (X x, Y y)
+ { }
+}
+
+public interface IComparer<T>
+{
+ int Compare (T x);
+}
+
+public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
+{
+ public int Compare (KeyValuePair<K,V> a)
+ {
+ return 0;
+ }
+}
+
+public class TreeBag<T>
+{
+ IComparer<T> comparer;
+ T item;
+
+ public TreeBag (IComparer<T> comparer, T item)
+ {
+ this.comparer = comparer;
+ this.item = item;
+ }
+
+ public int Find ()
+ {
+ return comparer.Compare (item);
+ }
+}
+
+public class X
+{
+ public static void Main ()
+ {
+ KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
+ KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
+ TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer, pair);
+ bag.Find ();
+ }
+}
--- /dev/null
+using System;
+
+public delegate V Mapper<T,V> (T item);
+
+public interface ITree<T>
+{
+ void Map<V> (Mapper<T,V> mapper);
+}
+
+public class Tree<T> : ITree<T>
+{
+ T item;
+
+ public Tree (T item)
+ {
+ this.item = item;
+ }
+
+ public void Map<V> (Mapper<T,V> mapper)
+ {
+ V new_item = mapper (item);
+ }
+}
+
+class X
+{
+ private string themap (int i)
+ {
+ return String.Format ("AA {0,4} BB", i);
+ }
+
+ void Test ()
+ {
+ Tree<int> tree = new Tree<int> (3);
+ tree.Map (new Mapper<int,string> (themap));
+ }
+
+ static void Main ()
+ {
+ X x = new X ();
+ x.Test ();
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+public class Test<T>
+{
+ protected T item;
+
+ public Test (T item)
+ {
+ this.item = item;
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ yield return item;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Test<int> test = new Test<int> (3);
+ foreach (int a in test)
+ ;
+ }
+}
--- /dev/null
+using System;
+
+class X {
+ static void Main ()
+ {
+ int [] foo = null;
+ Array.Resize (ref foo, 10);
+ }
+}
--- /dev/null
+using System;
+
+public interface IList<R>
+{
+ int Map<S> (S item);
+}
+
+public class List<T> : IList<T>
+{
+ public int Map<U> (U item)
+ {
+ return 1;
+ }
+}
+
+public class SpecialList<V> : IList<V>
+{
+ public int Map<W> (W item)
+ {
+ return 2;
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ IList<int> list = new List<int> ();
+ int result = list.Map ("Hello");
+ if (result != 1)
+ return 1;
+
+ IList<int> list2 = new SpecialList<int> ();
+ int result2 = list2.Map ("World");
+ if (result2 != 2)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+using System;
+
+public struct KeyValuePair<K,V>
+{
+ public K key;
+ public V value;
+
+ public KeyValuePair(K k, V v) { key = k; value = v; }
+
+ public KeyValuePair(K k) { key = k; value = default(V); }
+}
+
+public class Collection<T>
+{
+ public readonly T Item;
+
+ public Collection (T item)
+ {
+ this.Item = item;
+ }
+
+ public void Find (ref T item)
+ {
+ item = Item;
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ KeyValuePair<int,long> p = new KeyValuePair<int,long> (3);
+ KeyValuePair<int,long> q = new KeyValuePair<int,long> (5, 9);
+
+ Collection<KeyValuePair<int,long>> c = new Collection<KeyValuePair<int,long>> (q);
+ c.Find (ref p);
+
+ if (p.key != 5)
+ return 1;
+ if (p.value != 9)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+using System;
+
+public interface IComparer<T>
+{
+ void Compare (T a);
+}
+
+class IC : IComparer<Foo<int>>
+{
+ public void Compare (Foo<int> a)
+ { }
+}
+
+public struct Foo<K>
+{
+ public K Value;
+
+ public Foo (K value)
+ {
+ Value = value;
+ }
+}
+
+public class List<T>
+{
+ public virtual void Sort (IComparer<T> c, T t)
+ {
+ Sorting.IntroSort<T> (c, t);
+ }
+}
+
+public class Sorting
+{
+ public static void IntroSort<T> (IComparer<T> c, T t)
+ {
+ new Sorter<T> (c, 4, t).InsertionSort (0);
+ }
+
+ class Sorter<T>
+ {
+ IComparer<T> c;
+ T[] a;
+
+ public Sorter (IComparer<T> c, int size, T item)
+ {
+ this.c = c;
+ a = new T [size];
+ }
+
+ internal void InsertionSort (int i)
+ {
+ T other;
+ c.Compare (other = a[i]);
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ List<Foo<int>> list = new List<Foo<int>> ();
+ Foo<int> foo = new Foo<int> (3);
+ list.Sort (new IC (), foo);
+ }
+}
--- /dev/null
+using System;
+
+public delegate V Mapper<T,V> (T item);
+
+public class List<T>
+{
+ public void Map<V> (Mapper<T,V> mapper)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ List<int> list = new List<int> ();
+ list.Map (new Mapper<int,double> (delegate (int i) { return i/10.0; }));
+ }
+}
+
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+public class NaturalComparer<T> : IComparer<T>
+ where T: IComparable<T>
+{
+ public int Compare (T a, T b)
+ {
+ return a.CompareTo (b);
+ }
+}
+
+public class X
+{
+ class Test : IComparable<Test>
+ {
+ public int CompareTo (Test that)
+ {
+ return 0;
+ }
+
+ public bool Equals (Test that)
+ {
+ return false;
+ }
+ }
+
+ static void Main ()
+ {
+ IComparer<Test> cmp = new NaturalComparer<Test> ();
+ Test a = new Test ();
+ Test b = new Test ();
+ cmp.Compare (a, b);
+ }
+}
--- /dev/null
+//-- ex-gen-class-linkedlist
+//-- ex-anonymous-method-linkedlist
+//-- ex-gen-printable
+//-- ex-gen-interface-ilist
+//-- ex-gen-linkedlist-map
+//-- ex-gen-linkedlistenumerator
+//-- ex-gen-delegate-fun
+
+// A generic LinkedList class
+
+using System;
+using System.IO; // TextWriter
+using System.Collections;
+using System.Collections.Generic; // IEnumerable<T>, IEnumerator<T>
+
+public delegate R Mapper<A,R>(A x);
+
+public interface IMyList<T> : IEnumerable<T> {
+ int Count { get; } // Number of elements
+ T this[int i] { get; set; } // Get or set element at index i
+ void Add(T item); // Add element at end
+ void Insert(int i, T item); // Insert element at index i
+ void RemoveAt(int i); // Remove element at index i
+ IMyList<U> Map<U>(Mapper<T,U> f); // Map f over all elements
+}
+
+public class LinkedList<T> : IMyList<T> {
+ protected int size; // Number of elements in the list
+ protected Node first, last; // Invariant: first==null iff last==null
+
+ protected class Node {
+ public Node prev, next;
+ public T item;
+
+ public Node(T item) {
+ this.item = item;
+ }
+
+ public Node(T item, Node prev, Node next) {
+ this.item = item; this.prev = prev; this.next = next;
+ }
+ }
+
+ public LinkedList() {
+ first = last = null;
+ size = 0;
+ }
+
+ public LinkedList(params T[] arr) : this() {
+ foreach (T x in arr)
+ Add(x);
+ }
+
+ public int Count {
+ get { return size; }
+ }
+
+ public T this[int i] {
+ get { return get(i).item; }
+ set { get(i).item = value; }
+ }
+
+ private Node get(int n) {
+ if (n < 0 || n >= size)
+ throw new IndexOutOfRangeException();
+ else if (n < size/2) { // Closer to front
+ Node node = first;
+ for (int i=0; i<n; i++)
+ node = node.next;
+ return node;
+ } else { // Closer to end
+ Node node = last;
+ for (int i=size-1; i>n; i--)
+ node = node.prev;
+ return node;
+ }
+ }
+
+ public void Add(T item) {
+ Insert(size, item);
+ }
+
+ public void Insert(int i, T item) {
+ if (i == 0) {
+ if (first == null) // and thus last == null
+ first = last = new Node(item);
+ else {
+ Node tmp = new Node(item, null, first);
+ first.prev = tmp;
+ first = tmp;
+ }
+ size++;
+ } else if (i == size) {
+ if (last == null) // and thus first = null
+ first = last = new Node(item);
+ else {
+ Node tmp = new Node(item, last, null);
+ last.next = tmp;
+ last = tmp;
+ }
+ size++;
+ } else {
+ Node node = get(i);
+ // assert node.prev != null;
+ Node newnode = new Node(item, node.prev, node);
+ node.prev.next = newnode;
+ node.prev = newnode;
+ size++;
+ }
+ }
+
+ public void RemoveAt(int i) {
+ Node node = get(i);
+ if (node.prev == null)
+ first = node.next;
+ else
+ node.prev.next = node.next;
+ if (node.next == null)
+ last = node.prev;
+ else
+ node.next.prev = node.prev;
+ size--;
+ }
+
+ public override bool Equals(Object that) {
+ if (that != null && GetType() == that.GetType()
+ && this.size == ((IMyList<T>)that).Count) {
+ Node thisnode = this.first;
+ IEnumerator<T> thatenm = ((IMyList<T>)that).GetEnumerator();
+ while (thisnode != null) {
+ if (!thatenm.MoveNext())
+ throw new ApplicationException("Impossible: LinkedList<T>.Equals");
+ // assert MoveNext() was true (because of the above size test)
+ if (!thisnode.item.Equals(thatenm.Current))
+ return false;
+ thisnode = thisnode.next;
+ }
+ // assert !MoveNext(); // because of the size test
+ return true;
+ } else
+ return false;
+ }
+
+ public override int GetHashCode() {
+ int hash = 0;
+ foreach (T x in this)
+ hash ^= x.GetHashCode();
+ return hash;
+ }
+
+ public static explicit operator LinkedList<T>(T[] arr) {
+ return new LinkedList<T>(arr);
+ }
+
+ public static LinkedList<T> operator +(LinkedList<T> xs1, LinkedList<T> xs2) {
+ LinkedList<T> res = new LinkedList<T>();
+ foreach (T x in xs1)
+ res.Add(x);
+ foreach (T x in xs2)
+ res.Add(x);
+ return res;
+ }
+
+ public IMyList<U> Map<U>(Mapper<T,U> f) {
+ LinkedList<U> res = new LinkedList<U>();
+ foreach (T x in this)
+ res.Add(f(x));
+ return res;
+ }
+
+ public IEnumerator<T> GetEnumerator() {
+ return new LinkedListEnumerator(this);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator() {
+ return new LinkedListEnumerator(this);
+ }
+
+ private class LinkedListEnumerator : IEnumerator<T> {
+ T curr; // The enumerator's current element
+ bool valid; // Is the current element valid?
+ Node next; // Node holding the next element, or null
+
+ public LinkedListEnumerator(LinkedList<T> lst) {
+ next = lst.first; valid = false;
+ }
+
+ public T Current {
+ get {
+ if (valid)
+ return curr;
+ else
+ throw new InvalidOperationException();
+ }
+ }
+
+ object IEnumerator.Current {
+ get { return Current; }
+ }
+
+ public bool MoveNext() {
+ if (next != null) {
+ curr = next.item; next = next.next; valid = true;
+ } else
+ valid = false;
+ return valid;
+ }
+
+ public void Reset() {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose() {
+ curr = default(T); next = null; valid = false;
+ }
+ }
+}
+
+class SortedList<T> : LinkedList<T> where T : IComparable<T> {
+ // Sorted insertion
+ public void Insert(T x) {
+ Node node = first;
+ while (node != null && x.CompareTo(node.item) > 0)
+ node = node.next;
+ if (node == null) // x > all elements; insert at end
+ Add(x);
+ else { // x <= node.item; insert before node
+ Node newnode = new Node(x);
+ if (node.prev == null) // insert as first element
+ first = newnode;
+ else
+ node.prev.next = newnode;
+ newnode.next = node;
+ newnode.prev = node.prev;
+ node.prev = newnode;
+ }
+ }
+}
+
+interface IPrintable {
+ void Print(TextWriter fs);
+}
+class PrintableLinkedList<T> : LinkedList<T>, IPrintable where T : IPrintable {
+ public void Print(TextWriter fs) {
+ bool firstElement = true;
+ foreach (T x in this) {
+ x.Print(fs);
+ if (firstElement)
+ firstElement = false;
+ else
+ fs.Write(", ");
+ }
+ }
+}
+
+class MyString : IComparable<MyString> {
+ private readonly String s;
+ public MyString(String s) {
+ this.s = s;
+ }
+ public int CompareTo(MyString that) {
+ return String.Compare(that.Value, s); // Reverse ordering
+ }
+ public bool Equals(MyString that) {
+ return that.Value == s;
+ }
+ public String Value {
+ get { return s; }
+ }
+}
+
+class MyTest {
+ public static void Main(String[] args) {
+ LinkedList<double> dLst = new LinkedList<double>(7.0, 9.0, 13.0, 0.0);
+ foreach (double d in dLst)
+ Console.Write("{0} ", d);
+ Console.WriteLine();
+ IMyList<int> iLst =
+ dLst.Map<int>(new Mapper<double, int>(Math.Sign));
+ foreach (int i in iLst)
+ Console.Write("{0} ", i);
+ Console.WriteLine();
+ IMyList<String> sLst =
+ dLst.Map<String>(delegate(double d) { return "s" + d; });
+ foreach (String s in sLst)
+ Console.Write("{0} ", s);
+ Console.WriteLine();
+ // Testing SortedList<MyString>
+ SortedList<MyString> sortedLst = new SortedList<MyString>();
+ sortedLst.Insert(new MyString("New York"));
+ sortedLst.Insert(new MyString("Rome"));
+ sortedLst.Insert(new MyString("Dublin"));
+ sortedLst.Insert(new MyString("Riyadh"));
+ sortedLst.Insert(new MyString("Tokyo"));
+ foreach (MyString s in sortedLst)
+ Console.Write("{0} ", s.Value);
+ Console.WriteLine();
+ }
+}
--- /dev/null
+using System;
+
+namespace Slow
+{
+ public interface ITest
+ {
+ void DoNothing<T>()
+ where T : class;
+ }
+
+ public class Test : ITest
+ {
+ public void DoNothing<T>()
+ where T : class
+ {
+ T x = null;
+ }
+ }
+
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ const int iterations = 10000;
+
+ Test test = new Test ();
+
+ DateTime start = DateTime.Now;
+ Console.Write ("Calling Test.DoNothing<Program>() on an object reference... ");
+ for (int i = 0; i < iterations; ++i)
+ {
+ test.DoNothing<Program> ();
+ }
+ DateTime end = DateTime.Now;
+ TimeSpan duration = end - start;
+ Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");
+
+ ITest testInterface = test;
+
+ start = DateTime.Now;
+ Console.Write ("Calling Test.DoNothing<Program>() on an interface reference... ");
+ for (int i = 0; i < iterations; ++i)
+ {
+ testInterface.DoNothing<Program> ();
+ }
+ end = DateTime.Now;
+ duration = end - start;
+ Console.WriteLine ("Took " + duration.TotalMilliseconds + " ms.");
+ }
+ }
+}
--- /dev/null
+using System;
+
+public interface IFoo<T>
+{ }
+
+public class Foo<T>
+{
+ public static bool Test (T x)
+ {
+ return x is IFoo<T>;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<int>.Test (3);
+ }
+}
--- /dev/null
+//-- ex-gen-class-polynomial
+
+using System;
+
+// A type implements AddMul<A,R> if one can add an A to it, giving an R:
+
+interface AddMul<A,R> {
+ R Add(A e); // Addition with A, giving R
+ R Mul(A e); // Multiplication with A, giving R
+}
+
+// Polynomials over E, Polynomial<E>:
+
+// The base type E of the polynomial must support addition,
+// multiplication and zero (via the nullary constructor). That's what
+// the type parameter constraint on E says.
+
+// In return, one can add an E or a polynomial over E to a polynomial
+// over E. Similarly, a polynomial over E can be multiplied by an E
+// or by a polynomial over E. That's what the interface clauses say.
+
+class Polynomial<E> : AddMul<E,Polynomial<E>>,
+ AddMul<Polynomial<E>,Polynomial<E>>
+ where E : AddMul<E,E>, new() {
+ // cs contains coefficients of x^0, x^1, ...; absent coefficients are zero.
+ // Invariant: cs != null && cs.Length >= 0; cs.Length==0 represents zero.
+ private readonly E[] cs;
+
+ public Polynomial() {
+ this.cs = new E[0];
+ }
+
+ public Polynomial(E[] cs) {
+ this.cs = cs;
+ }
+
+ public Polynomial<E> Add(Polynomial<E> that) {
+ int newlen = Math.Max(this.cs.Length, that.cs.Length);
+ int minlen = Math.Min(this.cs.Length, that.cs.Length);
+ E[] newcs = new E[newlen];
+ if (this.cs.Length <= that.cs.Length) {
+ for (int i=0; i<minlen; i++)
+ newcs[i] = this.cs[i].Add(that.cs[i]);
+ for (int i=minlen; i<newlen; i++)
+ newcs[i] = that.cs[i];
+ } else {
+ for (int i=0; i<minlen; i++)
+ newcs[i] = this.cs[i].Add(that.cs[i]);
+ for (int i=minlen; i<newlen; i++)
+ newcs[i] = this.cs[i];
+ }
+ return new Polynomial<E>(newcs);
+ }
+
+ public Polynomial<E> Add(E that) {
+ return this.Add(new Polynomial<E>(new E[] { that }));
+ }
+
+ public Polynomial<E> Mul(E that) {
+ E[] newcs = new E[cs.Length];
+ for (int i=0; i<cs.Length; i++)
+ newcs[i] = that.Mul(cs[i]);
+ return new Polynomial<E>(newcs);
+ }
+
+ public Polynomial<E> Mul(Polynomial<E> that) {
+ int newlen = Math.Max(1, this.cs.Length + that.cs.Length - 1);
+ E[] newcs = new E[newlen];
+ for (int i=0; i<newlen; i++) {
+ E sum = new E(); // Permitted by constraint E : new()
+ int start = Math.Max(0, i-that.cs.Length+1);
+ int stop = Math.Min(i, this.cs.Length-1);
+ for (int j=start; j<=stop; j++) {
+ // assert 0<=j && j<this.cs.Length && 0<=i-j && i-j<that.cs.Length;
+ sum = sum.Add(this.cs[j].Mul(that.cs[i-j]));
+ }
+ newcs[i] = sum;
+ }
+ return new Polynomial<E>(newcs);
+ }
+
+ public E Eval(E x) {
+ E res = new E(); // Permitted by constraint E : new()
+ for (int j=cs.Length-1; j>=0; j--)
+ res = res.Mul(x).Add(cs[j]);
+ return res;
+ }
+}
+
+struct Int : AddMul<Int,Int> {
+ private readonly int i;
+ public Int(int i) {
+ this.i = i;
+ }
+ public Int Add(Int that) {
+ return new Int(this.i + that.i);
+ }
+ public Int Mul(Int that) {
+ return new Int(this.i * that.i);
+ }
+ public override String ToString() {
+ return i.ToString();
+ }
+}
+
+class TestPolynomial {
+ public static void Main(String[] args) {
+ // The integer polynomial 2 + 5x + x^2
+ Polynomial<Int> ip =
+ new Polynomial<Int>(new Int[] { new Int(2), new Int(5), new Int(1) });
+ Console.WriteLine(ip.Eval(new Int(10))); // 152
+ Console.WriteLine(ip.Add(ip).Eval(new Int(10))); // 304 = 152 + 152
+ Console.WriteLine(ip.Mul(ip).Eval(new Int(10))); // 23104 = 152 * 152
+ }
+}
+
--- /dev/null
+// Compiler options: -unsafe
+using System;
+
+public class Tests {
+
+ public unsafe static void Main () {
+ Console.WriteLine (typeof (void).Name);
+ Console.WriteLine (typeof (void*).Name);
+ Console.WriteLine (typeof (void**).Name);
+ }
+}
--- /dev/null
+using System;
+
+public interface ISequenced<T>
+{
+ bool Equals (ISequenced<T> that);
+}
+
+public class SequencedHasher <S,W>
+ where S : ISequenced<W>
+{
+ public bool Equals (S i1, S i2)
+ {
+ return i1 == null ? i2 == null : i1.Equals (i2);
+ }
+}
+
+public class Sequenced<T> : ISequenced<T>
+{
+ public bool Equals (ISequenced<T> that)
+ {
+ return false;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Sequenced<int> s = new Sequenced<int> ();
+ SequencedHasher<Sequenced<int>,int> hasher = new SequencedHasher<Sequenced<int>,int> ();
+ hasher.Equals (s, s);
+ }
+}
--- /dev/null
+public class B<T>
+{
+ public int Add (T obj)
+ {
+ return -1;
+ }
+
+ public void AddRange (object o)
+ {
+ T obj = (T) o;
+ Add (obj);
+ }
+}
+
+public interface IA
+{
+}
+
+public class A : IA
+{
+}
+
+public class Test
+{
+ public static void Main ()
+ {
+ B<IA> aux = new B<IA> ();
+ aux.AddRange (new A ());
+ }
+}
--- /dev/null
+ class Test
+ {
+ static void Main(string[] args)
+ {
+ A<int> a = new A<int>(new A<int>.B(D), 3);
+ a.Run();
+ }
+ public static void D(int y)
+ {
+ System.Console.WriteLine("Hello " + 3);
+ }
+ }
+ class A<T>
+ {
+ public delegate void B(T t);
+
+ protected B _b;
+ protected T _value;
+
+ public A(B b, T value)
+ {
+ _b = b;
+ _value = value;
+ }
+ public void Run()
+ {
+ _b(_value);
+ }
+ }
+
--- /dev/null
+class A<T>
+{
+ public delegate void Foo ();
+ public delegate void Bar<U> ();
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+interface IFoo <T>
+{
+ T this [int index] {
+ get; set;
+ }
+}
+
+public class FooCollection <T> : IFoo <T>
+{
+ T IFoo<T>.this [int index] {
+ get {
+ return default(T);
+ }
+ set {
+ }
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ IFoo<int> foo = new FooCollection<int> ();
+ int a = foo [3];
+ Console.WriteLine (a);
+ }
+}
--- /dev/null
+using System;
+
+public interface IA<T> where T : struct {
+
+}
+
+public class B<T> : IA<T> where T:struct {
+
+}
+
+public class MainClass {
+ public static void Main () {}
+
+}
+
--- /dev/null
+using System.Collections.Generic;
+
+// comment this line to see another bug in gmcs (unrelated)
+interface IB { bool foo (); }
+
+
+class B : IB { public bool foo () { return true; } }
+
+interface Filter <T> where T : IB {
+ T Is (IB x);
+
+}
+
+struct K : IB {
+ public bool foo () { return false; }
+
+}
+
+class MyFilter : Filter <K> {
+ public K Is (IB x) { return new K(); }
+}
+
+class MyBFilter : Filter <B> {
+ public B Is (IB x) { return new B(); }
+}
+
+class M {
+
+ static List<T> foo1 <T> (Filter <T> x) where T : IB {
+ List <T> result = new List <T>();
+ T maybe = x.Is (new B());
+ if (maybe != null)
+ result.Add (maybe);
+ return result;
+ }
+
+ static void Main () {
+ MyFilter m = new MyFilter ();
+ System.Console.WriteLine (foo1 <K> (m).Count);
+ MyBFilter mb = new MyBFilter ();
+ System.Console.WriteLine (foo1 <B> (mb).Count);
+ }
+}
--- /dev/null
+public class A<T>
+{
+ public delegate void Changed (A<T> a);
+
+ protected event Changed _changed;
+
+ public void Register (Changed changed)
+ {
+ _changed += changed;
+ _changed (this);
+ }
+}
+
+public class Test
+{
+ public static void Main ()
+ {
+ A<int> a = new A<int> ();
+ a.Register (new A<int>.Changed (Del));
+ }
+
+ public static void Del (A<int> a)
+ {
+ System.Console.WriteLine ("Solved");
+ }
+}
--- /dev/null
+using System;
+using System.Reflection;
+
+namespace FLMID.Bugs.ParametersOne
+{
+ public class Class<T>
+ {
+ public void Add(T x)
+ {
+ System.Console.WriteLine("OK");
+ }
+ }
+ public class Test
+ {
+
+ public static void Main(string [] args)
+ {
+ Class<string> instance = new Class<string>();
+
+ MethodInfo _method = null;
+
+ foreach(MethodInfo method in
+typeof(Class<string>).GetMethods(BindingFlags.Instance | BindingFlags.Public))
+ {
+ if(method.Name.Equals("Add") && method.GetParameters().Length==1)
+ {
+ _method = method;
+ break;
+ }
+ }
+ _method.Invoke(instance , new object[]{"1"});
+ }
+ }
+}
--- /dev/null
+namespace B
+{
+ using C;
+
+ partial class Test <T>
+ where T : IA, IB
+ { }
+}
+
+namespace B
+{
+ partial class Test <T>
+ where T : C.IB, C.IA
+ { }
+}
+
+namespace B
+{
+ partial class Test <T>
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
+
+namespace C {
+ interface IA { }
+ interface IB { }
+}
--- /dev/null
+//-- ex-nullable-bool
+
+using System;
+
+class MyTest {
+ public static void Main(String[] args) {
+ Console.WriteLine("Note that null prints as blank or []\n");
+ bool? b1 = null, b2 = false, b3 = true;
+ bool? b4 = b1^b2, b5 = b1&b2, b6 = b1|b2; // null false null
+ Console.WriteLine("[{0}] [{1}] [{2}]", b4, b5, b6);
+ bool? b7 = b1^b3, b8 = b1&b3, b9 = b1|b3; // null null true
+ Console.WriteLine("[{0}] [{1}] [{2}]", b7, b8, b9);
+ Console.WriteLine(b1 ? "null is true" : "null is false"); // null is false
+ Console.WriteLine(!b1 ? "!null is true" : "!null is false"); // !null is false
+
+ Console.WriteLine();
+ bool?[] bvals = new bool?[] { null, false, true };
+ Console.WriteLine("{0,-6} {1,-6} {2,-6} {3,-6} {4,-6}",
+ "x", "y", "x&y", "x|y", "x^y");
+ foreach (bool? x in bvals)
+ foreach (bool? y in bvals)
+ Console.WriteLine("{0,-6} {1,-6} {2,-6} {3,-6} {4,-6}",
+ x, y, x&y, x|y, x^y);
+ Console.WriteLine();
+ Console.WriteLine("{0,-6} {1,-6}", "x", "!x");
+ foreach (bool? x in bvals)
+ Console.WriteLine("{0,-6} {1,-6}", x, !x);
+ }
+}
--- /dev/null
+//-- ex-nullable
+
+using System;
+
+class MyTest {
+ public static void Main(String[] args) {
+ Console.WriteLine("Note that null prints as blank or []\n");
+ int? i1 = 11, i2 = 22, i3 = null, i4 = i1+i2, i5 = i1+i3;
+ // Values: 11 22 null 33 null
+ Console.WriteLine("[{0}] [{1}] [{2}] [{3}] [{4}]", i1, i2, i3, i4, i5);
+ int i6 = (int)i1; // Legal
+ // int i7 = (int)i5; // Legal but fails at run-time
+ // int i8 = i1; // Illegal
+
+ int?[] iarr = { i1, i2, i3, i4, i5 };
+ i2 += i1;
+ i2 += i4;
+ Console.WriteLine("i2 = {0}", i2); // 66 = 11+22+33
+
+ int sum = 0;
+ for (int i=0; i<iarr.Length; i++)
+ sum += iarr[i] != null ? iarr[i].Value : 0;
+ // sum += iarr[i] ?? 0;
+ Console.WriteLine("sum = {0}", sum); // 66 = 11+22+33
+
+ for (int i=0; i<iarr.Length; i++)
+ if (iarr[i] > 11)
+ Console.Write("[{0}] ", iarr[i]); // 22 33
+ Console.WriteLine();
+
+ for (int i=0; i<iarr.Length; i++)
+ if (iarr[i] != i1)
+ Console.Write("[{0}] ", iarr[i]); // 22 null 33 null
+ Console.WriteLine();
+ Console.WriteLine();
+ int?[] ivals = { null, 2, 5 };
+ Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,-6} {5,-6} {6,-6} {7,-6}",
+ "x", "y", "x+y", "x-y", "x<y", "x>=y", "x==y", "x!=y");
+ Console.WriteLine();
+ foreach (int? x in ivals)
+ foreach (int? y in ivals)
+ Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,-6} {5,-6} {6,-6} {7,-6}",
+ x, y, x+y, x-y, (x<y), (x>=y), x==y, x!=y);
+ }
+}
--- /dev/null
+//-- ex-nullable-sqrt
+
+using System;
+
+class MyTest {
+ public static int? Sqrt(int? x) {
+ if (x.HasValue && x.Value >= 0)
+ return (int)(Math.Sqrt(x.Value));
+ else
+ return null;
+ }
+
+ public static void Main(String[] args) {
+ // Prints :2:::
+ Console.WriteLine(":{0}:{1}:{2}:", Sqrt(5), Sqrt(null), Sqrt(-5));
+ }
+}
--- /dev/null
+// Not used -- ex-nullable-struct
+
+// Converting a struct from S to S? creates a copy of the struct.
+// Getting the struct out of the non-null value creates another copy.
+
+using System;
+
+struct S {
+ private int x;
+ public int X {
+ get { return x; }
+ set { this.x = value; } // Cannot be used on non-variable ns.Value
+ }
+ public void Set(int x) {
+ this.x = x;
+ }
+}
+
+class MyTest {
+ public static void Main(String[] args) {
+ S s = new S();
+ s.Set(11);
+ Console.WriteLine("s.X = {0}", s.X);
+ S? ns = s;
+ Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
+ ns.Value.Set(22);
+ Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
+ s.Set(33);
+ Console.WriteLine("s.X = {0} ns.Value.X = {1}", s.X, ns.Value.X);
+ }
+}
--- /dev/null
+// sestoft@dina.kvl.dk * 2004-08
+
+using System;
+
+class MyTest {
+ public static void Main(String[] args) {
+ Foo<int?> fni1 = new Foo<int?>(null);
+ Console.WriteLine(fni1.Fmt());
+ Foo<int?> fni2 = new Foo<int?>(17);
+ Console.WriteLine(fni2.Fmt());
+ Foo<int> fi = new Foo<int>(7);
+ Console.WriteLine(fi.Fmt());
+ Foo<String> fs1 = new Foo<String>(null);
+ Console.WriteLine(fs1.Fmt());
+ Foo<String> fs2 = new Foo<String>("haha");
+ Console.WriteLine(fs2.Fmt());
+ }
+}
+
+class Foo<T> {
+ T x;
+ public Foo(T x) {
+ this.x = x;
+ }
+
+ // This shows how to deal with tests for null in a generic setting
+ // where null may mean both `null reference' and `null value of a
+ // nullable type'. Namely, the test (x == null) will always be
+ // false if the generic type parameter t is instantiated with a
+ // nullable type. Reason: the null literal will be considered a
+ // null reference and x will be boxed if a value type, and hence the
+ // comparison will be false...
+
+ public String Fmt() {
+ if (x is INullableValue && ((INullableValue)x).HasValue
+ || !(x is INullableValue) && x != null)
+ return x.ToString();
+ else
+ return "null";
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = null;
+ int b = 3;
+ long? c = a;
+ Console.WriteLine (c);
+ long? d = b;
+ byte? f = (byte?) d;
+ }
+}
--- /dev/null
+using System;
+
+namespace Martin {
+ public class A
+ {
+ public readonly long Data;
+
+ public A (long data)
+ {
+ this.Data = data;
+ }
+
+ public static explicit operator B (A a)
+ {
+ return new B ((int) a.Data);
+ }
+ }
+
+ public class B
+ {
+ public readonly int Data;
+
+ public B (int data)
+ {
+ this.Data = data;
+ }
+
+ public static implicit operator A (B b)
+ {
+ return new A (b.Data);
+ }
+ }
+
+ class X
+ {
+ static void Main ()
+ {
+ B? b = new B (5);
+ A? a = b;
+ B? c = (B?) a;
+ B? d = (Martin.B?) a;
+ }
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = 4;
+ int? b = -a;
+ Console.WriteLine (b);
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int? a = 4;
+ long b = 5;
+ long? c = a * b;
+ Console.WriteLine (c);
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ bool? a = true;
+ int? b = a ? 3 : 4;
+ Console.WriteLine (b);
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int?[] bvals = new int?[] { null, 3, 4 };
+ foreach (long? x in bvals)
+ Console.WriteLine (x);
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ int?[] bvals = new int? [] { null, 3, 4 };
+ foreach (int? x in bvals)
+ Console.WriteLine (x);
+ }
+}
--- /dev/null
+using System;
+
+public static class Assert
+{
+ public static int Errors {
+ get { return errors; }
+ }
+
+ static int errors = 0;
+
+ static void Error (string method, string text)
+ {
+ Console.WriteLine ("Assert failed: {0} ({1})", method, text);
+ errors++;
+ }
+
+ public static void IsTrue (string text, bool b)
+ {
+ if (!b)
+ Error ("IsTrue", text);
+ }
+
+ public static void IsFalse (string text, bool b)
+ {
+ if (b)
+ Error ("IsFalse", text);
+ }
+
+ public static void IsNull<T> (string text, Nullable<T> nullable)
+ {
+ if (nullable.HasValue)
+ Error ("IsNull", text);
+ }
+
+ public static void IsNotNull<T> (string text, Nullable<T> nullable)
+ {
+ if (!nullable.HasValue)
+ Error ("IsNotNull", text);
+ }
+
+ public static void IsTrue (string text, Nullable<bool> b)
+ {
+ if (!b.HasValue || !b.Value)
+ Error ("IsTrue", text);
+ }
+
+ public static void IsFalse (string text, Nullable<bool> b)
+ {
+ if (!b.HasValue || b.Value)
+ Error ("IsFalse", text);
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ bool? a = null, b = false, c = true;
+ bool? d = null, e = false, f = true;
+
+ Assert.IsNull ("a", a);
+ Assert.IsFalse ("b", b);
+ Assert.IsTrue ("c", c);
+ Assert.IsTrue ("a == d", a == d);
+ Assert.IsTrue ("b == e", b == e);
+ Assert.IsTrue ("c == f", c == f);
+
+ Assert.IsFalse ("a != d", a != d);
+ Assert.IsFalse ("a == b", a == b);
+ Assert.IsTrue ("a != b", a != b);
+
+ Assert.IsNull ("d & a", d & a);
+ Assert.IsFalse ("d & b", d & b);
+ Assert.IsNull ("d & c", d & c);
+ Assert.IsFalse ("e & a", e & a);
+ Assert.IsFalse ("e & b", e & b);
+ Assert.IsFalse ("e & c", e & c);
+ Assert.IsNull ("f & a", f & a);
+ Assert.IsFalse ("f & b", f & b);
+ Assert.IsTrue ("f & c", f & c);
+
+ Assert.IsNull ("d | a", d | a);
+ Assert.IsNull ("d | b", d | b);
+ Assert.IsTrue ("d | c", d | c);
+ Assert.IsNull ("e | a", e | a);
+ Assert.IsFalse ("e | b", e | b);
+ Assert.IsTrue ("e | c", e | c);
+ Assert.IsTrue ("f | a", f | a);
+ Assert.IsTrue ("f | b", f | b);
+ Assert.IsTrue ("f | c", f | c);
+
+ Assert.IsNull ("d && a", d && a);
+ Assert.IsFalse ("d && b", d && b);
+ Assert.IsNull ("d && c", d && c);
+ Assert.IsFalse ("e && a", e && a);
+ Assert.IsFalse ("e && b", e && b);
+ Assert.IsFalse ("e && c", e && c);
+ Assert.IsNull ("f && a", f && a);
+ Assert.IsFalse ("f && b", f && b);
+ Assert.IsTrue ("f && c", f && c);
+
+ Assert.IsNull ("d || a", d || a);
+ Assert.IsNull ("d || b", d || b);
+ Assert.IsTrue ("d || c", d || c);
+ Assert.IsNull ("e || a", e || a);
+ Assert.IsFalse ("e || b", e || b);
+ Assert.IsTrue ("e || c", e || c);
+ Assert.IsTrue ("f || a", f || a);
+ Assert.IsTrue ("f || b", f || b);
+ Assert.IsTrue ("f || c", f || c);
+
+ int? g = 3, h = null, i = 3, j = null;
+
+ Assert.IsFalse ("g == null", g == null);
+ Assert.IsTrue ("g != null", g != null);
+ Assert.IsTrue ("h == null", h == null);
+ Assert.IsFalse ("h != null", h != null);
+
+ Assert.IsTrue ("g == i", g == i);
+ Assert.IsFalse ("g != i", g != i);
+ Assert.IsFalse ("g == j", g == j);
+ Assert.IsTrue ("g != j", g != j);
+ Assert.IsFalse ("h == i", h == i);
+ Assert.IsTrue ("h != i", h != i);
+ Assert.IsTrue ("h == j", h == j);
+ Assert.IsFalse ("h != j", h != j);
+
+ Console.WriteLine ("{0} errors.", Assert.Errors);
+ return Assert.Errors;
+ }
+}
--- /dev/null
+using System;
+
+class X
+{
+ static int Test ()
+ {
+ int? a = 5;
+ int? b = a++;
+
+ if (a != 6)
+ return 1;
+ if (b != 5)
+ return 2;
+
+ int? c = ++a;
+
+ if (c != 7)
+ return 3;
+
+ b++;
+ ++b;
+
+ if (b != 7)
+ return 4;
+
+ int? d = b++ + ++a;
+
+ if (a != 8)
+ return 5;
+ if (b != 8)
+ return 6;
+ if (d != 15)
+ return 7;
+
+ return 0;
+ }
+
+ static int Main ()
+ {
+ int result = Test ();
+ if (result != 0)
+ Console.WriteLine ("ERROR: {0}", result);
+ return result;
+ }
+}
--- /dev/null
+using System;
+
+namespace Test
+{
+ public class Application
+ {
+ public static void Main()
+ {
+ string[] array = new string[10];
+
+ System.Collections.Generic.IEnumerable<string> enumer = array;
+ }
+ }
+}
--- /dev/null
+using System;
+public class Test<T>{
+ private T[,] data;
+ public Test(T[,] data){
+ this.data = data;
+ }
+}
+public class Program{
+ public static void Main(string[] args){
+ Test<double> test = new Test<double>(new double[2,2]);
+ }
+}
+
--- /dev/null
+using System;
+
+public class MyLinkedList<T> {
+ protected Node first;
+
+ protected class Node
+ {
+ public T item;
+
+ public Node (T item)
+ {
+ this.item = item;
+ }
+ }
+}
+
+class SortedList<U> : MyLinkedList<U>
+{
+ public void Insert (U x) {
+ Node node = first;
+ }
+}
+
+class X {
+ static void Main ()
+ { }
+}
--- /dev/null
+namespace A
+{
+ interface IFoo
+ {
+ void Hello (IFoo foo);
+ }
+}
+
+namespace B
+{
+ partial class Test <T> : IDoo, A.IFoo where T : A.IFoo
+ { }
+}
+
+namespace B
+{
+ using A;
+
+ partial class Test <T> : Y, IFoo where T : IFoo
+ {
+ void IFoo.Hello (IFoo foo)
+ { }
+ }
+}
+
+interface IDoo { }
+
+class Y { }
+
+class X
+{
+ static void Main ()
+ { }
+}
+
+
+
+
--- /dev/null
+using System;
+
+static class Test1 {
+ public class IOp<T> { }
+ static void Foo<S,OP>(uint v) where OP : IOp<S> { }
+};
+
+static class Test2 {
+ public class IOp<T> { }
+ static void Foo<T,OP>(uint v) where OP : IOp<T> { }
+};
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+
+static class Test1 {
+ public class IOp<T> { }
+ static void Foo<S,OP>(uint v) where OP : IOp<S> { }
+};
+
+static class Test2 {
+ public class IOp<T> { }
+ static void Foo<T,OP>(uint v) where OP : IOp<T> { }
+};
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+static class Test1 {
+ public interface IOp<T> {
+ T Func(uint v);
+ }
+ public struct Op : IOp<ushort>, IOp<uint> {
+ ushort IOp<ushort>.Func(uint v) { return (ushort )(v * 2); }
+ uint IOp<uint>.Func(uint v) { return v * 4; }
+ }
+ static void Foo<T,OP>(uint v) where T:struct where OP : IOp<T> {
+ OP op = default(OP);
+ System.Console.WriteLine( op.Func(v) );
+ }
+ static public void Main() {
+ Foo<ushort, Op>(100);
+ Foo<uint, Op>(100);
+ }
+};
--- /dev/null
+class Test<T> where T: struct{
+ public Test(){
+ T s = new T();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
+
--- /dev/null
+using System;
+
+public interface IFoo
+{
+ IFoo Hello ();
+}
+
+public interface IFoo<T> : IFoo
+{
+ new IFoo<T> Hello ();
+}
+
+public interface ICollectionValue<T>: IFoo<T>
+{
+}
+
+public interface ICollection<T>: ICollectionValue<T>
+{ }
+
+public abstract class EnumerableBase<T> : IFoo<T>
+{
+ public abstract IFoo<T> Hello();
+
+ IFoo IFoo.Hello ()
+ {
+ return Hello ();
+ }
+}
+
+public abstract class CollectionBase<T> : EnumerableBase<T>
+{
+}
+
+public class HashBag<T>: CollectionBase<T>, ICollection<T>
+{
+ public override IFoo<T> Hello ()
+ {
+ return this;
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+public interface IBase
+{
+ void DoSomeThing();
+}
+
+public interface IExtended : IBase
+{
+ void DoSomeThingElse();
+}
+
+public class MyClass<T> where T: IExtended, new()
+{
+ public MyClass()
+ {
+ T instance = new T();
+ instance.DoSomeThing();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public delegate int T<X> (X x);
+
+public class B
+{
+ public static T<X> M<X> ()
+ {
+ return delegate(X x) { return 5; };
+ }
+
+ public static T<long> N ()
+ {
+ return delegate(long x) { return 6; };
+ }
+}
+
+public class D
+{
+ public static void Main ()
+ {
+ B.M<int>();
+ B.N ();
+ }
+}
--- /dev/null
+public interface IBase
+{
+ void DoSomeThing();
+}
+
+public interface IExtended : IBase
+{
+ void DoSomeThingElse();
+}
+
+public class MyClass<T> where T: IExtended, new()
+{
+ public MyClass()
+ {
+ T instance = new T();
+ instance.DoSomeThing();
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -t:library
+
+namespace FLMID.Bugs.Marshal15
+{
+ public class A<T>
+
+ {
+
+ }
+ public abstract class B
+ {
+ protected A<bool> _aux;
+ }
+ public class X : B
+ {
+ }
+ public abstract class C
+ {
+ protected B _layout;
+ }
+}
+
--- /dev/null
+// Compiler options: -r:gtest-156-lib.dll
+
+namespace FLMID.Bugs.Marshal15
+{
+ public class D : C
+ {
+ public D()
+ {
+ _layout = new X();
+ }
+ public static void Main(string[] args)
+ {
+ System.Console.WriteLine("OK");
+ }
+ }
+}
+
--- /dev/null
+interface a <t> { void x (); }
+
+interface b <t> : a <t> {}
+
+class kv <k,v> {} // type t
+
+interface c <k,v>: b <kv<k,v>>, // b <t>
+ a <kv<k,v>> // a <t>
+{}
+
+class m <k,v> : c <k,v>,
+ b <kv<k,v>> // b <t>
+{
+ void a <kv <k,v>>.x () {} // a<t>.x ()
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+public class Moo<C>
+ where C : Moo<C>.Foo
+{
+ public class Foo
+ { }
+}
+
+public class Test : Moo<Test>.Foo
+{
+}
+
+class X
+{
+ static void Main ()
+ {
+ Moo<Test> moo = new Moo<Test> ();
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+public class App {
+ public static void Main() {
+ Dictionary<string, int> values = new Dictionary<string, int>();
+ values["one"] = 1; values["two"] = 2;
+
+ foreach (string key in values.Keys) {
+ System.Console.WriteLine("key: {0}", key);
+ }
+ }
+}
--- /dev/null
+class Fun<A,B> {}
+
+class List<T> {
+ public List<T2> Map<T2> (Fun<T,T2> x)
+ {
+ return new List<T2>();
+ }
+
+ public void foo<T2> ()
+ {
+ (new List<T2> ()).Map<T> (new Fun<T2,T> ());
+ }
+}
+
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -t:library
+public class FP {
+ public delegate U Mapping<T, U>(T obj);
+
+ public static T identity<T>(T obj) { return obj; }
+}
+
--- /dev/null
+// Compiler options: -r:gtest-161-lib.dll
+public class App {
+ public static void Main() {
+ string s = apply<int, string>(3,
+ delegate (int x) {
+ return x.ToString(); });
+ int y = apply<int, int>(3, FP.identity<int>);
+ }
+
+ static U apply<T, U>(T obj, FP.Mapping<T, U> f) {
+ return f(obj);
+ }
+}
--- /dev/null
+using System;
+using System.Reflection;
+
+public class Generic<T>
+{
+ public delegate void Delegate(Generic<T> proxy, T value);
+}
+
+class X
+{
+ static int Main ()
+ {
+ Type t = typeof (Generic<bool>);
+ MemberInfo[] mi = t.FindMembers (MemberTypes.NestedType,
+ BindingFlags.Static | BindingFlags.Public |
+ BindingFlags.DeclaredOnly, null, null);
+
+ return mi.Length - 1;
+ }
+}
--- /dev/null
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public class Foo<T>
+{
+ public IEnumerator<T> getEnumerator (int arg)
+ {
+ if (arg == 1) {
+ int foo = arg;
+ Console.WriteLine (foo);
+ }
+
+ if (arg == 2) {
+ int foo = arg;
+ Console.WriteLine (foo);
+ }
+
+ yield break;
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public delegate int Int2Int (int i);
+
+public class FunEnumerable
+{
+ int size;
+ Int2Int f;
+
+ public FunEnumerable(int size, Int2Int f)
+ {
+ this.size = size; this.f = f;
+ }
+
+ public IEnumerator<int> GetEnumerator()
+ {
+ yield return f (size);
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+using System;
+using System.Collections;
+
+class X {
+ delegate void A ();
+
+ static IEnumerable GetIt (int [] args)
+ {
+ foreach (int arg in args) {
+ Console.WriteLine ("OUT: {0}", arg);
+ A a = delegate {
+ Console.WriteLine ("arg: {0}", arg);
+ return;
+ };
+ a ();
+ yield return arg;
+ }
+ }
+
+ static int Main ()
+ {
+ int total = 0;
+ foreach (int i in GetIt (new int [] { 1, 2, 3})){
+ Console.WriteLine ("Got: " + i);
+ total += i;
+ }
+
+ if (total != 6)
+ return 1;
+
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -t:library -unsafe
+
+public unsafe struct ExternalStruct
+{
+ public fixed double double_buffer [4];
+}
--- /dev/null
+// Compiler options: -unsafe -r:gtest-166-lib.dll
+
+// Fixed buffers tests
+
+using System;
+
+public unsafe struct TestNew {
+ private fixed char test_1 [128];
+ public fixed bool test2 [4];
+
+ public fixed int T [2];
+ public fixed bool test20 [4], test21 [40];
+
+ private int foo, foo2;
+ public void SetTest () {
+ fixed (char* c = test_1) {
+ *c = 'g';
+ }
+ }
+}
+
+public class C {
+ unsafe static int Test () {
+ TestNew tt = new TestNew ();
+ tt.SetTest ();
+ tt.test2 [2] = false;
+ tt.T [1] = 5544;
+ if (tt.T [1] != 5544)
+ return 2;
+
+ ExternalStruct es = new ExternalStruct ();
+ es.double_buffer [1] = 999999.8888;
+ es.double_buffer [0] = es.double_buffer [1];
+
+ // Attributes test
+ if (Attribute.GetCustomAttribute (typeof (TestNew).GetField ("test2"), typeof (System.Runtime.CompilerServices.FixedBufferAttribute)) == null)
+ return 3;
+
+
+ if (typeof (TestNew).GetNestedTypes ().Length != 5)
+ return 5;
+
+ foreach (Type t in typeof (TestNew).GetNestedTypes ()) {
+ if (Attribute.GetCustomAttribute (t, typeof (System.Runtime.CompilerServices.CompilerGeneratedAttribute)) == null)
+ return 4;
+ }
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+
+ public static int Main () {
+ return Test ();
+ }
+}
--- /dev/null
+// Conditional attribute class test\r
+#define DEBUG
+
+using System;
+using System.Diagnostics;
+
+[Conditional("DEBUG")]
+public class TestAttribute : Attribute {}
+
+[Conditional("RELEASE")]
+public class TestNotAttribute : Attribute {}
+
+[Conditional("A")]
+[Conditional("DEBUG")]
+[Conditional("B")]
+public class TestMultiAttribute : Attribute {}
+
+// TestAttribute is included
+[Test]
+class Class1 {}
+
+// TestNotAttribute is not included
+[TestNot]
+class Class2 {}
+
+// Is included
+[TestMulti]
+class Class3 {}
+
+
+public class TestClass
+{
+ public static int Main ()
+ {
+ if (Attribute.GetCustomAttributes (typeof (Class1)).Length != 1)
+ return 1;
+
+ if (Attribute.GetCustomAttributes (typeof (Class2)).Length != 0)
+ return 1;
+
+ if (Attribute.GetCustomAttributes (typeof (Class3)).Length != 1)
+ return 1;
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}
+++ /dev/null
-interface A : B {
-}
-
-interface B : A {
-}
+++ /dev/null
-interface A {
-}
-
-interface B : A{
-}
-
-interface C : A {
-}
-
-interface D : C {
-}
+++ /dev/null
-interface A : B {
-}
+++ /dev/null
-interface A {\r
-}\r
+++ /dev/null
-interface A : B {
-}
-
-interface B : A {
-}
+++ /dev/null
-class X {
-}
-
-interface A : X {
-}
+++ /dev/null
-// cs0509.cs: base class is sealed
-// Line: 7
-struct V {
- int v;
-}
-
-class X : V {
-}
+++ /dev/null
-class A1 {
-}
-
-class A2 {
-}
-
-class B : A1, A2 {
-}
+++ /dev/null
-// cs0246.cs: can not find type `B'
-// Line: 4
-class X : D {
-}
+++ /dev/null
-interface X {
-
- // Methods
- new int IntegerMethod (int a, int b);
- new int IntegerMethod (int a, string c);
- new int StringMethod ();
- int A (string b);
-
- // Properties
- new string TheString { get; set; }
- int TheInt { get; }
- int TheInt2 { set; }
- int TheInt3 { set; get; }
-
- // Events
- new event int MyEvent;
- event string MyEvent2;
-
- // Indexers
-}
-
-
+++ /dev/null
-interface INTERFACE {
- string PROPERTY { get; set; }
-}
+++ /dev/null
-using System;
-
-interface Blah {
- string this [ int INDEX ] { get; set; }
- string Item (int index);
-}
-
-public class Foo {
-
- public static void Main ()
- {
- Console.WriteLine ("foo");
- }
-}
-
--- /dev/null
+# This file contains test files which cause any type of error.
+
+# This file supports extended syntax
+# csXXXX.cs : test case causes error
+# csXXXX.cs IGNORE : adds test to ignore list
+
+test-50.cs IGNORE
+test-308.cs
+test-322.cs
+test-377.cs
+test-386.cs
+test-387.cs
+test-anon-27.cs
+test-xml-027.cs
--- /dev/null
+# This file contains test files which cause any type of error.
+
+# This file supports extended syntax
+# csXXXX.cs : test case causes error
+# csXXXX.cs IGNORE : adds test to ignore list
+
+test-50.cs IGNORE
+test-308.cs
+test-322.cs
+test-377.cs
+test-anon-27.cs
+test-anon-29.cs
+test-xml-027.cs
+++ /dev/null
-// Compiler options: -t:module
-
-using System;
-
-public class M1 {
-
- public string Foo;
-
- public M1 (string foo) {
- this.Foo = foo;
- }
-}
-
+++ /dev/null
-// Compiler options: -t:module
-
-public class M2 {
-}
-
+++ /dev/null
-// Compiler options: -addmodule:module-1.netmodule -addmodule:module-2.netmodule
-
-using System;
-
-public class M3 : M1 {
-
- public M3 () : base ("FOO") {
- }
-
- public static int Main () {
- if (new M3 ().Foo != "FOO")
- return 1;
- /* Test that the EXPORTEDTYPES table is correctly set up */
- if (typeof (M3).Assembly.GetTypes ().Length != 3)
- return 2;
- if (typeof (M3).Assembly.GetType ("M2") == null)
- return 3;
- if (typeof (M3).Assembly.GetType ("M2") != typeof (M2))
- return 3;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-namespace Q {
- public class A {
- public static new string ToString() {
- return "Hello world!";
- }
- }
-}
+++ /dev/null
-// Compiler options: -r:mtest-1-dll.dll
-
-using System;
-using Q;
-
-public class B {
- public static int Main() {
- return (A.ToString() == "Hello world!") ? 0 : 1;
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-namespace Qt
-{
- public class QtSupport
- {
- protected static event MousePressEvent mousePressEvent;
-
- protected delegate void MousePressEvent ();
- }
-
-}
+++ /dev/null
-// Compiler options: -r:mtest-2-dll.dll
-
-namespace QtSamples
-{
- using Qt;
-
- public class QtClass: QtSupport
- {
- public QtClass()
- {
- mousePressEvent += new MousePressEvent( pressEvent );
- }
-
- public void pressEvent() { }
- }
-
-
- public class Testing
- {
- public static int Main()
- {
- QtClass q = new QtClass();
-
- return 0;
- }
- }
-}
-
-
-
+++ /dev/null
-// Compiler options: -t:library
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Foo {
- public class Bar {
- public const CallingConvention CConv = CallingConvention.Cdecl;
- }
-}
+++ /dev/null
-// Compiler options: -r:mtest-3-dll.dll
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Foo {
- public class Baz {
- [DllImport("foo.so", CallingConvention=Bar.CConv)]
- public static extern void doFoo();
-
- public static void Main ()
- { }
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-namespace Foo {
-namespace Bar {
- public class Baz {
- public class Inner {
- public static void Frob() { }
- }
- }
-}
-}
+++ /dev/null
-// Compiler options: -r:mtest-4-dll.dll
-
-using Inner = Foo.Bar.Baz.Inner;
-public class Driver {
- public static void Main () {
- Inner.Frob();
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-//
-// First file of a 2-test file to check for #69361
-//
-public class AA
-{
- internal protected virtual string Data {
- get { return null; }
- }
-}
+++ /dev/null
-// Compiler options: -r:mtest-5-dll.dll
-public class BB : AA
-{
- protected override string Data {
- get { return null; }
- }
- public static void Main () {}
-}
+++ /dev/null
-// Compiler options: -t:library
-
-using System;
-public abstract class MyTestAbstract
-{
- protected abstract string GetName();
-
- public MyTestAbstract()
- {
- }
-
- public void PrintName()
- {
- Console.WriteLine("Name=" + GetName());
- }
-}
+++ /dev/null
-// Compiler options: -r:mtest-6-dll.dll
-
-using System;
-public class MyTestExtended : MyTestAbstract
-{
- public MyTestExtended() : base()
- {
- }
-
- protected override string GetName() { return "foo"; }
- public static void Main(string[] args)
- {
- Console.WriteLine("Calling PrintName");
- MyTestExtended test = new MyTestExtended();
- test.PrintName();
- Console.WriteLine("Out of PrintName");
- }
-
-}
+++ /dev/null
-// Compiler options: -t:module
-
-namespace n1
-{
- public class Adder
- {
- public int Add(int x, int y)
- {
- return x+y;
- }
- }
-}
+++ /dev/null
-// Compiler options: -addmodule:mtest-7-dll.netmodule
-
-using n1;
-using System;
-
-public class ModTest
-{
-
- public static void Main(string[] args)
- {
- Adder a=new Adder();
- Console.WriteLine(a.Add(2,3));
- }
-
-}
+++ /dev/null
-// Compiler options: -t:library
-
-using System;
-
-namespace blah
-{
-
-public delegate void MyFunnyDelegate(object sender, params object[] message);
-
-}
+++ /dev/null
-// Compiler options: -r:mtest-8-dll.dll
-
-using System;
-using blah;
-
-namespace blah2
-{
-
-public class MyClass
-{
- public event MyFunnyDelegate DoSomething;
-
- public void DoSomethingFunny()
- {
- if (DoSomething != null) DoSomething(this, "hello there", "my friend");
- }
-
- public static void Main(string[] args)
- {
- MyClass mc = new MyClass();
- mc.DoSomethingFunny();
-
- }
-}
-
-}
+++ /dev/null
-namespace A {\r
- class X {\r
- void Y () {}\r
- }\r
-}\r
-\r
-namespace A {\r
- class XX : X {\r
- void YY () {}\r
- }\r
-}\r
+++ /dev/null
-using System.Collections;
-
-class X : Queue {
-}
+++ /dev/null
-// Compiler options: -t:library
-
-internal class Provider {
-}
+++ /dev/null
-// Compiler options: -t:library
-
-public class Provider {
- public static void Main ()
- {
- }
-}
-
-public class Foo {
- public static void Main ()
- {
- }
-}
+++ /dev/null
-// Compiler options: -r:pi.dll -r:pp.dll
-
-class Test {
- static void Main () {
- Provider p = new Provider ();
- }
-}
+++ /dev/null
-// Compiler options: -r:pp.dll -r:pi.dll
-
-class Test {
- static void Main () {
- Provider p = new Provider ();
- }
-}
+++ /dev/null
-struct A {\r
- int x;\r
-}\r
-\r
-struct B : A {\r
- int y;\r
-}\r
--- /dev/null
+using System;
+
+class t {
+
+ void a ()
+ {
+ int b;
+
+ try {
+ b = 1;
+ } catch {
+ b = 2;
+ }
+ }
+
+ void b ()
+ {
+ int a;
+
+ try {
+ a = 1;
+ } catch (Exception) {
+ a = 2;
+ }
+ }
+
+ void c ()
+ {
+ int a;
+
+ try {
+ a = 2;
+ } catch (Exception e) {
+ a = 0x3;
+ } catch {
+ a = 0x1;
+ }
+ }
+
+ void d ()
+ {
+ int a;
+
+ try {
+ a = 2;
+ } catch (Exception e) {
+ a = 0x3;
+ } catch {
+ a = 0x1;
+ } finally {
+ a = 111;
+ }
+ }
+
+ public static void Main () {}
+}
+
class T {
- static void Main ()
+ static int ret_code = 0;
+
+ static int Main ()
{
try {
T t = null;
t.Foo ();
} catch {
- System.Environment.Exit (0);
+ return ret_code;
}
-
- System.Environment.Exit (1);
+ ret_code = 1;
+ return ret_code;
}
void Foo () {
if (this == null) {
System.Console.WriteLine ("This isnt anything!?!?");
- System.Environment.Exit (1);
+ ret_code = 1;
}
}
}
\ No newline at end of file
using System.Diagnostics;
class TestClass {
+ static int return_code = 1;
[Conditional("C1"), Conditional("C2")]
public static void ConditionalMethod()
{
Console.WriteLine ("Succeeded");
- Environment.Exit (0);
+ return_code = 0;
}
static int Main()
{
ConditionalMethod ();
- return 1;
+ return return_code;
}
}
+++ /dev/null
-// Compiler options: -t:library
-
-public class C
-{
- public const decimal D = 4;
-}
+++ /dev/null
-// Compiler options: -r:test-319-dll.dll
-
-using System;
-using System.Runtime.CompilerServices;
-
-// TODO: clean up in Decimal.cs
-
-public class ConstFields
-{
- public const decimal ConstDecimal1 = 314159265358979323846m;
- public static readonly decimal ConstDecimal2 = -314159265358979323846m;
- public const decimal ConstDecimal3 = -3;
- public const decimal ConstDecimal4 = 0;
- public const decimal MaxValue = 79228162514264337593543950335m;
-
- // TODO: check this value
- static readonly Decimal MaxValueDiv10 = MaxValue / 10;
-
- static decimal DecimalValue = -90;
- const decimal SmallConstValue = .02M;
-
- static int Main ()
- {
- Type t = typeof (ConstFields);
- DecimalConstantAttribute a = (DecimalConstantAttribute) t.GetField ("ConstDecimal3").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
- if (a.Value != ConstDecimal3)
- return 1;
-
- a = (DecimalConstantAttribute) t.GetField ("ConstDecimal1").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
- if (a.Value != 314159265358979323846m)
- return 2;
-
- if (ConstDecimal1 != (-1) * ConstDecimal2)
- return 3;
-
- if (!(SmallConstValue < 1 && SmallConstValue > 0))
- return 4;
-
- // THIS IS TEST TOO
- Console.WriteLine (C.D);
- Console.WriteLine (Decimal.One);
- Console.WriteLine (DecimalValue);
- Console.WriteLine (Decimal.MaxValue);
-
- Console.WriteLine ("Success");
- return 0;
- }
-}
--- /dev/null
+// Compiler options: -t:library\r
+
+public class C
+{
+ public const decimal D = 4;
+}
--- /dev/null
+// Compiler options: -r:test-319-lib.dll
+
+using System;
+using System.Runtime.CompilerServices;
+
+// TODO: clean up in Decimal.cs
+
+public class ConstFields
+{
+ public const decimal ConstDecimal1 = 314159265358979323846m;
+ public static readonly decimal ConstDecimal2 = -314159265358979323846m;
+ public const decimal ConstDecimal3 = -3;
+ public const decimal ConstDecimal4 = 0;
+ public const decimal MaxValue = 79228162514264337593543950335m;
+
+ // TODO: check this value
+ static readonly Decimal MaxValueDiv10 = MaxValue / 10;
+
+ static decimal DecimalValue = -90;
+ const decimal SmallConstValue = .02M;
+
+ static int Main ()
+ {
+ Type t = typeof (ConstFields);
+ DecimalConstantAttribute a = (DecimalConstantAttribute) t.GetField ("ConstDecimal3").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
+ if (a.Value != ConstDecimal3)
+ return 1;
+
+ a = (DecimalConstantAttribute) t.GetField ("ConstDecimal1").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
+ if (a.Value != 314159265358979323846m)
+ return 2;
+
+ if (ConstDecimal1 != (-1) * ConstDecimal2)
+ return 3;
+
+ if (!(SmallConstValue < 1 && SmallConstValue > 0))
+ return 4;
+
+ // THIS IS TEST TOO
+ Console.WriteLine (C.D);
+ Console.WriteLine (Decimal.One);
+ Console.WriteLine (DecimalValue);
+ Console.WriteLine (Decimal.MaxValue);
+
+ Console.WriteLine ("Success");
+ return 0;
+ }
+}
-// Compiler options: -t:library
/* foo */
#define FOO
/* bar */ // bar again
#define BAR
+
+public class C
+{
+ public static void Main () {}
+}
\ No newline at end of file
+++ /dev/null
-using System;
-
-public class Three {
- public static void Main ()
- {
- One o = new One ();
- }
-}
--- /dev/null
+using System;
+
+public class Three {
+ public static void Main ()
+ {
+ One o = new One ();
+ }
+}
-// Compiler options: test-353-2.cs
+// Compiler options: test-353-p2.cs /out:test-353.exe
using System;
+++ /dev/null
-// Subordinate test file for test-361.cs
-
-using System;
-[AttributeUsage (AttributeTargets.Class)]
-class X : Attribute { }
--- /dev/null
+// Subordinate test file for test-361.cs
+
+using System;
+[AttributeUsage (AttributeTargets.Class)]
+class X : Attribute { }
-// Compiler options: test-361-2.cs
+// Compiler options: test-361-p2.cs /out:test-361.exe
[X]
class Test {
-// Compiler options: -t:library -unsafe
+// Compiler options: -unsafe
public unsafe struct Foo
{
public Foo *foo;
}
-
+\r
+public class C\r
+{\r
+ public static void Main () {}\r
+}
--- /dev/null
+// This is used to debug an ordering dependent bug. The counterpart is test-388.cs.
+//
+
+using System;
+using System.Collections;
+using System.Reflection;
+
+namespace Schemas
+{
+ public partial class basefieldtype
+ {
+ public virtual object Instantiate () { return null; }
+ }
+
+ public partial class fieldtype
+ {
+ public override object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating type '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class compoundfield
+ {
+ public override object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating compound field '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class field
+ {
+ public object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating field '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class formdata
+ {
+ public object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating form window");
+ return null;
+ }
+ }
+}
--- /dev/null
+// This is used to debug an ordering dependent bug.
+//
+// Compiler options: test-388-p2.cs /out:test-388.exe
+
+namespace Schemas {
+ [System.Xml.Serialization.XmlType("base-field-type"),
+ System.Xml.Serialization.XmlInclude(typeof(compoundfield)),
+ System.Xml.Serialization.XmlInclude(typeof(fieldtype))]
+ public partial class basefieldtype {
+
+ [System.Xml.Serialization.XmlAttribute(DataType="ID")]
+ public string id;
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string datatype;
+ }
+
+ [System.Xml.Serialization.XmlType("field-type")]
+ public partial class fieldtype: basefieldtype {}
+
+ [System.Xml.Serialization.XmlType("compound-field")]
+ public partial class compoundfield: basefieldtype {}
+
+ public partial class field {
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string id;
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string type;
+ }
+
+ [System.Xml.Serialization.XmlType("form-data")]
+ public partial class formdata {
+
+ [System.Xml.Serialization.XmlArray(ElementName="form-fields"),
+ System.Xml.Serialization.XmlArrayItem(Type=typeof(field),IsNullable=false)]
+ public field[] formfields;
+
+ [System.Xml.Serialization.XmlElement("field-type",Type=typeof(fieldtype)),
+ System.Xml.Serialization.XmlElement("compound-field",Type=typeof(compoundfield))]
+ public basefieldtype[] Items;
+ }\r
+ \r
+ public class M {\r
+ public static void Main () {}\r
+ }
+}
--- /dev/null
+// This is used to debug an ordering dependent bug.
+//
+
+namespace Schemas {
+ [System.Xml.Serialization.XmlType("base-field-type"),
+ System.Xml.Serialization.XmlInclude(typeof(compoundfield)),
+ System.Xml.Serialization.XmlInclude(typeof(fieldtype))]
+ public partial class basefieldtype {
+
+ [System.Xml.Serialization.XmlAttribute(DataType="ID")]
+ public string id;
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string datatype;
+ }
+
+ [System.Xml.Serialization.XmlType("field-type")]
+ public partial class fieldtype: basefieldtype {}
+
+ [System.Xml.Serialization.XmlType("compound-field")]
+ public partial class compoundfield: basefieldtype {}
+
+ public partial class field {
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string id;
+
+ [System.Xml.Serialization.XmlAttribute()]
+ public string type;
+ }
+
+ [System.Xml.Serialization.XmlType("form-data")]
+ public partial class formdata {
+
+ [System.Xml.Serialization.XmlArray(ElementName="form-fields"),
+ System.Xml.Serialization.XmlArrayItem(Type=typeof(field),IsNullable=false)]
+ public field[] formfields;
+
+ [System.Xml.Serialization.XmlElement("field-type",Type=typeof(fieldtype)),
+ System.Xml.Serialization.XmlElement("compound-field",Type=typeof(compoundfield))]
+ public basefieldtype[] Items;
+ }\r
+}
--- /dev/null
+// This is used to debug an ordering dependent bug.
+//
+// Compiler options: test-389-p2.cs /out:test-389.exe
+
+using System;
+using System.Collections;
+using System.Reflection;
+
+namespace Schemas
+{
+ public partial class basefieldtype
+ {
+ public virtual object Instantiate () { return null; }
+ }
+
+ public partial class fieldtype
+ {
+ public override object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating type '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class compoundfield
+ {
+ public override object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating compound field '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class field
+ {
+ public object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating field '{0}'", id);
+ return null;
+ }
+ }
+
+ public partial class formdata
+ {
+ public object Instantiate ()
+ {
+ Console.WriteLine ("Instantiating form window");
+ return null;
+ }
+ }\r
+ \r
+ public class M {\r
+ public static void Main () {}\r
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+// Test for covariance support in delegates
+//
+
+using System;
+
+ public class A {
+ protected string name;
+
+ public A (string name)
+ {
+ this.name = "A::" + name;
+ }
+
+ public A ()
+ {
+ }
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+ }
+
+ public class B : A {
+ public B (string name)
+ {
+ this.name = "B::" + name;
+ }
+
+ public B ()
+ {
+ }
+ }
+
+ public class C : B {
+ public C (string name)
+ {
+ this.name = "C::" + name;
+ }
+ }
+
+ public class Tester {
+
+ delegate A MethodHandler (string name);
+
+ static A MethodSampleA (string name)
+ {
+ return new A (name);
+ }
+
+ static B MethodSampleB (string name)
+ {
+ return new B (name);
+ }
+
+ static C MethodSampleC (string name)
+ {
+ return new C (name);
+ }
+
+ static void Main ()
+ {
+ MethodHandler a = MethodSampleA;
+ MethodHandler b = MethodSampleB;
+ MethodHandler c = MethodSampleC;
+
+ A instance1 = a ("Hello");
+ A instance2 = b ("World");
+ A instance3 = c ("!");
+
+ Console.WriteLine (instance1.Name);
+ Console.WriteLine (instance2.Name);
+ Console.WriteLine (instance3.Name);
+ }
+
+ }
+
--- /dev/null
+// Compiler options: -langversion:default
+//
+// Test for contravariance support in delegates
+//
+
+using System;
+
+ public class A {
+ protected string name;
+
+ public A (string name)
+ {
+ this.name = "A::" + name;
+ }
+
+ public A ()
+ {
+ }
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+ }
+
+ public class B : A {
+ public B (string name)
+ {
+ this.name = "B::" + name;
+ }
+
+ public B ()
+ {
+ }
+ }
+
+ public class C : B {
+ string value;
+
+ public C (string name, string value)
+ {
+ this.name = "C::" + name;
+ this.value = value;
+ }
+
+ public string Value {
+ get {
+ return value;
+ }
+ }
+ }
+
+ public class Tester {
+
+ delegate string MethodHandler (C c);
+
+ static string MethodSampleA (A value)
+ {
+ return value.Name;
+ }
+
+ static string MethodSampleB (B value)
+ {
+ return value.Name;
+ }
+
+ static string MethodSampleC (C value)
+ {
+ return value.Name + " " + value.Value;
+ }
+
+ static void Main ()
+ {
+ MethodHandler da = MethodSampleA;
+ MethodHandler db = MethodSampleB;
+ MethodHandler dc = MethodSampleC;
+
+ C a = new C ("Hello", "hello");
+ C b = new C ("World", "world");
+ C c = new C ("!", "!!!");
+
+ Console.WriteLine (da (a));
+ Console.WriteLine (db (b));
+ Console.WriteLine (dc (c));
+ }
+
+ }
+
--- /dev/null
+// Compiler options: -langversion:default
+//
+// Test for contravariance support in delegates
+//
+
+using System;
+
+ public class A {
+ protected string name;
+
+ public A (string name)
+ {
+ this.name = "A::" + name;
+ }
+
+ public A ()
+ {
+ }
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+ }
+
+ public class B : A {
+ public B (string name)
+ {
+ this.name = "B::" + name;
+ }
+
+ public B ()
+ {
+ }
+ }
+
+ public class C : B {
+ string value;
+
+ public C (string name, string value)
+ {
+ this.name = "C::" + name;
+ this.value = value;
+ }
+
+ public string Value {
+ get {
+ return value;
+ }
+ }
+ }
+
+ public class Tester {
+
+ delegate void MethodHandler (C c1, C c2, C c3);
+
+ static void MethodSample (B b, A a, C c)
+ {
+ Console.WriteLine ("b = {0}", b.Name);
+ Console.WriteLine ("a = {0}", a.Name);
+ Console.WriteLine ("c = {0}, {1}", c.Name, c.Value);
+ }
+
+ static void Main ()
+ {
+ MethodHandler mh = MethodSample;
+
+ C a = new C ("Hello", "hello");
+ C b = new C ("World", "world");
+ C c = new C ("!", "!!!");
+
+ mh (b, a, c);
+ }
+
+ }
+
--- /dev/null
+// Compiler options: -t:library
+
+public class A
+{
+ public static bool operator==(A a1, A a2)
+ {
+ return true;
+ }
+
+ public static bool operator!=(A a1, A a2)
+ {
+ return false;
+ }
+
+ public override bool Equals (object o)
+ {
+ return true;
+ }
+
+ public override int GetHashCode ()
+ {
+ return base.GetHashCode ();
+ }
+
+ public int KK () { return 1; }
+}
+
+public class B : A {
+}
+
--- /dev/null
+// Compiler options: -r:test-396-lib.dll
+
+public class MainClass
+{
+ public static int Main ()
+ {
+ A a = new A ();
+ B b = new B ();
+ bool r = (a == b);
+
+ return 0;
+ }
+}
--- /dev/null
+//
+// Access modifiers
+// We use reflection to test that the flags are the correct ones
+//
+
+using System;
+using System.Reflection;
+
+ [AttributeUsage (AttributeTargets.Class)]
+ public class TypeCheckAttribute : Attribute {
+
+ public TypeCheckAttribute ()
+ {
+ }
+ }
+
+ [AttributeUsage (AttributeTargets.Property)]
+ public class PropertyCheckAttribute : Attribute {
+
+ public PropertyCheckAttribute ()
+ {
+ }
+ }
+
+ [AttributeUsage (AttributeTargets.Method)]
+ public class AccessorCheckAttribute : Attribute {
+ MethodAttributes flags;
+
+ public AccessorCheckAttribute (MethodAttributes flags)
+ {
+ this.flags = flags;
+ }
+
+ public MethodAttributes Attributes {
+ get {
+ return flags;
+ }
+ }
+ }
+
+ public class Test {
+
+ public static int Main (string [] args)
+ {
+ Type t = typeof (A);
+
+ foreach (PropertyInfo pi in t.GetProperties ()) {
+ object [] attrs = pi.GetCustomAttributes (typeof (PropertyCheckAttribute), true);
+ if (attrs == null)
+ return 0;
+
+ MethodInfo get_accessor, set_accessor;
+ get_accessor = pi.GetGetMethod (true);
+ set_accessor = pi.GetSetMethod (true);
+
+ if (get_accessor != null)
+ CheckFlags (pi, get_accessor);
+ if (set_accessor != null)
+ CheckFlags (pi, set_accessor);
+ }
+
+ return 0;
+ }
+
+ static void CheckFlags (PropertyInfo pi, MethodInfo accessor)
+ {
+ object [] attrs = accessor.GetCustomAttributes (typeof (AccessorCheckAttribute), true);
+ if (attrs == null)
+ return;
+
+ AccessorCheckAttribute accessor_attr = (AccessorCheckAttribute) attrs [0];
+ MethodAttributes accessor_flags = accessor.Attributes;
+
+ if ((accessor_flags & accessor_attr.Attributes) == accessor_attr.Attributes)
+ Console.WriteLine ("Test for {0}.{1} PASSED", pi.Name, accessor.Name);
+ else {
+ string message = String.Format ("Test for {0}.{1} INCORRECT: MethodAttributes should be {2}, but are {3}",
+ pi.Name, accessor.Name, accessor_attr.Attributes, accessor_flags);
+ throw new Exception (message);
+ }
+ }
+
+ }
+
+ [TypeCheck]
+ public class A {
+
+ const MethodAttributes flags = MethodAttributes.HideBySig |
+ MethodAttributes.SpecialName;
+
+ [PropertyCheck]
+ public int Value1 {
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ get {
+ return 0;
+ }
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ set {
+ }
+ }
+
+ [PropertyCheck]
+ public int Value2 {
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ get {
+ return 0;
+ }
+ [AccessorCheck (flags | MethodAttributes.FamORAssem)]
+ protected internal set {
+ }
+ }
+
+ [PropertyCheck]
+ public int Value3 {
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ get {
+ return 0;
+ }
+ [AccessorCheck (flags | MethodAttributes.Family)]
+ protected set {
+ }
+ }
+
+ [PropertyCheck]
+ public int Value4 {
+ [AccessorCheck (flags | MethodAttributes.Assembly)]
+ internal get {
+ return 0;
+ }
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ set {
+ }
+ }
+
+ [PropertyCheck]
+ public int Value5 {
+ [AccessorCheck (flags | MethodAttributes.Public)]
+ get {
+ return 0;
+ }
+ [AccessorCheck (flags | MethodAttributes.Private)]
+ private set {
+ }
+ }
+
+ }
+
--- /dev/null
+//
+// Test for access modifiers
+//
+
+using System;
+
+ public class Tester {
+
+ static void Main ()
+ {
+ A a = new A (8);
+ B b = new B (9);
+
+ b.SetCount (10);
+ Console.WriteLine ("b.Count should be 9: {0}", b.Count);
+ Console.WriteLine ("b [{0}] should return {0}: {1}", 10, b [10]);
+
+ Console.WriteLine ("a.Message : {0}", a.Message);
+ b.Message = "";
+ Console.WriteLine ("b.Messasge : {0}", b.Message);
+ }
+
+ }
+
+ public class A {
+
+ protected int count;
+
+ public A (int count)
+ {
+ this.count = count;
+ }
+
+ public virtual int Count {
+ get {
+ return count;
+ }
+ protected set {
+ count = value;
+ }
+ }
+
+ public virtual int this [int index] {
+ get {
+ return index;
+ }
+ }
+
+ public virtual string Message {
+ get {
+ return "Hello Mono";
+ }
+ }
+
+ }
+
+ public class B : A {
+
+ public B (int count) : base (count)
+ {
+ }
+
+ public override int Count {
+ protected set {
+ }
+ }
+
+ public void SetCount (int value)
+ {
+ Count = value;
+ }
+
+ public override int this [int index] {
+ get {
+ return base [index];
+ }
+ }
+
+ public new string Message {
+ get {
+ return "Hello Mono (2)";
+ }
+ internal set {
+ }
+ }
+
+ }
+
--- /dev/null
+// Compiler options: -t:library\r
+
+using System;
+
+public struct Result {
+ public int res;
+ // big enough that it won't be returned in registers
+ double duh;
+ long bah;
+
+ public Result (int val) {
+ res = val;
+ bah = val;
+ duh = val;
+ }
+}
+
+public class Vararg
+{
+ public static int AddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public static int AddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public static Result VtAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public static Result VtAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public int InstAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public int InstAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return result;
+ }
+
+ public Result InstVtAddABunchOfInts (__arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+
+ public Result InstVtAddASecondBunchOfInts (int a, __arglist)
+ {
+ int result = 0;
+
+ System.ArgIterator iter = new System.ArgIterator (__arglist);
+ int argCount = iter.GetRemainingCount();
+
+ for (int i = 0; i < argCount; i++) {
+ System.TypedReference typedRef = iter.GetNextArg();
+ result += (int)TypedReference.ToObject( typedRef );
+ }
+
+ return new Result (result);
+ }
+}
--- /dev/null
+// Compiler options: -r:test-399-lib.dll
+
+using System;
+
+class TestVararg
+{
+ static int Main ()
+ {
+ int result = Vararg.AddABunchOfInts (__arglist ( 2, 3, 4 ));
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 9)
+ return 1;
+
+ result = Vararg.AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 9)
+ return 2;
+
+ Vararg s = new Vararg ();
+
+ result = s.InstAddABunchOfInts (__arglist ( 2, 3, 4, 5 ));
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 14)
+ return 3;
+
+ result = s.InstAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 ));
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 20)
+ return 4;
+
+ result = s.InstVtAddABunchOfInts (__arglist ( 2, 3, 4, 5 )).res;
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 14)
+ return 5;
+
+ result = s.InstVtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 )).res;
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 20)
+ return 6;
+
+ result = Vararg.VtAddABunchOfInts (__arglist ( 2, 3, 4, 5, 1 )).res;
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 15)
+ return 7;
+
+ result = Vararg.VtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6, 1 )).res;
+ Console.WriteLine ("Answer: {0}", result);
+
+ if (result != 21)
+ return 8;
+
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+//
+// Tests unsafe operators. address-of, dereference, member access
+//
+using System;
+
+unsafe struct Y {
+ public int a;
+ public int s;
+}
+
+unsafe class X {
+ static int TestDereference ()
+ {
+ Y y;
+ Y *z;
+ Y a;
+
+ z = &y;
+ y.a = 1;
+ y.s = 2;
+
+ a.a = z->a;
+ a.s = z->s;
+
+ if (a.a != y.a)
+ return 1;
+ if (a.s != y.s)
+ return 2;
+
+ return 0;
+ }
+
+ static int TestPtrAdd ()
+ {
+ int [] a = new int [10];
+ int i;
+
+ for (i = 0; i < 10; i++)
+ a [i] = i;
+
+ i = 0;
+ fixed (int *b = &a [0]){
+ int *p = b;
+
+ for (i = 0; i < 10; i++){
+ if (*p != a [i])
+ return 10+i;
+ p++;
+ }
+ }
+ return 0;
+ }
+
+ static int i = 1;
+ static char c = 'a';
+ static long l = 123;
+ static double d = 1.2;
+ static float f = 1.3F;
+ static short s = 4;
+
+ static int TestPtrAssign ()
+ {
+
+ fixed (int *ii = &i){
+ *ii = 10;
+ }
+
+ fixed (char *cc = &c){
+ *cc = 'b';
+ }
+
+ fixed (long *ll = &l){
+ *ll = 100;
+ }
+
+ fixed (double *dd = &d){
+ *dd = 3.0;
+ }
+
+ fixed (float *ff = &f){
+ *ff = 1.2F;
+ }
+
+ fixed (short *ss = &s){
+ *ss = 102;
+ }
+
+ if (i != 10)
+ return 100;
+ if (c != 'b')
+ return 101;
+ if (l != 100)
+ return 102;
+ if (d != 3.0)
+ return 103;
+ if (f != 1.2F)
+ return 104;
+ if (s != 102)
+ return 105;
+ return 0;
+ }
+
+ static int TestPtrArithmetic ()
+ {
+ char [] array = new char [10];
+ char *pb;
+
+ array [5] = 'j';
+ fixed (char *pa = array){
+ pb = pa + 1;
+
+
+ //
+ // This one tests pointer element access
+ //
+ if (pa [5] != 'j')
+ return 199;
+
+ Console.WriteLine ("V: " + (pb - pa));
+ if ((pb - pa) != 1)
+ return 200;
+
+ pb++;
+
+ if (pb == pa)
+ return 201;
+ if (pb < pa)
+ return 202;
+ if (pa > pb)
+ return 203;
+ if (pa >= pb)
+ return 204;
+ if (pb <= pa)
+ return 205;
+ pb = pb - 2;
+ if (pb != pa){
+ Console.WriteLine ("VV: " + (pb - pa));
+ return 206;
+ }
+ }
+
+ return 0;
+ }
+
+ static int TestMultiple ()
+ {
+ char [] array = new char [10];
+ int count = 0;
+
+ fixed (char *pa = array, pb = array){
+ count++;
+ }
+ if (count != 1)
+ return 300;
+ return 0;
+ }
+
+ static int Main ()
+ {
+ int v;
+
+ if ((v = TestDereference ()) != 0)
+ return v;
+
+ if ((v = TestPtrAdd ()) != 0)
+ return v;
+
+ if ((v = TestPtrAssign ()) != 0)
+ return v;
+
+ if ((v = TestPtrArithmetic ()) != 0)
+ return v;
+
+ if ((v = TestMultiple ()) != 0)
+ return v;
+
+ Console.WriteLine ("Ok");
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+//
+// This test excercises stackalloc, some pointer arithmetic,
+// and dereferences
+//
+using System;
+unsafe class X {
+ static int Main ()
+ {
+ char *ptr = stackalloc char [10];
+ char *cptr = ptr;
+ int i;
+ long l = 0;
+ ulong ul = 0;
+ byte b = 0;
+
+ for (i = 0; i < 10; i++)
+ ptr [i] = (char) (i + 10);
+
+ for (i = 0; i < 10; i++){
+ if (*ptr != (char) (i + 10))
+ return 200 + i;
+ ptr++;
+ }
+
+
+ // Now test index access with longs
+ if (cptr [l] != 10){
+ return 1;
+ }
+ if (cptr [ul] != 10)
+ return 2;
+ if (cptr [b] != 10)
+ return 3;
+
+ //
+ // Try to compile non-int values
+ //
+ byte* bptr = (byte*) 5;
+ ushort us = 3;
+ byte* ret = (byte*) (bptr + us);
+
+ Console.WriteLine ("Ok");
+ return 0;
+ }
+}
+
+
--- /dev/null
+// Compiler options: -unsafe
+
+using System;
+
+unsafe class X {
+ static int Main () {
+ int y = 20;
+ byte* x = (byte*)0;
+ x += (long)y;
+ // x == 20;
+ return (int)x - 20 * sizeof (byte);
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+// this tests making a pointer to a pointer
+
+using System;
+
+unsafe class Foo
+{
+ public static int Main ()
+ {
+ int a;
+ int *b;
+ int **c;
+
+ a = 42;
+ b = &a;
+ c = &b;
+
+ Console.WriteLine ("*c == b : {0}", *c == b);
+ Console.WriteLine ("**c == a : {0}", **c == a);
+
+ if (*c == b && **c == a)
+ {
+ Console.WriteLine ("Test passed");
+ return 0;
+ }
+ else
+ {
+ Console.WriteLine ("Test failed");
+ return 1;
+ }
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+unsafe class X {
+ static int v;
+ static int v_calls;
+
+ static int* get_v ()
+ {
+ v_calls++;
+ fixed (int* ptr = &v)
+ {
+ return ptr;
+ }
+ }
+
+ static int Main ()
+ {
+ if ((*get_v ())++ != 0)
+ return 1;
+ if (v != 1)
+ return 2;
+ if (v_calls != 1)
+ return 3;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+using System;
+
+namespace testapp{
+ public unsafe class LibTestAPI{
+
+ struct LibTestStruct{
+ void* pData;
+ void* pTest1;
+ }
+
+ LibTestStruct* the_struct;
+
+ public void Create(){
+ IntPtr MyPtr = new IntPtr(0); // Usually created elsewhere
+ the_struct = (LibTestStruct *) 0; // error CS1002
+ }
+ }
+
+ class TestApp{
+ static void Main(string[] args){
+ LibTestAPI myapi = new LibTestAPI();
+ myapi.Create();
+ }
+ }
+}
+
--- /dev/null
+// Compiler options: -unsafe
+
+//
+// This tests excercises the compound assignment when the left side
+// is an dereference operator.
+//
+using System;
+namespace TestCase {
+ public unsafe class Test {
+ static int Main(string[] args) {
+ uint[] uArr = {0, 200};
+ uint[] uArr2 = {0, 200};
+
+ fixed (uint* u = uArr, u2 = uArr2) {
+ if (DoOp (u) != 100)
+ return 1;
+
+ if (uArr [0] != 100)
+ return 2;
+
+ if (uArr [1] != 200)
+ return 3;
+
+ if (DoOp2 (u2) != 100)
+ return 4;
+
+ if (uArr2 [0] != 100)
+ return 5;
+
+ if (uArr2 [1] != 200)
+ return 6;
+ }
+
+ return 0;
+ }
+
+ private static uint DoOp (uint *u) {
+ return *(u) += 100;
+ }
+
+ private static uint DoOp2 (uint *u) {
+ *(u) += 100;
+ return *u;
+ }
+
+ }
+}
+
--- /dev/null
+// Compiler options: -unsafe
+
+struct Obsolete {
+ int a;
+}
+struct A {
+ int a, b;
+}
+
+class MainClass {
+ unsafe public static void Main ()
+ {
+ System.Console.WriteLine (sizeof (Obsolete));
+ }
+}
+
+
--- /dev/null
+// Compiler options: -unsafe
+
+unsafe class T {
+ static int Main () {
+ int len = 10;
+ int* x = stackalloc int [len];
+ return x [0];
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+
+//
+// Test for http://bugzilla.ximian.com/show_bug.cgi?id=62263
+//
+// We need to make sure that pointer arth uses the size of X
+// not the size of X*
+//
+
+using System;
+unsafe struct X {
+ int x, y, z;
+
+ static int Main ()
+ {
+ X* foo = null;
+
+ if ((int) (foo + 1) != sizeof (X))
+ return 1;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+namespace Q {
+ public class A {
+ public static new string ToString() {
+ return "Hello world!";
+ }
+ }
+}
--- /dev/null
+// Compiler options: -r:test-410-lib.dll
+
+using System;
+using Q;
+
+public class B {
+ public static int Main() {
+ return (A.ToString() == "Hello world!") ? 0 : 1;
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+namespace Qt
+{
+ public class QtSupport
+ {
+ protected static event MousePressEvent mousePressEvent;
+
+ protected delegate void MousePressEvent ();
+ }
+
+}
--- /dev/null
+// Compiler options: -r:test-411-lib.dll
+
+namespace QtSamples
+{
+ using Qt;
+
+ public class QtClass: QtSupport
+ {
+ public QtClass()
+ {
+ mousePressEvent += new MousePressEvent( pressEvent );
+ }
+
+ public void pressEvent() { }
+ }
+
+
+ public class Testing
+ {
+ public static int Main()
+ {
+ QtClass q = new QtClass();
+
+ return 0;
+ }
+ }
+}
+
+
+
--- /dev/null
+// Compiler options: -t:library
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Foo {
+ public class Bar {
+ public const CallingConvention CConv = CallingConvention.Cdecl;
+ }
+}
--- /dev/null
+// Compiler options: -r:test-412-lib.dll
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Foo {
+ public class Baz {
+ [DllImport("foo.so", CallingConvention=Bar.CConv)]
+ public static extern void doFoo();
+
+ public static void Main ()
+ { }
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+namespace Foo {
+namespace Bar {
+ public class Baz {
+ public class Inner {
+ public static void Frob() { }
+ }
+ }
+}
+}
--- /dev/null
+// Compiler options: -r:test-413-lib.dll
+
+using Inner = Foo.Bar.Baz.Inner;
+public class Driver {
+ public static void Main () {
+ Inner.Frob();
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+//
+// First file of a 2-test file to check for #69361
+//
+public class AA
+{
+ internal protected virtual string Data {
+ get { return null; }
+ }
+}
--- /dev/null
+// Compiler options: -r:test-414-lib.dll
+public class BB : AA
+{
+ protected override string Data {
+ get { return null; }
+ }
+ public static void Main () {}
+}
--- /dev/null
+// Compiler options: -t:library
+
+using System;
+public abstract class MyTestAbstract
+{
+ protected abstract string GetName();
+
+ public MyTestAbstract()
+ {
+ }
+
+ public void PrintName()
+ {
+ Console.WriteLine("Name=" + GetName());
+ }
+}
--- /dev/null
+// Compiler options: -r:test-415-lib.dll
+
+using System;
+public class MyTestExtended : MyTestAbstract
+{
+ public MyTestExtended() : base()
+ {
+ }
+
+ protected override string GetName() { return "foo"; }
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("Calling PrintName");
+ MyTestExtended test = new MyTestExtended();
+ test.PrintName();
+ Console.WriteLine("Out of PrintName");
+ }
+
+}
--- /dev/null
+// Compiler options: -t:module\r
+\r
+namespace n1\r
+{\r
+ public class Adder\r
+ {\r
+ public int Add(int x, int y)\r
+ {\r
+ return x+y;\r
+ }\r
+ }\r
+}\r
--- /dev/null
+// Compiler options: -addmodule:test-416-mod.netmodule
+
+using n1;
+using System;
+
+public class ModTest
+{
+
+ public static void Main(string[] args)
+ {
+ Adder a=new Adder();
+ Console.WriteLine(a.Add(2,3));
+ }
+
+}
--- /dev/null
+// Compiler options: -t:library
+
+using System;
+
+namespace blah
+{
+
+public delegate void MyFunnyDelegate(object sender, params object[] message);
+
+}
--- /dev/null
+// Compiler options: -r:test-417-lib.dll
+
+using System;
+using blah;
+
+namespace blah2
+{
+
+public class MyClass
+{
+ public event MyFunnyDelegate DoSomething;
+
+ public void DoSomethingFunny()
+ {
+ if (DoSomething != null) DoSomething(this, "hello there", "my friend");
+ }
+
+ public static void Main(string[] args)
+ {
+ MyClass mc = new MyClass();
+ mc.DoSomethingFunny();
+
+ }
+}
+
+}
--- /dev/null
+// Compiler options: -t:module
+
+using System;
+
+public class M1 {
+
+ public string Foo;
+
+ public M1 (string foo) {
+ this.Foo = foo;
+ }
+}
+
--- /dev/null
+// Compiler options: -t:module
+
+public class M2 {
+}
+
--- /dev/null
+// Compiler options: -addmodule:test-418-2-mod.netmodule -addmodule:test-418-3-mod.netmodule
+
+using System;
+
+public class M3 : M1 {
+
+ public M3 () : base ("FOO") {
+ }
+
+ public static int Main () {
+ if (new M3 ().Foo != "FOO")
+ return 1;
+ /* Test that the EXPORTEDTYPES table is correctly set up */
+ if (typeof (M3).Assembly.GetTypes ().Length != 3)
+ return 2;
+ if (typeof (M3).Assembly.GetType ("M2") == null)
+ return 3;
+ if (typeof (M3).Assembly.GetType ("M2") != typeof (M2))
+ return 3;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -t:library
+
+internal class Provider {
+}
--- /dev/null
+// Compiler options: -t:library
+
+public class Provider {
+ public static void Main ()
+ {
+ }
+}
+
+public class Foo {
+ public static void Main ()
+ {
+ }
+}
--- /dev/null
+// Compiler options: -r:test-419-2-lib.dll -r:test-419-3-lib.dll
+
+class Test {
+ static void Main () {
+ Provider p = new Provider ();
+ }
+}
--- /dev/null
+// Compiler options: -r:test-419-3-lib.dll -r:test-419-2-lib.dll
+
+class Test {
+ static void Main () {
+ Provider p = new Provider ();
+ }
+}
--- /dev/null
+delegate void S ();
+
+class X {
+
+ //
+ // DO NOT ADD ANYTHING ELSE TO THIS TEST
+ //
+ static int Main ()
+ {
+ int a;
+
+ S b = delegate {
+ a = 2;
+ };
+
+ return 0;
+ }
+}
--- /dev/null
+//
+// This test checks various uses of captured local variables
+//
+using System;
+
+delegate void S ();
+
+class X {
+ static int Main ()
+ {
+ int a = 1;
+ Console.WriteLine ("A is = " + a);
+ int c = a;
+ Console.WriteLine (c);
+ if (a != 1){
+ return 1;
+ }
+
+ S b = delegate {
+ if (a != 1)
+ Environment.Exit (1);
+ Console.WriteLine ("in Delegate");
+ a = 2;
+ if (a != 2)
+ Environment.Exit (2);
+ Console.WriteLine ("Inside = " + a);
+ a = 3;
+ Console.WriteLine ("After = " + a);
+ };
+ if (a != 1)
+ return 3;
+ b ();
+ if (a != 3)
+ return 4;
+ Console.WriteLine ("Back, got " + a);
+ Console.WriteLine ("Test is ok");
+ return 0;
+ }
+}
--- /dev/null
+//
+// Simple variable capturing
+//
+using System;
+
+delegate void S ();
+
+class X {
+ static void Main ()
+ {
+ int a = 1;
+ S b = delegate {
+ a = 2;
+ };
+ b ();
+ Console.WriteLine ("Back, got " + a);
+ }
+}
--- /dev/null
+//
+// Capturing test.
+//
+using System;
+
+delegate void S ();
+
+class X {
+ static void Main ()
+ {
+ int a = 1;
+ S b = delegate {
+ float f = 1;
+ Console.WriteLine (a);
+ if (f == 2)
+ return;
+ };
+ b ();
+ Console.WriteLine ("Back, got " + a);
+ }
+}
--- /dev/null
+//
+// Tests capturing of double nested variables
+//
+using System;
+delegate void S ();
+
+class X {
+ static int Main ()
+ {
+ int i;
+ S b = null;
+
+ for (i = 0; i < 10; i++){
+ int j = 0;
+ b = delegate {
+ Console.WriteLine ("i={0} j={1}", i, j);
+ i = i + 1;
+ j = j + 1;
+ };
+ }
+ Console.WriteLine ("i = {0}", i);
+ b ();
+ Console.WriteLine ("i = {0}", i);
+ if (!t (i, 11))
+ return 1;
+ b ();
+ if (!t (i, 12))
+ return 2;
+ Console.WriteLine ("i = {0}", i);
+ Console.WriteLine ("Test is OK");
+ return 0;
+ }
+
+ static bool t (int a, int b)
+ {
+ return a == b;
+ }
+}
--- /dev/null
+//
+// Tests capturing of variables
+//
+using System;
+
+delegate void S ();
+
+class X {
+ static int Main ()
+ {
+ int a = 1;
+ if (a != 1)
+ return 1;
+
+ Console.WriteLine ("A is = " + a);
+ S b= delegate {
+ Console.WriteLine ("on delegate");
+ a = 2;
+ };
+ if (a != 1)
+ return 2;
+ b();
+ if (a != 2)
+ return 3;
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}
+
--- /dev/null
+//
+// Tests havign more than one anonymous method that captures the same variable
+//
+using System;
+
+delegate void D ();
+
+class X {
+ static int Main ()
+ {
+ int a = 0;
+ D d1 = delegate {
+ Console.WriteLine ("First");
+ a = 1;
+ };
+
+ D d2 = delegate {
+ Console.WriteLine ("Second");
+ a = 2;
+ };
+ if (!t (a, 0))
+ return 1;
+ d1 ();
+ if (!t (a, 1))
+ return 2;
+ d2 ();
+ if (!t (a, 2))
+ return 3;
+ Console.WriteLine ("Test passes OK");
+ return 0;
+ }
+
+ static bool t (int a, int b)
+ {
+ return a == b;
+ }
+}
--- /dev/null
+//
+// Tests assignment of a captured variable to another
+// Do not add anything else to this test.
+//
+delegate void S ();
+
+class X {
+
+ //
+ // DO NOT ADD ANYTHING ELSE TO THIS TEST
+ //
+ static int Main ()
+ {
+ int a = 2;
+ int b = 1;
+ S d = delegate {
+ a = b;
+ };
+
+ return 0;
+ }
+}
--- /dev/null
+//
+// Tests unary mutator operators on captured variables
+//
+using System;
+
+class X {
+ delegate void D ();
+
+ static int gt, gj;
+
+ static int Main ()
+ {
+ int times = 0;
+
+ D d = delegate {
+ int t = times++;
+ int j = ++times;
+
+ gt = t;
+ gj = j;
+ };
+ d ();
+
+ if (gt != 0)
+ return 1;
+ if (gj != 2)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+//
+// This test exercises the access to a field instance from an instance
+// method that has an anonymous method.
+//
+using System;
+
+class S {
+ delegate void T ();
+
+ T t;
+
+ int f;
+
+ public void Test ()
+ {
+ // The loop just forces the creation of a helper class, so
+ // that the anonymous method is not placed side-by-side this
+ // method.
+ int a = 1;
+ for (int i = a; i < 10; i++){
+ int j = i;
+ t = delegate {
+ Console.WriteLine ("Before: {0} {1} {2}", f, i, j);
+ f = i;
+ };
+ }
+ }
+
+ static int Main ()
+ {
+ S s = new S ();
+ s.Test ();
+ s.t ();
+ if (s.f == 10)
+ return 0;
+ Console.WriteLine ("Failed:" + s.f);
+ return 1;
+ }
+}
+
+
--- /dev/null
+//
+// Parameter and return value compilation tests for anonymous methods
+//
+delegate void D (int x);
+delegate void E (out int x);
+
+class X {
+ static int Main ()
+ {
+ // This should create an AnonymousMethod with the implicit argument
+ D d1 = delegate {};
+ D d2 = delegate (int a) {};
+
+ return 0;
+ }
+}
--- /dev/null
+using System;
+using System.Collections;
+
+delegate bool predicate (object a);
+
+class X {
+
+ static int Main ()
+ {
+ ArrayList a = new ArrayList ();
+ for (int i = 0; i < 10; i++)
+ a.Add (i);
+
+ ArrayList even = Find (delegate (object arg) {
+ return ((((int) arg) % 2) == 0);
+ }, a);
+
+ Console.WriteLine ("Even numbers");
+ foreach (object r in even){
+ Console.WriteLine (r);
+ }
+ if (even.Count != 5)
+ return 1;
+ if (((int)even [0]) != 0 ||
+ ((int)even [1]) != 2 ||
+ ((int)even [2]) != 4 ||
+ ((int)even [3]) != 6 ||
+ ((int)even [4]) != 8)
+ return 2;
+
+ return 0;
+ }
+
+ static ArrayList Find (predicate p, ArrayList source)
+ {
+ ArrayList result = new ArrayList ();
+
+ foreach (object a in source){
+ if (p (a))
+ result.Add (a);
+ }
+
+ return result;
+ }
+}
--- /dev/null
+using System;
+
+delegate void D ();
+
+class X {
+ static void Main ()
+ {
+ X x = new X (1);
+ X y = new X (100);
+ D a = x.T ();
+ D b = y.T ();
+
+ a ();
+ b ();
+ }
+
+ X (int start)
+ {
+ ins = start;
+ }
+
+ int ins;
+
+ D T ()
+ {
+ D d = delegate () {
+ Console.WriteLine ("My state is: " + CALL ());
+ };
+
+ return d;
+ }
+ string CALL ()
+ {
+ return "GOOD";
+ }
+
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+//
+// Anonymous method group conversions
+//
+
+class X {
+ delegate void T ();
+ static event T Click;
+
+ static void Method ()
+ {
+ }
+
+ static void Main ()
+ {
+ T t;
+
+ // Method group assignment
+ t = Method;
+
+ Click += Method;
+ }
+}
--- /dev/null
+public class Foo {
+ delegate Inner foo_fn(string s);
+ public static void Main()
+ {
+ foo_fn f = delegate (string s) {
+ return new Inner(s + s);
+ };
+ f ("Test");
+ }
+
+ class Inner
+ {
+ public Inner (string s)
+ { }
+ }
+}
--- /dev/null
+//
+// Instance access.
+//
+using System;
+
+delegate void D ();
+
+class X {
+ static void Main ()
+ {
+ X x = new X (1);
+ X y = new X (100);
+ D a = x.T ();
+ D b = y.T ();
+
+ a ();
+ b ();
+ }
+
+ X (int start)
+ {
+ ins = start;
+ }
+
+ int ins;
+
+ D T ()
+ {
+ D d = delegate () {
+ Console.WriteLine ("My state is: " + ins);
+ };
+
+ return d;
+ }
+}
--- /dev/null
+//
+// Tests the syntax for delegates and events
+//
+using System;
+
+delegate void ClickEvent ();
+
+class Button {
+ public event ClickEvent Clicked;
+
+ public void DoClick ()
+ {
+ Clicked ();
+ }
+
+}
+
+class X {
+ static bool called = false;
+
+ static int Main ()
+ {
+ Button b = new Button ();
+
+ b.Clicked += delegate {
+ Console.WriteLine ("This worked!");
+ called = true;
+ };
+
+ b.DoClick ();
+
+ if (called)
+ return 0;
+ else
+ return 1;
+ }
+
+}
--- /dev/null
+using System;
+
+delegate void A ();
+
+class DelegateTest {
+ static void Main (string[] argv)
+ {
+ Console.WriteLine ("Test");
+
+ foreach (string arg in argv) {
+ Console.WriteLine ("OUT: {0}", arg);
+ A a = delegate {
+ Console.WriteLine ("arg: {0}", arg);
+ };
+ a ();
+ }
+ }
+}
+
--- /dev/null
+//
+// Tests capturing of double nested variables
+//
+using System;
+
+delegate void S ();
+
+class X {
+ static int Main ()
+ {
+ int i;
+ int a = 0;
+ S b = null;
+
+ for (i = 0; i < 10; i++){
+ int j = 0;
+ b = delegate {
+ Console.WriteLine ("i={0} j={1}", i, j);
+ i = i + 1;
+ j = j + 1;
+ a = j;
+ };
+ }
+ b ();
+ Console.WriteLine ("i = {0}", i);
+ if (!t (i, 11))
+ return 1;
+ b ();
+ if (!t (i, 12))
+ return 2;
+ Console.WriteLine ("i = {0}", i);
+ Console.WriteLine ("a = {0}", a);
+ if (!t (a, 2))
+ return 3;
+
+ return 0;
+ }
+
+ static bool t (int a, int b)
+ {
+ return a == b;
+ }
+}
--- /dev/null
+//
+// Nested anonymous methods tests and capturing of different variables.
+//
+using System;
+
+delegate void D ();
+
+class X {
+ static D GlobalStoreDelegate;
+
+ static void Main ()
+ {
+ D d = MainHost ();
+
+ d ();
+ GlobalStoreDelegate ();
+ GlobalStoreDelegate ();
+ }
+
+ static D MainHost ()
+ {
+ int toplevel_local = 0;
+
+ D d = delegate () {
+ int anonymous_local = 1;
+
+ GlobalStoreDelegate = delegate {
+ Console.WriteLine ("var1: {0} var2: {1}", toplevel_local, anonymous_local);
+ anonymous_local = anonymous_local + 1;
+ };
+
+ toplevel_local = toplevel_local + 1;
+ };
+
+ return d;
+ }
+}
--- /dev/null
+//
+// Nested anonymous methods and capturing of variables test
+//
+using System;
+
+delegate void D ();
+
+class X {
+
+ static int Main ()
+ {
+ X x = new X();
+ x.M ();
+ e ();
+ Console.WriteLine ("J should be 101= {0}", j);
+ if (j != 101)
+ return 3;
+ Console.WriteLine ("OK");
+ return 0;
+ }
+
+ static int j = 0;
+ static D e;
+
+ void M ()
+ {
+ int l = 100;
+
+ D d = delegate {
+ int b;
+ b = 1;
+ Console.WriteLine ("Inside d");
+ e = delegate {
+ Console.WriteLine ("Inside e");
+ j = l + b;
+ Console.WriteLine ("j={0} l={1} b={2}", j, l, b);
+ };
+ };
+ Console.WriteLine ("Calling d");
+ d ();
+ }
+
+}
--- /dev/null
+//
+using System;
+
+delegate void D ();
+
+class X {
+ static D r;
+
+ static void Main ()
+ {
+ D d = T ();
+
+ d ();
+ r ();
+ r ();
+ }
+
+ static D T ()
+ {
+ int var1 = 0;
+
+ D d = delegate () {
+ int var2 = 1;
+
+ r = delegate {
+ Console.WriteLine ("var1: {0} var2: {1}", var1, var2);
+ var2 = var2 + 1;
+ };
+
+ var1 = var1 + 1;
+ };
+
+ return d;
+ }
+}
--- /dev/null
+using System;
+
+delegate void D ();
+
+class X {
+
+ static int Main ()
+ {
+ X x = new X();
+ x.M ();
+ e ();
+ Console.WriteLine ("J should be 101= {0}", j);
+ if (j != 101)
+ return 3;
+ Console.WriteLine ("OK");
+ return 0;
+ }
+
+ static int j;
+ static D e;
+
+ void M ()
+ {
+ int l = 100;
+
+ D d = delegate {
+ int b;
+ b = 1;
+ e = delegate {
+ j = l + b;
+ };
+ };
+ d ();
+ }
+
+}
--- /dev/null
+using System;
+
+delegate int D ();
+
+class X {
+
+ static void Main ()
+ {
+ D x = T (1);
+
+ Console.WriteLine ("Should be 2={0}", x ());
+ }
+
+ static D T (int a)
+ {
+ D d = delegate {
+ a = a + 1;
+ return a;
+ };
+
+ return d;
+ }
+}
--- /dev/null
+using System;
+
+delegate int D (int arg);
+
+class X {
+
+ static int Main ()
+ {
+ D x = T (1);
+
+ int v = x (10);
+ Console.WriteLine ("Should be 11={0}", v);
+ return v == 11 ? 0 : 1;
+ }
+
+ static D T (int a)
+ {
+ D d = delegate (int arg) {
+ return arg + a;
+ };
+
+ return d;
+ }
+}
--- /dev/null
+// Compiler options: -unsafe
+using System;
+
+delegate int D ();
+
+unsafe class X {
+
+ static int Main ()
+ {
+ D x = T (1);
+
+ int v = x ();
+ Console.WriteLine ("Should be 2={0}", v);
+ return v == 2 ? 0 : 1;
+ }
+
+ static D T (int a)
+ {
+ D d = delegate {
+ int *x = &a;
+
+ *x = *x + 1;
+ return *x;
+ };
+
+ return d;
+ }
+}
--- /dev/null
+using System;
+
+delegate void D ();
+
+class X {
+
+ static int Main ()
+ {
+ X x = new X();
+ x.M (10);
+ e ();
+ Console.WriteLine ("J should be 11= {0}", j);
+ e ();
+ Console.WriteLine ("J should be 11= {0}", j);
+ x.M (100);
+ e ();
+ Console.WriteLine ("J should be 101= {0}", j);
+ if (j != 101)
+ return 3;
+ Console.WriteLine ("OK");
+ return 0;
+ }
+
+ static int j;
+ static D e;
+
+ void M (int a)
+ {
+ Console.WriteLine ("A is=" + a);
+ D d = delegate {
+ int b;
+ b = 1;
+ e = delegate {
+ Console.WriteLine ("IN NESTED DELEGATE: {0}", a);
+ j = a + b;
+ };
+ };
+ d ();
+ }
+
+}
--- /dev/null
+using System;
+
+class Delegable {
+ public event EventHandler MyDelegate;
+}
+
+class DelegateTest {
+ static void Main (string[] argv)
+ {
+ Console.WriteLine ("Test");
+
+ Delegable db = new Delegable ();
+ db.MyDelegate += delegate (object o, EventArgs args) {
+ Console.WriteLine ("{0}", argv);
+ Console.WriteLine ("{0}", db);
+ };
+ }
+}
+
+
--- /dev/null
+using System;
+using System.Collections;
+
+public class X
+{
+ string[] ABC = { "A", "B", "C" };
+ string [,] EFGH = { { "E", "F" }, { "G", "H"}};
+
+ delegate string Foo ();
+ delegate void Bar (string s);
+
+ public string Hello ()
+ {
+ Foo foo = delegate {
+ foreach (string s in ABC){
+ Bar bar = delegate (string t) {
+ Console.WriteLine (t);
+ };
+ bar (s);
+ }
+
+ foreach (string s in EFGH){
+ Bar bar = delegate (string t) {
+ Console.WriteLine (t);
+ };
+ bar (s);
+ }
+
+ return "Hello";
+ };
+ return foo ();
+ }
+
+ public static void Main ()
+ {
+ X x = new X ();
+ Console.WriteLine (x.Hello ());
+ }
+}
--- /dev/null
+using System;
+using System.Reflection;
+using System.ComponentModel;
+
+[assembly: CLSCompliant(true)]
+[assembly: AssemblyTitle("")]
+
+public class CLSCLass_6 {
+ private object disposedEvent = new object ();
+ public EventHandlerList event_handlers;
+
+ public event Delegate Disposed {
+ add { event_handlers.AddHandler (disposedEvent, value); }
+ remove { event_handlers.RemoveHandler (disposedEvent, value); }
+ }
+}
+
+public delegate CLSDelegate Delegate ();
+
+[Serializable]
+public class CLSDelegate {
+}
+
+internal class CLSClass_5 {
+ [CLSCompliant (true)]
+ public uint Test () {
+ return 1;
+ }
+}
+
+[CLSCompliant (true)]
+public class CLSClass_4 {
+ [CLSCompliant (false)]
+ public uint Test () {
+ return 1;
+ }
+}
+
+public class CLSClass_3 {
+ [CLSCompliant (false)]
+ public uint Test_3 () {
+ return 6;
+ }
+}
+
+[CLSCompliant(false)]
+public class CLSClass_2 {
+ public sbyte XX {
+ get { return -1; }
+ }
+}
+
+class CLSClass_1 {
+ public UInt32 Valid() {
+ return 5;
+ }
+}
+
+[CLSCompliant(true)]
+public class CLSClass {
+
+ private class C1 {
+
+ [CLSCompliant(true)]
+ public class C11 {
+ protected ulong Foo3() {
+ return 1;
+ }
+ }
+
+ protected long Foo2() {
+ return 1;
+ }
+ }
+
+ [CLSCompliant(false)]
+ protected internal class CLSClass_2 {
+ public sbyte XX {
+ get { return -1; }
+ }
+ }
+
+
+ [CLSCompliant(true)]
+ private ulong Valid() {
+ return 1;
+ }
+
+ [CLSCompliant(true)]
+ public byte XX {
+ get { return 5; }
+ }
+
+// protected internal sbyte FooProtectedInternal() {
+// return -4;
+// }
+
+ internal UInt32 FooInternal() {
+ return 1;
+ }
+
+ private ulong Foo() {
+ return 1;
+ }
+
+
+ public static void Main() {}
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+public class CLSClass {
+
+ public byte XX {
+ get { return 5; }
+ }
+
+ public static void Main() {}
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Reflection;
+
+[assembly: CLSCompliant (true)]
+
+public class CLSClass {
+ [CLSCompliant(false)]
+ public CLSClass(ulong l) {}
+ internal CLSClass(uint i) {}
+
+ [CLSCompliant(false)]
+ public ulong X_0 {
+ set {}
+ }
+
+ [CLSCompliant(false)]
+ protected ulong this[ulong i] {
+ set {}
+ }
+
+ [CLSCompliant(false)]
+ public ulong X_1;
+
+ internal ulong X_2;
+
+ public static void Main() {
+ }
+}
+public class InnerTypeClasss {
+ public struct Struct {
+ }
+
+ public Struct Method () {
+ return new Struct ();
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+[assembly:CLSCompliant(true)]
+
+public interface I1 {
+}
+
+public class CLSClass {
+ protected internal I1 Foo() {
+ return null;
+ }
+
+ static void Main() {}
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+[assembly:CLSCompliant(true)]
+
+class X1 {
+ public bool AA;
+ internal bool aa;
+}
+
+class X2: X1 {
+ public bool aA;
+}
+
+public class X3 {
+ internal void bb(bool arg) {}
+ internal bool bB;
+ public void BB() {}
+}
+
+class X4 {
+ public void method(int arg) {}
+ public void method(bool arg) {}
+ public bool method() { return false; }
+}
+
+
+public class BaseClass {
+ //protected internal bool mEthod() { return false; }
+}
+
+public class CLSClass: BaseClass {
+ public CLSClass() {}
+ public CLSClass(int arg) {}
+
+ //public int this[int index] { set {} }
+ //protected int this[bool index] { set {} }
+
+ public bool setItem;
+ static public implicit operator CLSClass(bool value) {
+ return new CLSClass(2);
+ }
+
+ static public implicit operator CLSClass(int value) {
+ return new CLSClass(2);
+ }
+
+ [CLSCompliant(false)]
+ public void Method() {}
+
+ internal int Method(bool arg) { return 1; }
+ internal void methoD() {}
+
+ public static void Main() {}
+}
+
+public class oBject: Object {
+}
+
+namespace A {
+ public class C1 {
+ }
+}
+
+namespace B {
+ public class c1 {
+ }
+}
+
+public class c1 {
+}
+// Test
+[System.CLSCompliant (false)]
+public interface I1 {
+}
+
+public interface i1 {
+}
+
+// Test
+enum AB {
+}
+
+[CLSCompliant (false)]
+public enum aB {
+}
+
+public interface ab {
+}
+
+// Test
+public class CLSClass_2 {
+ [CLSCompliant (false)]
+ public void Method () {}
+ public void method () {}
+}
+
+// Test
+namespace System {
+ public class sByte {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+[assembly:CLSCompliant(true)]
+
+[CLSCompliant(false)]
+public delegate uint MyDelegate();
+
+[CLSCompliant(false)]
+public interface IFake {
+ [CLSCompliant(true)]
+ long AA(long arg);
+ [CLSCompliant(false)]
+ ulong BB { get; }
+ //[CLSCompliant(false)]
+ //sbyte this[ulong I] { set; }
+ [CLSCompliant(false)]
+ event MyDelegate MyEvent;
+}
+
+[CLSCompliant(false)]
+internal interface I {
+ [CLSCompliant(false)]
+ void Foo();
+
+ [CLSCompliant(true)]
+ ulong this[int indexA] { set; }
+}
+
+interface I2 {
+ int Test(int arg1, bool arg2);
+}
+
+public class CLSClass {
+ [CLSCompliant(false)]
+ public delegate uint MyDelegate();
+
+ public static void Main() {}
+}
+public class CLSClass_2 {
+ [CLSCompliant (false)]
+ public CLSClass_2(int[,,] b) {
+ }
+
+ public CLSClass_2(int[,] b) {
+ }
+
+ public void Test (int[,] b, int i) {}
+ public void Test (int[,,] b, bool b2) {}
+}
+
+public class X1 {
+ [CLSCompliant (false)]
+ public void M2 (int i) {}
+}
+
+public class X2: X1 {
+ public void M2 (ref int i) {}
+}
--- /dev/null
+using System;
+
+[assembly:CLSCompliant(true)]
+
+namespace aa {
+ public class I1 {
+ }
+}
+
+namespace bb {
+ public interface i1 {
+ }
+}
+
+public class CLSClass {
+ public static void Main() {}
+}
\ No newline at end of file
--- /dev/null
+using System;
+[assembly:CLSCompliant (true)]
+
+[CLSCompliant (false)]
+public interface I {
+ [CLSCompliant (false)]
+ void Error (ulong arg);
+}
+
+[CLSCompliant (false)]
+public interface I2 {
+ [CLSCompliant (true)]
+ void Error (long arg);
+}
+
+
+public class MainClass {
+ public static void Main () {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+[assembly:CLSCompliant (true)]
+
+[CLSCompliant (true)]
+public abstract class CLSClass {
+ [CLSCompliant (true)]
+ public abstract void Test (IComparable arg);
+}
+
+public abstract class CLSCLass_2 {
+ public abstract void Test ();
+}
+
+public class MainClass {
+ public static void Main () {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+[module: CLSCompliant(true)]
+[assembly: CLSCompliant(true)]
+
+public class MainClass {
+ public static void Main () {
+ }
+}
--- /dev/null
+using System;
+
+public class CLSClass {
+ [CLSCompliant (false)]
+ static public implicit operator CLSClass(byte value) {
+ return new CLSClass();
+ }
+
+ [CLSCompliant (true)]
+ private void Error (bool arg) {
+ }
+}
+
+public class MainClass {
+ public static void Main () {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+[assembly:CLSCompliant (true)]
+
+public class CLSAttribute_1: Attribute {
+ public CLSAttribute_1(int[] array) {
+ }
+
+ public CLSAttribute_1(int array) {
+ }
+}
+
+[CLSCompliant (false)]
+public class CLSAttribute_2: Attribute {
+ private CLSAttribute_2(int arg) {
+ }
+}
+
+internal class CLSAttribute_3: Attribute {
+ public CLSAttribute_3(int[] array) {
+ }
+}
+
+[CLSCompliant (false)]
+public class CLSAttribute_4: Attribute {
+ private CLSAttribute_4(int[] args) {
+ }
+}
+
+public class ClassMain {
+ public static void Main () {}
+}
\ No newline at end of file
--- /dev/null
+using System;
+[assembly:CLSCompliant (true)]
+
+[CLSCompliant (false)]
+[CLSAttribute (new bool [] {true, false})]
+public class CLSAttribute: Attribute {
+ public CLSAttribute(bool[] array) {
+ }
+}
+
+public class ClassMain {
+ public static void Main () {}
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+class X {
+ static IEnumerator GetIt ()
+ {
+ yield return 1;
+ yield return 2;
+ yield return 3;
+ }
+
+ static IEnumerable GetIt2 ()
+ {
+ yield return 1;
+ yield return 2;
+ yield return 3;
+ }
+
+ static int Main ()
+ {
+ IEnumerator e = GetIt ();
+ int total = 0;
+
+ while (e.MoveNext ()){
+ Console.WriteLine ("Value=" + e.Current);
+ total += (int) e.Current;
+ }
+
+ if (total != 6)
+ return 1;
+
+ total = 0;
+ foreach (int i in GetIt2 ()){
+ Console.WriteLine ("Value=" + i);
+ total += i;
+ }
+ if (total != 6)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+class X {
+ static int start, end;
+ static int i;
+
+ static IEnumerator GetRange ()
+ {
+ yield return 1;
+ for (i = start; i < end; i++)
+ yield return i;
+ yield return 100;
+ }
+
+ static int Main ()
+ {
+ start = 10;
+ end = 30;
+
+ int total = 0;
+
+ IEnumerator e = GetRange ();
+ while (e.MoveNext ()){
+ Console.WriteLine ("Value=" + e.Current);
+ total += (int) e.Current;
+ }
+
+ if (total != 491)
+ return 1;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+//
+// Use
+
+using System;
+using System.Collections;
+
+class X {
+ static IEnumerable GetIt (int [] args)
+ {
+ foreach (int a in args)
+ yield return a;
+ }
+
+ static IEnumerable GetMulti (int [,] args)
+ {
+ foreach (int a in args)
+ yield return a;
+ }
+
+ static int Main ()
+ {
+ int total = 0;
+ foreach (int i in GetIt (new int [] { 1, 2, 3})){
+ Console.WriteLine ("Got: " + i);
+ total += i;
+ }
+
+ if (total != 6)
+ return 1;
+
+ total = 0;
+ foreach (int i in GetMulti (new int [,] { { 10, 20 }, { 30, 40}})){
+ Console.WriteLine ("Got: " + i);
+ total += i;
+ }
+ if (total != 100)
+ return 2;
+
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+class X {
+ static IEnumerable GetRange (int start, int end)
+ {
+ for (int i = start; i < end; i++)
+ yield return i;
+ }
+
+ static void Main ()
+ {
+ Console.WriteLine ("GetRange 10..20");
+
+ foreach (int i in GetRange (10, 20)){
+ Console.WriteLine ("i=" + i);
+ }
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+//
+// Use
+
+using System;
+using System.Collections;
+
+class X {
+ static IEnumerable GetIt ()
+ {
+ List l = new List (3);
+ l.Add (1);
+ l.Add (2);
+ l.Add (3);
+
+ foreach (int i in l)
+ yield return i;
+ }
+
+ static int Main ()
+ {
+ int total = 0;
+ foreach (int i in GetIt ()) {
+ Console.WriteLine ("Got: " + i);
+ total += i;
+ }
+
+ return total == 6 ? 0 : 1;
+ }
+}
+
+public class List : IEnumerable {
+
+ int pos = 0;
+ int [] items;
+
+ public List (int i)
+ {
+ items = new int [i];
+ }
+
+ public void Add (int value)
+ {
+ items [pos ++] = value;
+ }
+
+ public MyEnumerator GetEnumerator ()
+ {
+ return new MyEnumerator(this);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return GetEnumerator ();
+ }
+
+ public struct MyEnumerator : IEnumerator {
+
+ List l;
+ int p;
+
+ public MyEnumerator (List l)
+ {
+ this.l = l;
+ p = -1;
+ }
+
+ public object Current {
+ get {
+ return l.items [p];
+ }
+ }
+
+ public bool MoveNext()
+ {
+ return ++p < l.pos;
+ }
+
+ public void Reset()
+ {
+ p = 0;
+ }
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+struct S {
+ int j;
+
+ public IEnumerable Get (int a)
+ {
+ Console.WriteLine ("Sending: " + a);
+ yield return a;
+ j = 10;
+ Console.WriteLine ("Sending: " + j);
+ yield return j;
+ }
+
+ public static IEnumerable GetS (int a)
+ {
+ yield return 100;
+ yield return a;
+ yield return 1000;
+ }
+}
+
+class X {
+ IEnumerable Get (int a)
+ {
+ yield return 1;
+ yield return 2;
+ yield return a;
+ }
+
+ static IEnumerable GetS (int a)
+ {
+ yield return a;
+ yield return a;
+ yield return 1;
+ }
+
+ static int Main ()
+ {
+ X y = new X ();
+
+ int total = 0;
+ foreach (int x in y.Get (5)){
+ total += x;
+ }
+ if (total != 8)
+ return 1;
+
+ total = 0;
+ foreach (int x in GetS (3)){
+ total += x;
+ }
+ if (total != 7)
+ return 2;
+
+ S s = new S();
+ total = 0;
+ foreach (int x in s.Get (100)){
+ Console.WriteLine ("Got: " + x);
+ total += x;
+ }
+ if (total != 110)
+ return 3;
+
+ total = 0;
+ foreach (int x in S.GetS (1)){
+ total += x;
+ }
+ if (total != 1101)
+ return 4;
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+public class Test
+{
+ public IEnumerable Foo (int a)
+ {
+ try {
+ try {
+ yield return a;
+ } finally {
+ Console.WriteLine ("Hello World");
+ }
+
+ Console.WriteLine ("Next block");
+
+ try {
+ yield return a * a;
+ } finally {
+ Console.WriteLine ("Boston");
+ }
+ } finally {
+ Console.WriteLine ("Outer finally");
+ }
+
+ Console.WriteLine ("Outer block");
+ yield break;
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ Test test = new Test ();
+
+ ArrayList list = new ArrayList ();
+ foreach (object o in test.Foo (5))
+ list.Add (o);
+
+ if (list.Count != 2)
+ return 1;
+ if ((int) list [0] != 5)
+ return 2;
+ if ((int) list [1] != 25)
+ return 3;
+
+ IEnumerable a = test.Foo (5);
+
+ IEnumerator b = a as IEnumerator;
+ if (b != null) {
+ if (b.MoveNext ())
+ return 4;
+ }
+
+ IEnumerator c = a.GetEnumerator ();
+ if (!c.MoveNext ())
+ return 5;
+ if ((int) c.Current != 5)
+ return 6;
+ if (!c.MoveNext ())
+ return 7;
+ if ((int) c.Current != 25)
+ return 8;
+
+ IEnumerator d = a.GetEnumerator ();
+
+ if ((int) c.Current != 25)
+ return 9;
+ if (!d.MoveNext ())
+ return 10;
+ if ((int) c.Current != 25)
+ return 11;
+ if ((int) d.Current != 5)
+ return 12;
+
+ if (c.MoveNext ())
+ return 13;
+
+ ((IDisposable) a).Dispose ();
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+using System;
+using System.Collections;
+
+public class Foo : IDisposable
+{
+ public readonly int Data;
+
+ public Foo (int data)
+ {
+ this.Data = data;
+ }
+
+ public bool disposed;
+
+ public void Dispose ()
+ {
+ disposed = true;
+ }
+}
+
+class X
+{
+ public static IEnumerable Test (int a, int b)
+ {
+ Foo foo3, foo4;
+
+ using (Foo foo1 = new Foo (a), foo2 = new Foo (b)) {
+ yield return foo1.Data;
+ yield return foo2.Data;
+
+ foo3 = foo1;
+ foo4 = foo2;
+ }
+
+ yield return foo3.disposed;
+ yield return foo4.disposed;
+ }
+
+ static int Main ()
+ {
+ ArrayList list = new ArrayList ();
+ foreach (object data in Test (3, 5))
+ list.Add (data);
+
+ if (list.Count != 4)
+ return 1;
+ if ((int) list [0] != 3)
+ return 2;
+ if ((int) list [1] != 5)
+ return 3;
+ if (!(bool) list [2])
+ return 4;
+ if (!(bool) list [3])
+ return 5;
+
+ return 0;
+ }
+}
--- /dev/null
+using System;
+using System.Collections;
+
+public class Tester
+{
+ string[] ABC = { "A", "B", "C" };
+ // D
+ string [,] EFGH = { { "E", "F" }, { "G", "H"}};
+ // I
+ ArrayList al = new ArrayList ();
+
+ public Tester ()
+ {
+ al.Add ("J");
+ al.Add ("K");
+ }
+
+ public System.Collections.IEnumerator GetEnumerator()
+ {
+ foreach (string s in ABC){
+ if (s == null)
+ throw new Exception ();
+ else
+ yield return s;
+ }
+
+ yield return "D";
+ foreach (string s in EFGH){
+ if(s == null)
+ throw new Exception ();
+ else
+ yield return s;
+ }
+
+ yield return "I";
+ foreach (string s in al){
+ if (s == null)
+ throw new Exception ();
+ else
+ yield return s;
+ }
+
+ yield return "L";
+ }
+}
+
+
+class Test
+{
+ public static int Main()
+ {
+ Tester tester = new Tester();
+ string [] list = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L" };
+ int top = 0;
+
+ foreach (string s in tester){
+ if (s != list [top]){
+ Console.WriteLine ("Failure, got {0} expected {1}", s, list [top]);
+ return 1;
+ }
+ top++;
+ }
+ if (top != list.Length){
+ Console.WriteLine ("Failure, expected {0} got {1}", list.Length, top);
+ }
+ Console.WriteLine ("Success");
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+namespace Foo
+{
+ public class Hello
+ {
+ public static int World = 8;
+ }
+}
+
+namespace Bar
+{
+ public class Hello
+ {
+ public static int World = 9;
+ }
+}
+
+namespace X
+{
+ using Foo;
+
+ public partial class Test
+ {
+ public static int FooWorld ()
+ {
+ return Hello.World;
+ }
+ }
+}
+
+namespace X
+{
+ using Bar;
+
+ public partial class Test
+ {
+ public static int BarWorld ()
+ {
+ return Hello.World;
+ }
+ }
+}
+
+class Y
+{
+ static int Main ()
+ {
+ if (X.Test.FooWorld () != 8)
+ return 1;
+ if (X.Test.BarWorld () != 9)
+ return 2;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+namespace Test1
+{
+ public class Base
+ { }
+
+ public partial class Foo : Base
+ { }
+
+ public partial class Foo : Base
+ { }
+}
+
+namespace Test2
+{
+ public interface Base
+ { }
+
+ public partial class Foo : Base
+ { }
+
+ public partial class Foo : Base
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+public partial class Test
+{
+ public readonly Foo TheFoo;
+
+ public Test ()
+ {
+ this.TheFoo = new Foo ();
+ }
+
+ public partial interface IFoo
+ {
+ int Hello (Test foo);
+ }
+
+ public int TestFoo ()
+ {
+ return TheFoo.Hello (this);
+ }
+}
+
+public partial class Test
+{
+ public partial class Foo : IFoo
+ {
+ int IFoo.Hello (Test test)
+ {
+ return 2;
+ }
+
+ public int Hello (Test test)
+ {
+ return 1;
+ }
+ }
+
+ public int TestIFoo (IFoo foo)
+ {
+ return foo.Hello (this);
+ }
+}
+
+class X
+{
+ static int Main ()
+ {
+ Test test = new Test ();
+ if (test.TestFoo () != 1)
+ return 1;
+ if (test.TestIFoo (test.TheFoo) != 2)
+ return 2;
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+namespace A
+{
+ interface IFoo
+ {
+ void Hello (IFoo foo);
+ }
+}
+
+namespace B
+{
+ partial class Test
+ { }
+}
+
+namespace B
+{
+ using A;
+
+ partial class Test : IFoo
+ {
+ void IFoo.Hello (IFoo foo)
+ { }
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// Compiler options: -langversion:default
+
+class B {
+}
+
+interface iface {
+}
+
+partial class A : B {
+}
+
+partial class A : iface {
+}
+
+class D { static void Main () {} }
--- /dev/null
+// Compiler options: -langversion:default
+
+partial class Foo
+{
+ ~Foo ()
+ { }
+}
+
+partial class Foo
+{ }
+
+class B { static void Main () {} }
+
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+[Obsolete]
+public partial class Test
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-001</name>\r
+ </assembly>\r
+ <members>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-001.xml
+using System;
+
+/// <summary>
+/// xml comment on namespace ... is not allowed.
+/// </summary>
+namespace Testing
+{
+ public class A
+ {
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-002</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ <summary>
+ comment on class
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
+ <member name="T:Testing.Test3">\r
+ <summary>
+ another Java-style documentation style
+ </summary>
+ </member>\r
+ <member name="T:Testing.Test4">\r
+ indentation level test <seealso
+ cref="T:Testing.Test" />.
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-002.xml
+using System;
+
+namespace Testing
+{
+ /// <summary>
+ /// comment on class
+ /// </summary>
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+
+ /// <summary>
+ /// Incorrect comment markup. See <see cref="T:Testing.Test" /> too.
+ /// </incorrect>
+ public class Test2
+ {
+ }
+
+ /**
+ <summary>
+ another Java-style documentation style
+ </summary>
+ */
+ public class Test3
+ {
+ }
+
+ /// indentation level test <seealso
+ /// cref="T:Testing.Test" />.
+public class Test4
+{
+}
+
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-003</name>\r
+ </assembly>\r
+ <members>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-003.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ /// here is an extraneous comment
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-004</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.StructTest">\r
+ <summary>
+ comment for struct
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.StructTest2" -->\r
+ <member name="T:Testing.StructTest3">\r
+ <summary>
+ Java style commet
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-004.xml
+using System;
+
+namespace Testing
+{
+ /// <summary>
+ /// comment for struct
+ /// </summary>
+ public struct StructTest
+ {
+ }
+
+ /// <summary>
+ /// incorrect markup comment for struct
+ /// </incorrect>
+ public struct StructTest2
+ {
+ }
+
+ /**
+ <summary>
+ Java style commet
+ </summary>
+ */
+ public struct StructTest3
+ {
+ }
+
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-005</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.InterfaceTest">\r
+ <summary>
+ comment for interface
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.InterfaceTest2" -->\r
+ <member name="T:Testing.InterfaceTest3">\r
+ <summary>
+ Java style comment for interface
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-005.xml
+using System;
+
+namespace Testing
+{
+ /// <summary>
+ /// comment for interface
+ /// </summary>
+ public interface InterfaceTest
+ {
+ }
+
+ /// <summary>
+ /// incorrect markup comment for interface
+ /// </incorrect>
+ public interface InterfaceTest2
+ {
+ }
+
+ /**
+ <summary>
+ Java style comment for interface
+ </summary>
+ */
+ public interface InterfaceTest3
+ {
+ }
+
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-006</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.EnumTest">\r
+ <summary>
+ comment for enum type
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.EnumTest2" -->\r
+ <member name="T:Testing.EnumTest3">\r
+ <summary>
+ Java style comment for enum type
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-006.xml
+using System;
+
+namespace Testing
+{
+ /// <summary>
+ /// comment for enum type
+ /// </summary>
+ public enum EnumTest
+ {
+ Foo,
+ Bar,
+ }
+
+ /// <summary>
+ /// comment for enum type
+ /// </incorrect>
+ public enum EnumTest2
+ {
+ Foo,
+ Bar,
+ }
+
+ /**
+ <summary>
+ Java style comment for enum type
+ </summary>
+ */
+ public enum EnumTest3
+ {
+ Foo,
+ Bar,
+ }
+
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-007</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.MyDelegate">\r
+ <summary>
+ comment for delegate type
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.MyDelegate2" -->\r
+ <member name="T:Testing.MyDelegate3">\r
+ <summary>
+ Javadoc comment for delegate type
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-007.xml
+using System;
+
+namespace Testing
+{
+ /// <summary>
+ /// comment for delegate type
+ /// </summary>
+ public delegate void MyDelegate (object o, EventArgs e);
+
+ /// <summary>
+ /// comment for delegate type
+ /// </incorrect>
+ public delegate void MyDelegate2 (object o, EventArgs e);
+
+ /**
+ <summary>
+ Javadoc comment for delegate type
+ </summary>
+ */
+ public delegate void MyDelegate3 (object o, EventArgs e);
+
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-008</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ comment without markup on class - it is allowed
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.Test3" -->\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-008.xml
+using System;
+
+namespace Testing
+{
+ /// comment without markup on class - it is allowed
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+ }
+
+ /// <6roken> broken markup
+ public class Test2
+ {
+ }
+
+ /// <dont-forget-close-tag>
+ public class Test3
+ {
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-009</name>\r
+ </assembly>\r
+ <members>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-009.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ /// inside method - not allowed.
+ }
+ }
+
+ public class Test2
+ {
+ /// no target
+ }
+
+ public class Test3
+ {
+ }
+ /// no target case 2.
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-010</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="F:Testing.Test.Constant">\r
+ <summary>
+ comment for const declaration
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "F:Testing.Test.Constant2" -->\r
+ <member name="F:Testing.Test.Constant3">\r
+ <summary>
+ Javaism comment for const declaration
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-010.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ /// <summary>
+ /// comment for const declaration
+ /// </summary>
+ const string Constant = "CONSTANT STRING";
+
+ /// <summary>
+ /// invalid comment for const declaration
+ /// </invalid>
+ const string Constant2 = "CONSTANT STRING";
+
+ /**
+ <summary>
+ Javaism comment for const declaration
+ </summary>
+ */
+ const string Constant3 = "CONSTANT STRING";
+
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-011</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="F:Testing.Test.PublicField">\r
+ <summary>
+ comment for public field
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "F:Testing.Test.PublicField2" -->\r
+ <member name="F:Testing.Test.PublicField3">\r
+ <summary>
+ Javadoc comment for public field
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-011.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ /// <summary>
+ /// comment for public field
+ /// </summary>
+ public string PublicField;
+
+ /// <summary>
+ /// comment for public field
+ /// </invalid>
+ public string PublicField2;
+
+ /**
+ <summary>
+ Javadoc comment for public field
+ </summary>
+ */
+ public string PublicField3;
+
+ public static void Main ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-012</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="F:Testing.Test.PrivateField">\r
+ <summary>
+ comment for private field
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "F:Testing.Test.PrivateField2" -->\r
+ <member name="F:Testing.Test.PrivateField3">\r
+ <summary>
+ Javadoc comment for private field
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-012.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// comment for private field
+ /// </summary>
+ private string PrivateField;
+
+ /// <summary>
+ /// incorrect markup comment for private field
+ /// </incorrect>
+ private string PrivateField2;
+
+ /**
+ <summary>
+ Javadoc comment for private field
+ </summary>
+ */
+ private string PrivateField3;
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-013</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="P:Testing.Test.PublicProperty">\r
+ <summary>
+ comment for public property
+ </summary>
+ </member>\r
+ <!-- Badly formed XML comment ignored for member "P:Testing.Test.PublicProperty2" -->\r
+ <member name="P:Testing.Test.PublicProperty3">\r
+ <summary>
+ Javadoc comment for public property
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-013.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// comment for public property
+ /// </summary>
+ public string PublicProperty {
+ /// <summary>
+ /// On public getter - no effect
+ /// </summary>
+ get { return null; }
+ /// <summary>
+ /// On public setter - no effect
+ /// </summary>
+ set { }
+ }
+
+ /// <summary>
+ /// incorrect comment for public property
+ /// </incorrect>
+ public string PublicProperty2 {
+ get { return null; }
+ }
+
+ /**
+ <summary>
+ Javadoc comment for public property
+ </summary>
+ */
+ public string PublicProperty3 {
+ /**
+ <summary>
+ On public getter - no effect
+ </summary>
+ */
+ get { return null; }
+ /**
+ <summary>
+ On public setter - no effect
+ </summary>
+ */
+ set { }
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-014</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="P:Testing.Test.PrivateProperty">\r
+ <summary>
+ comment for private property
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-014.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// comment for private property
+ /// </summary>
+ private string PrivateProperty {
+ get { return null; }
+ set { }
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-015</name>\r
+ </assembly>\r
+ <members>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-015.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ private string PrivateProperty {
+ get { return null; }
+ /// <summary>
+ /// comment for private property setter - no effect
+ /// </summary>
+ set { }
+ }
+
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-016</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="E:Testing.Test.MyEvent">\r
+ <summary>
+ public event EventHandler MyEvent
+ </summary>
+ </member>\r
+ <member name="E:Testing.Test.MyEvent2">\r
+ private event EventHandler MyEvent; without markup - it is OK.
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-016.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// public event EventHandler MyEvent
+ /// </summary>
+ public event EventHandler MyEvent;
+
+ /// private event EventHandler MyEvent; without markup - it is OK.
+ private event EventHandler MyEvent2;
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-017</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Testing.Test.Foo">\r
+ comment on method without parameter
+ </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)
+ </member>\r
+ <member name="M:Testing.Test.Foo(System.String[])">\r
+ here is a documentation with parameters (and has same name)
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-017.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// comment on method without parameter
+ public static void Foo ()
+ {
+ }
+
+ /// here is a documentation with parameters (and has same name)
+ public static void Foo (long l, Test t, System.Collections.ArrayList al)
+ {
+ }
+
+ /// here is a documentation with parameters (and has same name)
+ public static void Foo (params string [] param)
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-018</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="P:Testing.Test.Item(System.Int32)">\r
+ <summary>
+ comment for indexer
+ </summary>
+ </member>\r
+ <member name="P:Testing.Test.Item(System.String)">\r
+ <summary>
+ comment for indexer
+ </summary>
+ </member>\r
+ <member name="P:Testing.Test.Item(System.Int32,Testing.Test)">\r
+ <summary>
+ comment for indexer wit multiple parameters
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-018.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// comment for indexer
+ /// </summary>
+ public string this [int i] {
+ get { return null; }
+ }
+
+ /// <summary>
+ /// comment for indexer
+ /// </summary>
+ public string this [string s] {
+ get { return null; }
+ }
+
+ /// <summary>
+ /// comment for indexer wit multiple parameters
+ /// </summary>
+ public string this [int i, Test t] {
+ get { return null; }
+ }
+
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-019</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Testing.Test.op_LogicalNot(Testing.Test)">\r
+ <summary>
+ comment for unary operator
+ </summary>
+ </member>\r
+ <member name="M:Testing.Test.op_Addition(Testing.Test,System.Int32)">\r
+ <summary>
+ comment for binary operator
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-019.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <summary>
+ /// comment for unary operator
+ /// </summary>
+ public static bool operator ! (Test t)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// comment for binary operator
+ /// </summary>
+ public static int operator + (Test t, int b)
+ {
+ return b;
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-020</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Testing.Test.#ctor">\r
+ comment for constructor
+ </member>\r
+ <member name="M:Testing.Test.Finalize">\r
+ comment for destructor
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-020.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// comment for constructor
+ public Test ()
+ {
+ }
+
+ /// comment for destructor
+ ~Test ()
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-021</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test.InternalClass">\r
+ comment for internal class
+ </member>\r
+ <member name="T:Testing.Test.InternalStruct">\r
+ comment for internal struct
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-021.xml
+using System;
+
+namespace Testing
+{
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// comment for internal class
+ public class InternalClass
+ {
+ }
+
+ /// comment for internal struct
+ public struct InternalStruct
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-022</name>\r
+ </assembly>\r
+ <members>\r
+ <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
+ <member name="M:Testing.Test2.Foo">\r
+ another documentation style (Java-mimic)
+ </member>\r
+ <member name="T:Testing.StructTest">\r
+ testing indentation <summary> test test ;-)
+ comment for struct
+ </summary>
+ </member>\r
+ <member name="T:Testing.InterfaceTest">\r
+ <summary>
+ comment for interface
+ </summary>
+ </member>\r
+ <member name="T:Testing.EnumTest">\r
+ <summary>
+ comment for enum type
+ </summary>
+ </member>\r
+ <member name="F:Testing.EnumTest.Foo">\r
+ <summary>
+ comment for enum field
+ </summary>
+ </member>\r
+ <member name="T:Testing.Dummy">\r
+ <summary>
+ comment for dummy type
+ </summary>
+ </member>\r
+ <member name="T:Testing.MyDelegate">\r
+ <summary>
+ comment for delegate type
+ </summary>
+ </member>\r
+ <member name="T:Testing.Test">\r
+ <summary>
+ description for class Test
+ </summary>
+ </member>\r
+ <member name="F:Testing.Test.Constant">\r
+ comment for const declaration
+ </member>\r
+ <member name="F:Testing.Test.BadPublicField">\r
+ comment for public field
+ </member>\r
+ <member name="F:Testing.Test.PrivateField">\r
+ comment for private field
+ </member>\r
+ <member name="M:Testing.Test.Foo">\r
+ here is a documentation!!!
+ </member>\r
+ <member name="M:Testing.Test.Foo(System.Int64,Testing.Test,System.Collections.ArrayList)">\r
+ here is a documentation with parameters
+ </member>\r
+ <member name="M:Testing.Test.op_LogicalNot(Testing.Test)">\r
+ <summary>
+ comment for unary operator
+ </summary>
+ </member>\r
+ <member name="M:Testing.Test.op_Addition(Testing.Test,System.Int32)">\r
+ <summary>
+ comment for binary operator
+ </summary>
+ </member>\r
+ <member name="M:Testing.Test.Finalize">\r
+ comment for destructor
+ </member>\r
+ <member name="M:Testing.Test.#ctor">\r
+ comment for .ctor()
+ </member>\r
+ <member name="M:Testing.Test.#ctor(System.String,System.String[])">\r
+ comment for .ctor(string arg, string [] args)
+ </member>\r
+ <member name="P:Testing.Test.PublicProperty">\r
+ comment for public property
+ </member>\r
+ <member name="P:Testing.Test.PrivateProperty">\r
+ comment for private property
+ </member>\r
+ <member name="E:Testing.Test.MyEvent">\r
+ public event EventHandler MyEvent ;-)
+ </member>\r
+ <member name="P:Testing.Test.Item(System.Int32)">\r
+ comment for indexer
+ </member>\r
+ <member name="P:Testing.Test.Item(System.Int32,Testing.Test)">\r
+ comment for indexer wit multiple parameters
+ </member>\r
+ <member name="T:Testing.Test.InternalClass">\r
+ comment for internal class
+ </member>\r
+ <member name="T:Testing.Test.InternalStruct">\r
+ comment for internal struct
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-022.xml
+//
+// Combined tests (for detecting incorrect markup targeting).
+//
+using System;
+
+/// <summary>
+/// xml comment is not allowed here.
+/// </summary>
+namespace Testing
+{
+ /// <summary>
+ /// </incorrect>
+ public class Test2
+ {
+ /**
+ another documentation style (Java-mimic)
+ */
+ public static void Foo ()
+ {
+ /// here is an extraneous comment
+ }
+
+ public static void Main ()
+ {
+ }
+ }
+
+ /// testing indentation <summary> test test ;-)
+ /// comment for struct
+ /// </summary>
+ public struct StructTest
+ {
+ }
+
+ /// <summary>
+ /// comment for interface
+ /// </summary>
+ public interface InterfaceTest
+ {
+ }
+
+ /// <summary>
+ /// comment for enum type
+ /// </summary>
+ public enum EnumTest
+ {
+ /// <summary>
+ /// comment for enum field
+ /// </summary>
+ Foo,
+ Bar,
+ }
+
+ /// <summary>
+ /// comment for dummy type
+ /// </summary>
+ public class Dummy {}
+
+ /// <summary>
+ /// comment for delegate type
+ /// </summary>
+ public delegate void MyDelegate (object o, EventArgs e);
+
+ /// <summary>
+ /// description for class Test
+ /// </summary>
+ public class Test
+ {
+ /// comment for const declaration
+ const string Constant = "CONSTANT STRING";
+
+ /// comment for public field
+ public string BadPublicField;
+
+ /// comment for private field
+ private string PrivateField;
+
+ /// comment for public property
+ public string PublicProperty {
+ /// comment for private property getter
+ get { return null; }
+ }
+
+ /// comment for private property
+ private string PrivateProperty {
+ get { return null; }
+ /// comment for private property setter
+ set { }
+ }
+
+ int x;
+
+ /// public event EventHandler MyEvent ;-)
+ public event EventHandler MyEvent;
+
+ int y;
+
+ /// here is a documentation!!!
+ public static void Foo ()
+ {
+ }
+
+ /// here is a documentation with parameters
+ public static void Foo (long l, Test t, System.Collections.ArrayList al)
+ {
+ }
+
+ /// comment for indexer
+ public string this [int i] {
+ get { return null; }
+ }
+
+ /// comment for indexer wit multiple parameters
+ public string this [int i, Test t] {
+ get { return null; }
+ }
+
+ /// <summary>
+ /// comment for unary operator
+ /// </summary>
+ public static bool operator ! (Test t)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// comment for binary operator
+ /// </summary>
+ public static int operator + (Test t, int b)
+ {
+ return b;
+ }
+
+ /// comment for destructor
+ ~Test ()
+ {
+ }
+
+ /// comment for .ctor()
+ public Test ()
+ {
+ }
+
+ /// comment for .ctor(string arg, string [] args)
+ public Test (string arg, string [] args)
+ {
+ }
+
+ /// comment for internal class
+ public class InternalClass
+ {
+ }
+
+ /// comment for internal struct
+ public struct InternalStruct
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-023</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Test.Foo(Test.A,System.Int32)">\r
+ here is a documentation
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-023.xml
+ public class Test
+ {
+ public class A {}
+
+ public static void Main ()
+ {
+ }
+
+ /// here is a documentation
+ public static void Foo (A a, int x)
+ {
+ }
+ }
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-024</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ <!-- Include tag is invalid --><include/>\r
+ </member>\r
+ <member name="M:Testing.Test.Main">\r
+ <!-- Include tag is invalid --><include file="a"/>\r
+ </member>\r
+ <member name="M:Testing.Test.Bar(System.Int32)">\r
+ <!-- Include tag is invalid --><include path="/foo/bar"/>\r
+ </member>\r
+ <member name="M:Testing.Test.Baz(System.Int32)">\r
+ <!-- Badly formed XML file "c:\cygwin\home\_\cvs\mcs\tests\there-is-no-such-file" cannot be included -->\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-024.xml
+
+namespace Testing
+{
+ /// <include/>
+ public class Test
+ {
+ // warning
+ /// <include file='a' />
+ public static void Main ()
+ {
+ }
+
+ // warning
+ /// <include path='/foo/bar' />
+ public void Bar (int x)
+ {
+ }
+
+ // warning
+ /// <include file='there-is-no-such-file' path='/foo/bar' />
+ public void Baz (int x)
+ {
+ }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-025</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ <!-- No matching elements were found for the following include tag --><include file="test-xml-025.inc" path="/foo"/>\r
+ </member>\r
+ <member name="F:Testing.Test.S1">\r
+ <root attr="is attribute allowed?">\r
+ includes XML markup.\r
+ <child>test</child>\r
+ <child>test2</child>\r
+</root>\r
+ </member>\r
+ <member name="F:Testing.Test.S2">\r
+ <child>test</child><child>test2</child>\r
+ </member>\r
+ <member name="F:Testing.Test.S3">\r
+ <!-- Failed to insert some or all of included XML -->\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-025.xml
+
+namespace Testing
+{
+ /// <include file='test-xml-025.inc' path='/foo' />
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <include file='test-xml-025.inc' path='/root'/>
+ public string S1;
+
+ /// <include file='test-xml-025.inc' path='/root/child'/>
+ public string S2;
+
+ /// <include file='test-xml-025.inc' path='/root/@attr'/>
+ public string S3;
+ }
+}
+
--- /dev/null
+<root attr='is attribute allowed?'>
+ includes XML markup.
+ <child>test</child>
+ <child>test2</child>
+</root>
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-026</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ test class
+ </member>\r
+ <member name="M:Testing.Test.Foo(System.Int32)">\r
+ <param>anonymous</param>
+ </member>\r
+ <member name="M:Testing.Test.Bar(System.Int32)">\r
+ <param name='i'>correct</param>
+ <param name='i'>duplicate</param>
+ </member>\r
+ <member name="M:Testing.Test.Baz(System.Int32)">\r
+ <param name='mismatch'>mismatch</param>
+ </member>\r
+ <member name="M:Testing.Test.Var(System.Int32[])">\r
+ <param name='arr'>varargs</param>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-026.xml
+namespace Testing
+{
+ /// test class
+ public class Test
+ {
+ public static void Main ()
+ {
+ }
+
+ /// <param>anonymous</param>
+ public void Foo (int i) {}
+
+ /// <param name='i'>correct</param>
+ /// <param name='i'>duplicate</param>
+ public void Bar (int i) {}
+
+ /// <param name='mismatch'>mismatch</param>
+ public void Baz (int i) {}
+
+ /// <param name='arr'>varargs</param>
+ public void Var (params int [] arr) {}
+ }
+}
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-027</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Testing.Test">\r
+ <summary>\r
+ <see/>\r
+ <see cref="!:!!!!!"/>\r
+ <see cref="!:nonexist"/>\r
+ <see cref="T:Testing.Test"/>\r
+ <see cref="T:Testing.Test"/>\r
+ <see cref="T:Test"/>\r
+ <see cref="_:Test"/>\r
+ <see cref="P:Bar"/>\r
+ <see cref="F:Bar"/>\r
+ <see cref="F:Testing.Test.Bar"/>\r
+ <see cref="P:Baz"/>\r
+ <see cref="F:Baz"/>\r
+ <see cref="P:Testing.Test.Baz"/>\r
+ <see cref="!:nonexist.Foo()"/>\r
+ <see cref="M:Testing.Test.Foo"/>\r
+ <see cref="M:Testing.Test.Foo"/>\r
+ <see cref="!:Test.Bar()"/>\r
+ <see cref="!:Test.Foo(System.Int32)"/>\r
+ </summary>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-027.xml
+using ZZZ = Testing.Test;
+
+namespace Testing
+{
+ /// <summary>
+ /// <see />
+ /// <see cref='!!!!!' />
+ /// <see cref='nonexist' />
+ /// <see cref='Test' />
+ /// <see cref='ZZZ' />
+ /// <see cref='T:Test' />
+ /// <see cref='_:Test' />
+ /// <see cref='P:Bar' />
+ /// <see cref='F:Bar' />
+ /// <see cref='Bar' />
+ /// <see cref='P:Baz' />
+ /// <see cref='F:Baz' />
+ /// <see cref='Baz' />
+ /// <see cref='nonexist.Foo()' />
+ /// <see cref='Test.Foo()' />
+ /// <see cref='ZZZ.Foo()' />
+ /// <see cref='Test.Bar()' />
+ /// <see cref='Test.Foo(System.Int32)' />
+ /// </summary>
+ class Test
+ {
+ public static void Main () { System.Console.Error.WriteLine ("xml-027 is running fine ;-)"); }
+
+ // I don't put any documentation here, but cref still works.
+ public void Foo () {}
+
+ public string Bar;
+
+ public string Baz { get { return ""; } }
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-028</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Test">\r
+ <summary>\r
+ Partial comment #2\r
+ Partial comment #1\r
+ </summary>\r
+ </member>\r
+ <member name="T:Test.Inner">\r
+ <summary>\r
+ Partial inner class!\r
+ ... is still available.\r
+ </summary>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-028.xml
+using System;
+
+/// <summary>
+/// Partial comment #2
+public partial class Test
+{
+ string Bar;
+
+ public static void Main () {}
+
+ /// <summary>
+ /// Partial inner class!
+ internal partial class Inner
+ {
+ public string Hoge;
+ }
+}
+
+/// Partial comment #1
+/// </summary>
+public partial class Test
+{
+ public string Foo;
+
+ /// ... is still available.
+ /// </summary>
+ internal partial class Inner
+ {
+ string Fuga;
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-029</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Test1.Foo">\r
+ <summary>
+ Some test documentation
+ </summary>
+ </member>\r
+ <member name="T:ITest2">\r
+ <summary>
+ Publicly available interface
+ </summary>
+ </member>\r
+ <member name="M:ITest2.Foo">\r
+ <summary>
+ Some test documentation
+ </summary>
+ </member>\r
+ <member name="P:ITest2.Bar">\r
+ <summary>
+ Some test documentation
+ </summary>
+ </member>\r
+ <member name="E:ITest2.EventRaised">\r
+ <summary>
+ Some test documentation
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-029.xml
+using System;
+
+class Test1 {
+ /// <summary>
+ /// Some test documentation
+ /// </summary>
+ void Foo(){}
+
+ public static void Main () {}
+}
+
+/// <summary>
+/// Publicly available interface
+/// </summary>
+public interface ITest2 {
+
+ /// <summary>
+ /// Some test documentation
+ /// </summary>
+ void Foo();
+
+ /// <summary>
+ /// Some test documentation
+ /// </summary>
+ long Bar { get; }
+
+ /// <summary>
+ /// Some test documentation
+ /// </summary>
+ event EventHandler EventRaised;
+}
+
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-030</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Test.foo2">\r
+ <summary>\r
+ some summary\r
+ </summary>\r
+ <value>\r
+ <see cref="T:Test[]"/>\r
+ <see cref="T:System.Text.RegularExpressions.Regex"/>\r
+ <see cref="T:System.Text.RegularExpressions.Regex"/>\r
+ <see cref="N:System.Text.RegularExpressions"/>\r
+ <see cref="T:System.Text.RegularExpressions.Regex[]"/>\r
+ </value>\r
+ </member>\r
+ <member name="M:Test.foo3(System.String,System.Object[])">\r
+ <summary>\r
+ <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
+ <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
+ <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
+ <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
+ </summary>\r
+ <param name="line">The formatting string.</param>\r
+ <param name="args">The object array to write into format string.</param>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-030.xml -warn:4 -warnaserror
+using System;
+
+class Test
+{
+ static void Main () {}
+
+ /// <summary>
+ /// some summary
+ /// </summary>
+ /// <value>
+ /// <see cref="T:Test[]"/>
+ /// <see cref="T:System.Text.RegularExpressions.Regex"/>
+ /// <see cref="System.Text.RegularExpressions.Regex"/>
+ /// <see cref="System.Text.RegularExpressions"/>
+ /// <see cref="T:System.Text.RegularExpressions.Regex[]"/>
+ /// </value>
+ //
+ // <see cref="T:System.Text.RegularExpressions"/> .. csc incorrectly allows it
+ // <see cref="System.Text.RegularExpressions.Regex[]"/> ... csc does not allow it.
+ //
+ public void foo2() {
+ }
+
+ /// <summary>
+ /// <see cref="String.Format(string, object[])" />.
+ /// <see cref="string.Format(string, object[])" />.
+ /// <see cref="String.Format(string, object [ ])" />.
+ /// <see cref="string.Format(string, object [ ])" />.
+ /// </summary>
+ /// <param name="line">The formatting string.</param>
+ /// <param name="args">The object array to write into format string.</param>
+ public void foo3(string line, params object[] args) {
+ }
+}
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-031</name>\r
+ </assembly>\r
+ <members>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-031.xml -warn:4 -warnaserror
+//// Some comment
+////how about this line?
+using System;
+using System.IO;
+
+class Test
+{
+ public static void Main ()
+ {
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-032</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="M:Test.#ctor(System.String)">\r
+ <exception cref="T:System.ArgumentNullException"><paramref name="wrongref"/> is <see langword="null"/>.</exception>\r
+ <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="wrongRefAgain"/> is a zero-length <see cref="T:System.String"/>.</exception>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-032.xml -warn:4 -warnaserror
+using System;
+
+class Test
+{
+ /// <exception cref="ArgumentNullException"><paramref name="wrongref" /> is <see langword="null" />.</exception>
+ /// <exception cref="ArgumentOutOfRangeException"><paramref name="wrongRefAgain" /> is a zero-length <see cref="string" />.</exception>
+ protected Test(string name)
+ {
+ }
+
+ static void Main () {}
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-033</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:MyClass">\r
+ <summary>help text</summary>
+ </member>\r
+ <member name="M:MyClass.Main">\r
+ <summary>help text</summary>
+ </member>\r
+ <member name="M:MyClass.op_Explicit(MyClass)~System.Int32">\r
+ <summary>help text</summary>
+ </member>\r
+ <member name="M:MyClass.op_Implicit(MyClass)~System.Char">\r
+ <summary>help text</summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-033.xml
+
+/// <summary>help text</summary>
+public class MyClass
+{
+ /// <summary>help text</summary>
+ public static void Main()
+ {
+ }
+
+ /// <summary>help text</summary>
+ public static explicit operator int(MyClass f)
+ {
+ return 0;
+ }
+
+ /// <summary>help text</summary>
+ public static implicit operator char(MyClass f)
+ {
+ return ' ';
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-034</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Test">\r
+ valid comment.
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-034.xml -warn:4 -warnaserror
+using System;
+
+/// valid comment.
+public class Test
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-035</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Test">\r
+ <summary>\r
+ <see cref="M:System.Data.DataSet.ReadXml(System.Xml.XmlReader,System.Data.XmlReadMode)"/>\r
+ <see cref="M:System.Environment.GetFolderPath(System.Environment.SpecialFolder)"/>\r
+ </summary>\r
+ </member>\r
+ <member name="M:Test.Main">\r
+ <summary>\r
+ <see cref="T:System.Environment.SpecialFolder"/>\r
+ </summary>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-035.xml -warn:4 -warnaserror -r:System.Data
+using System;
+using System.Data;
+using System.Xml;
+
+/// <summary>
+/// <see cref="DataSet.ReadXml(XmlReader,XmlReadMode)" />
+/// <see cref="Environment.GetFolderPath(Environment.SpecialFolder)" />
+/// </summary>
+public class Test {
+ /// <summary>
+ /// <see cref="Environment.SpecialFolder" />
+ /// </summary>
+ public static void Main() {
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-036</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Test">\r
+ <summary><see cref="F:Test.true"/>, <see cref="F:Test.true"/>, <see cref="F:Test.Whatever"/></summary>\r
+ </member>\r
+ <member name="F:Test.true">\r
+ <summary>Yes</summary>\r
+ </member>\r
+ <member name="F:Test.false">\r
+ <summary>Nope</summary>\r
+ </member>\r
+ <member name="F:Test.Whatever">\r
+ <summary>Maybe</summary>\r
+ </member>\r
+ <member name="T:Foo">\r
+ <summary><see cref="M:Foo.true"/></summary>\r
+ </member>\r
+ <member name="M:Foo.true">\r
+ <summary>Foo</summary>\r
+ </member>\r
+ <member name="M:Foo.Main">\r
+ main.\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-036.xml -warn:1 -warnaserror
+/// <summary><see cref="@true" />, <see cref="Test.@true" />, <see cref="@Whatever" /></summary>
+public enum Test {
+ /// <summary>Yes</summary>
+ @true,
+ /// <summary>Nope</summary>
+ @false,
+ /// <summary>Maybe</summary>
+ Whatever
+}
+
+/// <summary><see cref="Foo.@true" /></summary>
+public abstract class Foo {
+ /// <summary>Foo</summary>
+ public abstract void @true();
+ /// main.
+ public static void Main() {}
+}
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-037</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Whatever">\r
+ <summary>\r
+ <see cref="E:System.AppDomain.AssemblyResolve"/>\r
+ </summary>\r
+ </member>\r
+ <member name="M:Whatever.Main">\r
+ <summary>
+ </summary>
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-037.xml
+using System;
+using System.Reflection;
+
+/// <summary>
+/// <see cref="AppDomain.AssemblyResolve" />
+/// </summary>
+public class Whatever {
+ /// <summary>
+ /// </summary>
+ public static void Main() {
+ foreach (MemberInfo mi in typeof (AppDomain).FindMembers (
+ MemberTypes.All,
+ BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
+ Type.FilterName,
+ "AssemblyResolve"))
+ Console.WriteLine (mi.GetType ());
+ }
+}
+
--- /dev/null
+<?xml version="1.0"?>\r
+<doc>\r
+ <assembly>\r
+ <name>test-xml-038</name>\r
+ </assembly>\r
+ <members>\r
+ <member name="T:Whatever">\r
+ <summary>\r
+ <see cref="E:System.AppDomain.AssemblyResolve"/>\r
+ </summary>\r
+ </member>\r
+ <member name="M:Whatever.Main">\r
+ <summary>\r
+ </summary>\r
+ </member>\r
+ </members>\r
+</doc>\r
--- /dev/null
+// Compiler options: -doc:xml-038.xml
+using System;
+using System.Reflection;
+using System.Xml;
+
+/// <summary>
+/// <see cref="AppDomain.AssemblyResolve" />
+/// </summary>
+public class Whatever {
+ /// <summary>
+ /// </summary>
+ public static void Main() {
+ foreach (MemberInfo mi in typeof (XmlDocument).FindMembers (
+ MemberTypes.All,
+ BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
+ Type.FilterName,
+ "NodeInserted"))
+ Console.WriteLine (mi.GetType ());
+ }
+}
+
+++ /dev/null
-class t {
-
- void a ()
- {
- int b;
-
- try {
- b = 1;
- } catch {
- b = 2;
- }
- }
-
- void b ()
- {
- int a;
-
- try {
- a = 1;
- } catch (Exception) {
- a = 2;
- }
- }
-
- void c ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- }
- }
-
- void d ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- } finally {
- a = 111;
- }
- }
-}
-
+++ /dev/null
-// Compiler options: -unsafe
-
-//
-// Tests unsafe operators. address-of, dereference, member access
-//
-using System;
-
-unsafe struct Y {
- public int a;
- public int s;
-}
-
-unsafe class X {
- static int TestDereference ()
- {
- Y y;
- Y *z;
- Y a;
-
- z = &y;
- y.a = 1;
- y.s = 2;
-
- a.a = z->a;
- a.s = z->s;
-
- if (a.a != y.a)
- return 1;
- if (a.s != y.s)
- return 2;
-
- return 0;
- }
-
- static int TestPtrAdd ()
- {
- int [] a = new int [10];
- int i;
-
- for (i = 0; i < 10; i++)
- a [i] = i;
-
- i = 0;
- fixed (int *b = &a [0]){
- int *p = b;
-
- for (i = 0; i < 10; i++){
- if (*p != a [i])
- return 10+i;
- p++;
- }
- }
- return 0;
- }
-
- static int i = 1;
- static char c = 'a';
- static long l = 123;
- static double d = 1.2;
- static float f = 1.3F;
- static short s = 4;
-
- static int TestPtrAssign ()
- {
-
- fixed (int *ii = &i){
- *ii = 10;
- }
-
- fixed (char *cc = &c){
- *cc = 'b';
- }
-
- fixed (long *ll = &l){
- *ll = 100;
- }
-
- fixed (double *dd = &d){
- *dd = 3.0;
- }
-
- fixed (float *ff = &f){
- *ff = 1.2F;
- }
-
- fixed (short *ss = &s){
- *ss = 102;
- }
-
- if (i != 10)
- return 100;
- if (c != 'b')
- return 101;
- if (l != 100)
- return 102;
- if (d != 3.0)
- return 103;
- if (f != 1.2F)
- return 104;
- if (s != 102)
- return 105;
- return 0;
- }
-
- static int TestPtrArithmetic ()
- {
- char [] array = new char [10];
- char *pb;
-
- array [5] = 'j';
- fixed (char *pa = array){
- pb = pa + 1;
-
-
- //
- // This one tests pointer element access
- //
- if (pa [5] != 'j')
- return 199;
-
- Console.WriteLine ("V: " + (pb - pa));
- if ((pb - pa) != 1)
- return 200;
-
- pb++;
-
- if (pb == pa)
- return 201;
- if (pb < pa)
- return 202;
- if (pa > pb)
- return 203;
- if (pa >= pb)
- return 204;
- if (pb <= pa)
- return 205;
- pb = pb - 2;
- if (pb != pa){
- Console.WriteLine ("VV: " + (pb - pa));
- return 206;
- }
- }
-
- return 0;
- }
-
- static int TestMultiple ()
- {
- char [] array = new char [10];
- int count = 0;
-
- fixed (char *pa = array, pb = array){
- count++;
- }
- if (count != 1)
- return 300;
- return 0;
- }
-
- static int Main ()
- {
- int v;
-
- if ((v = TestDereference ()) != 0)
- return v;
-
- if ((v = TestPtrAdd ()) != 0)
- return v;
-
- if ((v = TestPtrAssign ()) != 0)
- return v;
-
- if ((v = TestPtrArithmetic ()) != 0)
- return v;
-
- if ((v = TestMultiple ()) != 0)
- return v;
-
- Console.WriteLine ("Ok");
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-using System;
-
-unsafe class X {
- static int Main () {
- int y = 20;
- byte* x = (byte*)0;
- x += (long)y;
- // x == 20;
- return (int)x - 20 * sizeof (byte);
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-//
-// This test excercises stackalloc, some pointer arithmetic,
-// and dereferences
-//
-using System;
-unsafe class X {
- static int Main ()
- {
- char *ptr = stackalloc char [10];
- char *cptr = ptr;
- int i;
- long l = 0;
- ulong ul = 0;
- byte b = 0;
-
- for (i = 0; i < 10; i++)
- ptr [i] = (char) (i + 10);
-
- for (i = 0; i < 10; i++){
- if (*ptr != (char) (i + 10))
- return 200 + i;
- ptr++;
- }
-
-
- // Now test index access with longs
- if (cptr [l] != 10){
- return 1;
- }
- if (cptr [ul] != 10)
- return 2;
- if (cptr [b] != 10)
- return 3;
-
- //
- // Try to compile non-int values
- //
- byte* bptr = (byte*) 5;
- ushort us = 3;
- byte* ret = (byte*) (bptr + us);
-
- Console.WriteLine ("Ok");
- return 0;
- }
-}
-
-
+++ /dev/null
-// Compiler options: -unsafe
-
-// this tests making a pointer to a pointer
-
-using System;
-
-unsafe class Foo
-{
- public static int Main ()
- {
- int a;
- int *b;
- int **c;
-
- a = 42;
- b = &a;
- c = &b;
-
- Console.WriteLine ("*c == b : {0}", *c == b);
- Console.WriteLine ("**c == a : {0}", **c == a);
-
- if (*c == b && **c == a)
- {
- Console.WriteLine ("Test passed");
- return 0;
- }
- else
- {
- Console.WriteLine ("Test failed");
- return 1;
- }
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-unsafe class X {
- static int v;
- static int v_calls;
-
- static int* get_v ()
- {
- v_calls++;
- return &v;
- }
-
- static int Main ()
- {
- if ((*get_v ())++ != 0)
- return 1;
- if (v != 1)
- return 2;
- if (v_calls != 1)
- return 3;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-using System;
-
-namespace testapp{
- public unsafe class LibTestAPI{
-
- struct LibTestStruct{
- void* pData;
- void* pTest1;
- }
-
- LibTestStruct* the_struct;
-
- public void Create(){
- IntPtr MyPtr = new IntPtr(0); // Usually created elsewhere
- the_struct = (LibTestStruct *) 0; // error CS1002
- }
- }
-
- class TestApp{
- static void Main(string[] args){
- LibTestAPI myapi = new LibTestAPI();
- myapi.Create();
- }
- }
-}
-
+++ /dev/null
-// Compiler options: -unsafe
-
-//
-// This tests excercises the compound assignment when the left side
-// is an dereference operator.
-//
-using System;
-namespace TestCase {
- public unsafe class Test {
- static int Main(string[] args) {
- uint[] uArr = {0, 200};
- uint[] uArr2 = {0, 200};
-
- fixed (uint* u = uArr, u2 = uArr2) {
- if (DoOp (u) != 100)
- return 1;
-
- if (uArr [0] != 100)
- return 2;
-
- if (uArr [1] != 200)
- return 3;
-
- if (DoOp2 (u2) != 100)
- return 4;
-
- if (uArr2 [0] != 100)
- return 5;
-
- if (uArr2 [1] != 200)
- return 6;
- }
-
- return 0;
- }
-
- private static uint DoOp (uint *u) {
- return *(u) += 100;
- }
-
- private static uint DoOp2 (uint *u) {
- *(u) += 100;
- return *u;
- }
-
- }
-}
-
+++ /dev/null
-// Compiler options: -unsafe
-
-struct Obsolete {
- int a;
-}
-struct A {
- int a, b;
-}
-
-class MainClass {
- unsafe public static void Main ()
- {
- System.Console.WriteLine (sizeof (Obsolete));
- }
-}
-
-
+++ /dev/null
-// Compiler options: -unsafe
-
-unsafe class T {
- static int Main () {
- int len = 10;
- int* x = stackalloc int [len];
- return x [0];
- }
-}
+++ /dev/null
-// Compiler options: -unsafe
-
-//
-// Test for http://bugzilla.ximian.com/show_bug.cgi?id=62263
-//
-// We need to make sure that pointer arth uses the size of X
-// not the size of X*
-//
-
-using System;
-unsafe struct X {
- int x, y, z;
-
- static int Main ()
- {
- X* foo = null;
-
- if ((int) (foo + 1) != sizeof (X))
- return 1;
- return 0;
- }
-}
+++ /dev/null
-// Compiler options: -t:library
-
-using System;
-
-public struct Result {
- public int res;
- // big enough that it won't be returned in registers
- double duh;
- long bah;
-
- public Result (int val) {
- res = val;
- bah = val;
- duh = val;
- }
-}
-
-public class Vararg
-{
- public static int AddABunchOfInts (__arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return result;
- }
-
- public static int AddASecondBunchOfInts (int a, __arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return result;
- }
-
- public static Result VtAddABunchOfInts (__arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return new Result (result);
- }
-
- public static Result VtAddASecondBunchOfInts (int a, __arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return new Result (result);
- }
-
- public int InstAddABunchOfInts (__arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return result;
- }
-
- public int InstAddASecondBunchOfInts (int a, __arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return result;
- }
-
- public Result InstVtAddABunchOfInts (__arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return new Result (result);
- }
-
- public Result InstVtAddASecondBunchOfInts (int a, __arglist)
- {
- int result = 0;
-
- System.ArgIterator iter = new System.ArgIterator (__arglist);
- int argCount = iter.GetRemainingCount();
-
- for (int i = 0; i < argCount; i++) {
- System.TypedReference typedRef = iter.GetNextArg();
- result += (int)TypedReference.ToObject( typedRef );
- }
-
- return new Result (result);
- }
-}
+++ /dev/null
-// Compiler options: -r:vararg-dll.dll
-
-using System;
-
-class TestVararg
-{
- static int Main ()
- {
- int result = Vararg.AddABunchOfInts (__arglist ( 2, 3, 4 ));
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 9)
- return 1;
-
- result = Vararg.AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 9)
- return 2;
-
- Vararg s = new Vararg ();
-
- result = s.InstAddABunchOfInts (__arglist ( 2, 3, 4, 5 ));
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 14)
- return 3;
-
- result = s.InstAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 ));
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 20)
- return 4;
-
- result = s.InstVtAddABunchOfInts (__arglist ( 2, 3, 4, 5 )).res;
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 14)
- return 5;
-
- result = s.InstVtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6 )).res;
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 20)
- return 6;
-
- result = Vararg.VtAddABunchOfInts (__arglist ( 2, 3, 4, 5, 1 )).res;
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 15)
- return 7;
-
- result = Vararg.VtAddASecondBunchOfInts (16, __arglist ( 2, 3, 4, 5, 6, 1 )).res;
- Console.WriteLine ("Answer: {0}", result);
-
- if (result != 21)
- return 8;
-
- return 0;
- }
-}
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-001</name>\r
- </assembly>\r
- <members>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-001.xml
-using System;
-
-/// <summary>
-/// xml comment on namespace ... is not allowed.
-/// </summary>
-namespace Testing
-{
- public class A
- {
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-002</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- <summary>
- comment on class
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
- <member name="T:Testing.Test3">\r
- <summary>
- another Java-style documentation style
- </summary>
- </member>\r
- <member name="T:Testing.Test4">\r
- indentation level test <seealso
- cref="T:Testing.Test" />.
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-002.xml
-using System;
-
-namespace Testing
-{
- /// <summary>
- /// comment on class
- /// </summary>
- public class Test
- {
- public static void Main ()
- {
- }
- }
-
- /// <summary>
- /// Incorrect comment markup. See <see cref="T:Testing.Test" /> too.
- /// </incorrect>
- public class Test2
- {
- }
-
- /**
- <summary>
- another Java-style documentation style
- </summary>
- */
- public class Test3
- {
- }
-
- /// indentation level test <seealso
- /// cref="T:Testing.Test" />.
-public class Test4
-{
-}
-
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-003</name>\r
- </assembly>\r
- <members>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-003.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- /// here is an extraneous comment
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-004</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.StructTest">\r
- <summary>
- comment for struct
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.StructTest2" -->\r
- <member name="T:Testing.StructTest3">\r
- <summary>
- Java style commet
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-004.xml
-using System;
-
-namespace Testing
-{
- /// <summary>
- /// comment for struct
- /// </summary>
- public struct StructTest
- {
- }
-
- /// <summary>
- /// incorrect markup comment for struct
- /// </incorrect>
- public struct StructTest2
- {
- }
-
- /**
- <summary>
- Java style commet
- </summary>
- */
- public struct StructTest3
- {
- }
-
- public class Test
- {
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-005</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.InterfaceTest">\r
- <summary>
- comment for interface
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.InterfaceTest2" -->\r
- <member name="T:Testing.InterfaceTest3">\r
- <summary>
- Java style comment for interface
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-005.xml
-using System;
-
-namespace Testing
-{
- /// <summary>
- /// comment for interface
- /// </summary>
- public interface InterfaceTest
- {
- }
-
- /// <summary>
- /// incorrect markup comment for interface
- /// </incorrect>
- public interface InterfaceTest2
- {
- }
-
- /**
- <summary>
- Java style comment for interface
- </summary>
- */
- public interface InterfaceTest3
- {
- }
-
- public class Test
- {
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-006</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.EnumTest">\r
- <summary>
- comment for enum type
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.EnumTest2" -->\r
- <member name="T:Testing.EnumTest3">\r
- <summary>
- Java style comment for enum type
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-006.xml
-using System;
-
-namespace Testing
-{
- /// <summary>
- /// comment for enum type
- /// </summary>
- public enum EnumTest
- {
- Foo,
- Bar,
- }
-
- /// <summary>
- /// comment for enum type
- /// </incorrect>
- public enum EnumTest2
- {
- Foo,
- Bar,
- }
-
- /**
- <summary>
- Java style comment for enum type
- </summary>
- */
- public enum EnumTest3
- {
- Foo,
- Bar,
- }
-
- public class Test
- {
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-007</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.MyDelegate">\r
- <summary>
- comment for delegate type
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.MyDelegate2" -->\r
- <member name="T:Testing.MyDelegate3">\r
- <summary>
- Javadoc comment for delegate type
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-007.xml
-using System;
-
-namespace Testing
-{
- /// <summary>
- /// comment for delegate type
- /// </summary>
- public delegate void MyDelegate (object o, EventArgs e);
-
- /// <summary>
- /// comment for delegate type
- /// </incorrect>
- public delegate void MyDelegate2 (object o, EventArgs e);
-
- /**
- <summary>
- Javadoc comment for delegate type
- </summary>
- */
- public delegate void MyDelegate3 (object o, EventArgs e);
-
- public class Test
- {
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-008</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- comment without markup on class - it is allowed
- </member>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
- <!-- Badly formed XML comment ignored for member "T:Testing.Test3" -->\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-008.xml
-using System;
-
-namespace Testing
-{
- /// comment without markup on class - it is allowed
- public class Test
- {
- public static void Main ()
- {
- }
- }
-
- /// <6roken> broken markup
- public class Test2
- {
- }
-
- /// <dont-forget-close-tag>
- public class Test3
- {
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-009</name>\r
- </assembly>\r
- <members>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-009.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- /// inside method - not allowed.
- }
- }
-
- public class Test2
- {
- /// no target
- }
-
- public class Test3
- {
- }
- /// no target case 2.
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-010</name>\r
- </assembly>\r
- <members>\r
- <member name="F:Testing.Test.Constant">\r
- <summary>
- comment for const declaration
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "F:Testing.Test.Constant2" -->\r
- <member name="F:Testing.Test.Constant3">\r
- <summary>
- Javaism comment for const declaration
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-010.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- /// <summary>
- /// comment for const declaration
- /// </summary>
- const string Constant = "CONSTANT STRING";
-
- /// <summary>
- /// invalid comment for const declaration
- /// </invalid>
- const string Constant2 = "CONSTANT STRING";
-
- /**
- <summary>
- Javaism comment for const declaration
- </summary>
- */
- const string Constant3 = "CONSTANT STRING";
-
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-011</name>\r
- </assembly>\r
- <members>\r
- <member name="F:Testing.Test.PublicField">\r
- <summary>
- comment for public field
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "F:Testing.Test.PublicField2" -->\r
- <member name="F:Testing.Test.PublicField3">\r
- <summary>
- Javadoc comment for public field
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-011.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- /// <summary>
- /// comment for public field
- /// </summary>
- public string PublicField;
-
- /// <summary>
- /// comment for public field
- /// </invalid>
- public string PublicField2;
-
- /**
- <summary>
- Javadoc comment for public field
- </summary>
- */
- public string PublicField3;
-
- public static void Main ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-012</name>\r
- </assembly>\r
- <members>\r
- <member name="F:Testing.Test.PrivateField">\r
- <summary>
- comment for private field
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "F:Testing.Test.PrivateField2" -->\r
- <member name="F:Testing.Test.PrivateField3">\r
- <summary>
- Javadoc comment for private field
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-012.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// comment for private field
- /// </summary>
- private string PrivateField;
-
- /// <summary>
- /// incorrect markup comment for private field
- /// </incorrect>
- private string PrivateField2;
-
- /**
- <summary>
- Javadoc comment for private field
- </summary>
- */
- private string PrivateField3;
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-013</name>\r
- </assembly>\r
- <members>\r
- <member name="P:Testing.Test.PublicProperty">\r
- <summary>
- comment for public property
- </summary>
- </member>\r
- <!-- Badly formed XML comment ignored for member "P:Testing.Test.PublicProperty2" -->\r
- <member name="P:Testing.Test.PublicProperty3">\r
- <summary>
- Javadoc comment for public property
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-013.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// comment for public property
- /// </summary>
- public string PublicProperty {
- /// <summary>
- /// On public getter - no effect
- /// </summary>
- get { return null; }
- /// <summary>
- /// On public setter - no effect
- /// </summary>
- set { }
- }
-
- /// <summary>
- /// incorrect comment for public property
- /// </incorrect>
- public string PublicProperty2 {
- get { return null; }
- }
-
- /**
- <summary>
- Javadoc comment for public property
- </summary>
- */
- public string PublicProperty3 {
- /**
- <summary>
- On public getter - no effect
- </summary>
- */
- get { return null; }
- /**
- <summary>
- On public setter - no effect
- </summary>
- */
- set { }
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-014</name>\r
- </assembly>\r
- <members>\r
- <member name="P:Testing.Test.PrivateProperty">\r
- <summary>
- comment for private property
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-014.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// comment for private property
- /// </summary>
- private string PrivateProperty {
- get { return null; }
- set { }
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-015</name>\r
- </assembly>\r
- <members>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-015.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- private string PrivateProperty {
- get { return null; }
- /// <summary>
- /// comment for private property setter - no effect
- /// </summary>
- set { }
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-016</name>\r
- </assembly>\r
- <members>\r
- <member name="E:Testing.Test.MyEvent">\r
- <summary>
- public event EventHandler MyEvent
- </summary>
- </member>\r
- <member name="E:Testing.Test.MyEvent2">\r
- private event EventHandler MyEvent; without markup - it is OK.
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-016.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// public event EventHandler MyEvent
- /// </summary>
- public event EventHandler MyEvent;
-
- /// private event EventHandler MyEvent; without markup - it is OK.
- private event EventHandler MyEvent2;
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-017</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Testing.Test.Foo">\r
- comment on method without parameter
- </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)
- </member>\r
- <member name="M:Testing.Test.Foo(System.String[])">\r
- here is a documentation with parameters (and has same name)
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-017.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// comment on method without parameter
- public static void Foo ()
- {
- }
-
- /// here is a documentation with parameters (and has same name)
- public static void Foo (long l, Test t, System.Collections.ArrayList al)
- {
- }
-
- /// here is a documentation with parameters (and has same name)
- public static void Foo (params string [] param)
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-018</name>\r
- </assembly>\r
- <members>\r
- <member name="P:Testing.Test.Item(System.Int32)">\r
- <summary>
- comment for indexer
- </summary>
- </member>\r
- <member name="P:Testing.Test.Item(System.String)">\r
- <summary>
- comment for indexer
- </summary>
- </member>\r
- <member name="P:Testing.Test.Item(System.Int32,Testing.Test)">\r
- <summary>
- comment for indexer wit multiple parameters
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-018.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// comment for indexer
- /// </summary>
- public string this [int i] {
- get { return null; }
- }
-
- /// <summary>
- /// comment for indexer
- /// </summary>
- public string this [string s] {
- get { return null; }
- }
-
- /// <summary>
- /// comment for indexer wit multiple parameters
- /// </summary>
- public string this [int i, Test t] {
- get { return null; }
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-019</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Testing.Test.op_LogicalNot(Testing.Test)">\r
- <summary>
- comment for unary operator
- </summary>
- </member>\r
- <member name="M:Testing.Test.op_Addition(Testing.Test,System.Int32)">\r
- <summary>
- comment for binary operator
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-019.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <summary>
- /// comment for unary operator
- /// </summary>
- public static bool operator ! (Test t)
- {
- return false;
- }
-
- /// <summary>
- /// comment for binary operator
- /// </summary>
- public static int operator + (Test t, int b)
- {
- return b;
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-020</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Testing.Test.#ctor">\r
- comment for constructor
- </member>\r
- <member name="M:Testing.Test.Finalize">\r
- comment for destructor
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-020.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// comment for constructor
- public Test ()
- {
- }
-
- /// comment for destructor
- ~Test ()
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-021</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test.InternalClass">\r
- comment for internal class
- </member>\r
- <member name="T:Testing.Test.InternalStruct">\r
- comment for internal struct
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-021.xml
-using System;
-
-namespace Testing
-{
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// comment for internal class
- public class InternalClass
- {
- }
-
- /// comment for internal struct
- public struct InternalStruct
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-022</name>\r
- </assembly>\r
- <members>\r
- <!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
- <member name="M:Testing.Test2.Foo">\r
- another documentation style (Java-mimic)
- </member>\r
- <member name="T:Testing.StructTest">\r
- testing indentation <summary> test test ;-)
- comment for struct
- </summary>
- </member>\r
- <member name="T:Testing.InterfaceTest">\r
- <summary>
- comment for interface
- </summary>
- </member>\r
- <member name="T:Testing.EnumTest">\r
- <summary>
- comment for enum type
- </summary>
- </member>\r
- <member name="F:Testing.EnumTest.Foo">\r
- <summary>
- comment for enum field
- </summary>
- </member>\r
- <member name="T:Testing.Dummy">\r
- <summary>
- comment for dummy type
- </summary>
- </member>\r
- <member name="T:Testing.MyDelegate">\r
- <summary>
- comment for delegate type
- </summary>
- </member>\r
- <member name="T:Testing.Test">\r
- <summary>
- description for class Test
- </summary>
- </member>\r
- <member name="F:Testing.Test.Constant">\r
- comment for const declaration
- </member>\r
- <member name="F:Testing.Test.BadPublicField">\r
- comment for public field
- </member>\r
- <member name="F:Testing.Test.PrivateField">\r
- comment for private field
- </member>\r
- <member name="M:Testing.Test.Foo">\r
- here is a documentation!!!
- </member>\r
- <member name="M:Testing.Test.Foo(System.Int64,Testing.Test,System.Collections.ArrayList)">\r
- here is a documentation with parameters
- </member>\r
- <member name="M:Testing.Test.op_LogicalNot(Testing.Test)">\r
- <summary>
- comment for unary operator
- </summary>
- </member>\r
- <member name="M:Testing.Test.op_Addition(Testing.Test,System.Int32)">\r
- <summary>
- comment for binary operator
- </summary>
- </member>\r
- <member name="M:Testing.Test.Finalize">\r
- comment for destructor
- </member>\r
- <member name="M:Testing.Test.#ctor">\r
- comment for .ctor()
- </member>\r
- <member name="M:Testing.Test.#ctor(System.String,System.String[])">\r
- comment for .ctor(string arg, string [] args)
- </member>\r
- <member name="P:Testing.Test.PublicProperty">\r
- comment for public property
- </member>\r
- <member name="P:Testing.Test.PrivateProperty">\r
- comment for private property
- </member>\r
- <member name="E:Testing.Test.MyEvent">\r
- public event EventHandler MyEvent ;-)
- </member>\r
- <member name="P:Testing.Test.Item(System.Int32)">\r
- comment for indexer
- </member>\r
- <member name="P:Testing.Test.Item(System.Int32,Testing.Test)">\r
- comment for indexer wit multiple parameters
- </member>\r
- <member name="T:Testing.Test.InternalClass">\r
- comment for internal class
- </member>\r
- <member name="T:Testing.Test.InternalStruct">\r
- comment for internal struct
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-022.xml
-//
-// Combined tests (for detecting incorrect markup targeting).
-//
-using System;
-
-/// <summary>
-/// xml comment is not allowed here.
-/// </summary>
-namespace Testing
-{
- /// <summary>
- /// </incorrect>
- public class Test2
- {
- /**
- another documentation style (Java-mimic)
- */
- public static void Foo ()
- {
- /// here is an extraneous comment
- }
-
- public static void Main ()
- {
- }
- }
-
- /// testing indentation <summary> test test ;-)
- /// comment for struct
- /// </summary>
- public struct StructTest
- {
- }
-
- /// <summary>
- /// comment for interface
- /// </summary>
- public interface InterfaceTest
- {
- }
-
- /// <summary>
- /// comment for enum type
- /// </summary>
- public enum EnumTest
- {
- /// <summary>
- /// comment for enum field
- /// </summary>
- Foo,
- Bar,
- }
-
- /// <summary>
- /// comment for dummy type
- /// </summary>
- public class Dummy {}
-
- /// <summary>
- /// comment for delegate type
- /// </summary>
- public delegate void MyDelegate (object o, EventArgs e);
-
- /// <summary>
- /// description for class Test
- /// </summary>
- public class Test
- {
- /// comment for const declaration
- const string Constant = "CONSTANT STRING";
-
- /// comment for public field
- public string BadPublicField;
-
- /// comment for private field
- private string PrivateField;
-
- /// comment for public property
- public string PublicProperty {
- /// comment for private property getter
- get { return null; }
- }
-
- /// comment for private property
- private string PrivateProperty {
- get { return null; }
- /// comment for private property setter
- set { }
- }
-
- int x;
-
- /// public event EventHandler MyEvent ;-)
- public event EventHandler MyEvent;
-
- int y;
-
- /// here is a documentation!!!
- public static void Foo ()
- {
- }
-
- /// here is a documentation with parameters
- public static void Foo (long l, Test t, System.Collections.ArrayList al)
- {
- }
-
- /// comment for indexer
- public string this [int i] {
- get { return null; }
- }
-
- /// comment for indexer wit multiple parameters
- public string this [int i, Test t] {
- get { return null; }
- }
-
- /// <summary>
- /// comment for unary operator
- /// </summary>
- public static bool operator ! (Test t)
- {
- return false;
- }
-
- /// <summary>
- /// comment for binary operator
- /// </summary>
- public static int operator + (Test t, int b)
- {
- return b;
- }
-
- /// comment for destructor
- ~Test ()
- {
- }
-
- /// comment for .ctor()
- public Test ()
- {
- }
-
- /// comment for .ctor(string arg, string [] args)
- public Test (string arg, string [] args)
- {
- }
-
- /// comment for internal class
- public class InternalClass
- {
- }
-
- /// comment for internal struct
- public struct InternalStruct
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-023</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Test.Foo(Test.A,System.Int32)">\r
- here is a documentation
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-023.xml
- public class Test
- {
- public class A {}
-
- public static void Main ()
- {
- }
-
- /// here is a documentation
- public static void Foo (A a, int x)
- {
- }
- }
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-024</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- <!-- Include tag is invalid --><include/>\r
- </member>\r
- <member name="M:Testing.Test.Main">\r
- <!-- Include tag is invalid --><include file="a"/>\r
- </member>\r
- <member name="M:Testing.Test.Bar(System.Int32)">\r
- <!-- Include tag is invalid --><include path="/foo/bar"/>\r
- </member>\r
- <member name="M:Testing.Test.Baz(System.Int32)">\r
- <!-- Badly formed XML file "c:\cygwin\home\_\cvs\mcs\tests\there-is-no-such-file" cannot be included -->\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-024.xml
-
-namespace Testing
-{
- /// <include/>
- public class Test
- {
- // warning
- /// <include file='a' />
- public static void Main ()
- {
- }
-
- // warning
- /// <include path='/foo/bar' />
- public void Bar (int x)
- {
- }
-
- // warning
- /// <include file='there-is-no-such-file' path='/foo/bar' />
- public void Baz (int x)
- {
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-025</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- <!-- No matching elements were found for the following include tag --><include file="xml-025.inc" path="/foo"/>\r
- </member>\r
- <member name="F:Testing.Test.S1">\r
- <root attr="is attribute allowed?">\r
- includes XML markup.\r
- <child>test</child>\r
- <child>test2</child>\r
-</root>\r
- </member>\r
- <member name="F:Testing.Test.S2">\r
- <child>test</child><child>test2</child>\r
- </member>\r
- <member name="F:Testing.Test.S3">\r
- <!-- Failed to insert some or all of included XML -->\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-025.xml
-
-namespace Testing
-{
- /// <include file='xml-025.inc' path='/foo' />
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <include file='xml-025.inc' path='/root'/>
- public string S1;
-
- /// <include file='xml-025.inc' path='/root/child'/>
- public string S2;
-
- /// <include file='xml-025.inc' path='/root/@attr'/>
- public string S3;
- }
-}
-
+++ /dev/null
-<root attr='is attribute allowed?'>
- includes XML markup.
- <child>test</child>
- <child>test2</child>
-</root>
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-026</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- test class
- </member>\r
- <member name="M:Testing.Test.Foo(System.Int32)">\r
- <param>anonymous</param>
- </member>\r
- <member name="M:Testing.Test.Bar(System.Int32)">\r
- <param name='i'>correct</param>
- <param name='i'>duplicate</param>
- </member>\r
- <member name="M:Testing.Test.Baz(System.Int32)">\r
- <param name='mismatch'>mismatch</param>
- </member>\r
- <member name="M:Testing.Test.Var(System.Int32[])">\r
- <param name='arr'>varargs</param>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-026.xml
-namespace Testing
-{
- /// test class
- public class Test
- {
- public static void Main ()
- {
- }
-
- /// <param>anonymous</param>
- public void Foo (int i) {}
-
- /// <param name='i'>correct</param>
- /// <param name='i'>duplicate</param>
- public void Bar (int i) {}
-
- /// <param name='mismatch'>mismatch</param>
- public void Baz (int i) {}
-
- /// <param name='arr'>varargs</param>
- public void Var (params int [] arr) {}
- }
-}
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-027</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Testing.Test">\r
- <summary>\r
- <see/>\r
- <see cref="!:!!!!!"/>\r
- <see cref="!:nonexist"/>\r
- <see cref="T:Testing.Test"/>\r
- <see cref="T:Testing.Test"/>\r
- <see cref="T:Test"/>\r
- <see cref="_:Test"/>\r
- <see cref="P:Bar"/>\r
- <see cref="F:Bar"/>\r
- <see cref="F:Testing.Test.Bar"/>\r
- <see cref="P:Baz"/>\r
- <see cref="F:Baz"/>\r
- <see cref="P:Testing.Test.Baz"/>\r
- <see cref="!:nonexist.Foo()"/>\r
- <see cref="M:Testing.Test.Foo"/>\r
- <see cref="M:Testing.Test.Foo"/>\r
- <see cref="!:Test.Bar()"/>\r
- <see cref="!:Test.Foo(System.Int32)"/>\r
- </summary>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-027.xml
-using ZZZ = Testing.Test;
-
-namespace Testing
-{
- /// <summary>
- /// <see />
- /// <see cref='!!!!!' />
- /// <see cref='nonexist' />
- /// <see cref='Test' />
- /// <see cref='ZZZ' />
- /// <see cref='T:Test' />
- /// <see cref='_:Test' />
- /// <see cref='P:Bar' />
- /// <see cref='F:Bar' />
- /// <see cref='Bar' />
- /// <see cref='P:Baz' />
- /// <see cref='F:Baz' />
- /// <see cref='Baz' />
- /// <see cref='nonexist.Foo()' />
- /// <see cref='Test.Foo()' />
- /// <see cref='ZZZ.Foo()' />
- /// <see cref='Test.Bar()' />
- /// <see cref='Test.Foo(System.Int32)' />
- /// </summary>
- class Test
- {
- public static void Main () { System.Console.Error.WriteLine ("xml-027 is running fine ;-)"); }
-
- // I don't put any documentation here, but cref still works.
- public void Foo () {}
-
- public string Bar;
-
- public string Baz { get { return ""; } }
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-028</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Test">\r
- <summary>\r
- Partial comment #2\r
- Partial comment #1\r
- </summary>\r
- </member>\r
- <member name="T:Test.Inner">\r
- <summary>\r
- Partial inner class!\r
- ... is still available.\r
- </summary>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-028.xml
-using System;
-
-/// <summary>
-/// Partial comment #2
-public partial class Test
-{
- string Bar;
-
- public static void Main () {}
-
- /// <summary>
- /// Partial inner class!
- internal partial class Inner
- {
- public string Hoge;
- }
-}
-
-/// Partial comment #1
-/// </summary>
-public partial class Test
-{
- public string Foo;
-
- /// ... is still available.
- /// </summary>
- internal partial class Inner
- {
- string Fuga;
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-029</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Test1.Foo">\r
- <summary>
- Some test documentation
- </summary>
- </member>\r
- <member name="T:ITest2">\r
- <summary>
- Publicly available interface
- </summary>
- </member>\r
- <member name="M:ITest2.Foo">\r
- <summary>
- Some test documentation
- </summary>
- </member>\r
- <member name="P:ITest2.Bar">\r
- <summary>
- Some test documentation
- </summary>
- </member>\r
- <member name="E:ITest2.EventRaised">\r
- <summary>
- Some test documentation
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-029.xml
-using System;
-
-class Test1 {
- /// <summary>
- /// Some test documentation
- /// </summary>
- void Foo(){}
-
- public static void Main () {}
-}
-
-/// <summary>
-/// Publicly available interface
-/// </summary>
-public interface ITest2 {
-
- /// <summary>
- /// Some test documentation
- /// </summary>
- void Foo();
-
- /// <summary>
- /// Some test documentation
- /// </summary>
- long Bar { get; }
-
- /// <summary>
- /// Some test documentation
- /// </summary>
- event EventHandler EventRaised;
-}
-
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-030</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Test.foo2">\r
- <summary>\r
- some summary\r
- </summary>\r
- <value>\r
- <see cref="T:Test[]"/>\r
- <see cref="T:System.Text.RegularExpressions.Regex"/>\r
- <see cref="T:System.Text.RegularExpressions.Regex"/>\r
- <see cref="N:System.Text.RegularExpressions"/>\r
- <see cref="T:System.Text.RegularExpressions.Regex[]"/>\r
- </value>\r
- </member>\r
- <member name="M:Test.foo3(System.String,System.Object[])">\r
- <summary>\r
- <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
- <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
- <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
- <see cref="M:System.String.Format(System.String,System.Object[])"/>.\r
- </summary>\r
- <param name="line">The formatting string.</param>\r
- <param name="args">The object array to write into format string.</param>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-030.xml -warn:4 -warnaserror
-using System;
-
-class Test
-{
- static void Main () {}
-
- /// <summary>
- /// some summary
- /// </summary>
- /// <value>
- /// <see cref="T:Test[]"/>
- /// <see cref="T:System.Text.RegularExpressions.Regex"/>
- /// <see cref="System.Text.RegularExpressions.Regex"/>
- /// <see cref="System.Text.RegularExpressions"/>
- /// <see cref="T:System.Text.RegularExpressions.Regex[]"/>
- /// </value>
- //
- // <see cref="T:System.Text.RegularExpressions"/> .. csc incorrectly allows it
- // <see cref="System.Text.RegularExpressions.Regex[]"/> ... csc does not allow it.
- //
- public void foo2() {
- }
-
- /// <summary>
- /// <see cref="String.Format(string, object[])" />.
- /// <see cref="string.Format(string, object[])" />.
- /// <see cref="String.Format(string, object [ ])" />.
- /// <see cref="string.Format(string, object [ ])" />.
- /// </summary>
- /// <param name="line">The formatting string.</param>
- /// <param name="args">The object array to write into format string.</param>
- public void foo3(string line, params object[] args) {
- }
-}
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-031</name>\r
- </assembly>\r
- <members>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-031.xml -warn:4 -warnaserror
-//// Some comment
-////how about this line?
-using System;
-using System.IO;
-
-class Test
-{
- public static void Main ()
- {
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-032</name>\r
- </assembly>\r
- <members>\r
- <member name="M:Test.#ctor(System.String)">\r
- <exception cref="T:System.ArgumentNullException"><paramref name="wrongref"/> is <see langword="null"/>.</exception>\r
- <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="wrongRefAgain"/> is a zero-length <see cref="T:System.String"/>.</exception>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-032.xml -warn:4 -warnaserror
-using System;
-
-class Test
-{
- /// <exception cref="ArgumentNullException"><paramref name="wrongref" /> is <see langword="null" />.</exception>
- /// <exception cref="ArgumentOutOfRangeException"><paramref name="wrongRefAgain" /> is a zero-length <see cref="string" />.</exception>
- protected Test(string name)
- {
- }
-
- static void Main () {}
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-033</name>\r
- </assembly>\r
- <members>\r
- <member name="T:MyClass">\r
- <summary>help text</summary>
- </member>\r
- <member name="M:MyClass.Main">\r
- <summary>help text</summary>
- </member>\r
- <member name="M:MyClass.op_Explicit(MyClass)~System.Int32">\r
- <summary>help text</summary>
- </member>\r
- <member name="M:MyClass.op_Implicit(MyClass)~System.Char">\r
- <summary>help text</summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-033.xml
-
-/// <summary>help text</summary>
-public class MyClass
-{
- /// <summary>help text</summary>
- public static void Main()
- {
- }
-
- /// <summary>help text</summary>
- public static explicit operator int(MyClass f)
- {
- return 0;
- }
-
- /// <summary>help text</summary>
- public static implicit operator char(MyClass f)
- {
- return ' ';
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-034</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Test">\r
- valid comment.
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-034.xml -warn:4 -warnaserror
-using System;
-
-/// valid comment.
-public class Test
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-035</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Test">\r
- <summary>\r
- <see cref="M:System.Data.DataSet.ReadXml(System.Xml.XmlReader,System.Data.XmlReadMode)"/>\r
- <see cref="M:System.Environment.GetFolderPath(System.Environment.SpecialFolder)"/>\r
- </summary>\r
- </member>\r
- <member name="M:Test.Main">\r
- <summary>\r
- <see cref="T:System.Environment.SpecialFolder"/>\r
- </summary>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-035.xml -warn:4 -warnaserror -r:System.Data
-using System;
-using System.Data;
-using System.Xml;
-
-/// <summary>
-/// <see cref="DataSet.ReadXml(XmlReader,XmlReadMode)" />
-/// <see cref="Environment.GetFolderPath(Environment.SpecialFolder)" />
-/// </summary>
-public class Test {
- /// <summary>
- /// <see cref="Environment.SpecialFolder" />
- /// </summary>
- public static void Main() {
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-036</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Test">\r
- <summary><see cref="F:Test.true"/>, <see cref="F:Test.true"/>, <see cref="F:Test.Whatever"/></summary>\r
- </member>\r
- <member name="F:Test.true">\r
- <summary>Yes</summary>\r
- </member>\r
- <member name="F:Test.false">\r
- <summary>Nope</summary>\r
- </member>\r
- <member name="F:Test.Whatever">\r
- <summary>Maybe</summary>\r
- </member>\r
- <member name="T:Foo">\r
- <summary><see cref="M:Foo.true"/></summary>\r
- </member>\r
- <member name="M:Foo.true">\r
- <summary>Foo</summary>\r
- </member>\r
- <member name="M:Foo.Main">\r
- main.\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-036.xml -warn:1 -warnaserror
-/// <summary><see cref="@true" />, <see cref="Test.@true" />, <see cref="@Whatever" /></summary>
-public enum Test {
- /// <summary>Yes</summary>
- @true,
- /// <summary>Nope</summary>
- @false,
- /// <summary>Maybe</summary>
- Whatever
-}
-
-/// <summary><see cref="Foo.@true" /></summary>
-public abstract class Foo {
- /// <summary>Foo</summary>
- public abstract void @true();
- /// main.
- public static void Main() {}
-}
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-037</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Whatever">\r
- <summary>\r
- <see cref="E:System.AppDomain.AssemblyResolve"/>\r
- </summary>\r
- </member>\r
- <member name="M:Whatever.Main">\r
- <summary>
- </summary>
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-037.xml
-using System;
-using System.Reflection;
-
-/// <summary>
-/// <see cref="AppDomain.AssemblyResolve" />
-/// </summary>
-public class Whatever {
- /// <summary>
- /// </summary>
- public static void Main() {
- foreach (MemberInfo mi in typeof (AppDomain).FindMembers (
- MemberTypes.All,
- BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
- Type.FilterName,
- "AssemblyResolve"))
- Console.WriteLine (mi.GetType ());
- }
-}
-
+++ /dev/null
-<?xml version="1.0"?>\r
-<doc>\r
- <assembly>\r
- <name>xml-038</name>\r
- </assembly>\r
- <members>\r
- <member name="T:Whatever">\r
- <summary>\r
- <see cref="E:System.AppDomain.AssemblyResolve"/>\r
- </summary>\r
- </member>\r
- <member name="M:Whatever.Main">\r
- <summary>\r
- </summary>\r
- </member>\r
- </members>\r
-</doc>\r
+++ /dev/null
-// Compiler options: -doc:xml-038.xml
-using System;
-using System.Reflection;
-using System.Xml;
-
-/// <summary>
-/// <see cref="AppDomain.AssemblyResolve" />
-/// </summary>
-public class Whatever {
- /// <summary>
- /// </summary>
- public static void Main() {
- foreach (MemberInfo mi in typeof (XmlDocument).FindMembers (
- MemberTypes.All,
- BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
- Type.FilterName,
- "NodeInserted"))
- Console.WriteLine (mi.GetType ());
- }
-}
-
+++ /dev/null
-using System;
-using System.Collections;
-using System.Xml;
-
-public class Test
-{
- public class ComparisonException : Exception
- {
- public ComparisonException (string message)
- : base (message)
- {
- }
- }
-
- static bool debug = false;
- static bool error = false;
-
- public static void Main (string [] args)
- {
- if (args.Length < 2) {
- Console.Error.WriteLine ("Usage: xmldocdiff [reference_output.xml] [actual_output.xml]");
- return;
- }
- if (args.Length > 2 && args [2].EndsWith ("-debug"))
- debug = true;
-
- try {
- Run (args);
- } catch (Exception ex) {
- Console.WriteLine ("FAIL: " + args [1]);
- throw ex;
- }
- Console.WriteLine ("PASS: " + args [1]);
- }
-
- private static void Run (string [] args)
- {
- XmlDocument doc1 = new XmlDocument ();
- doc1.Load (args [0]);
- XmlDocument doc2 = new XmlDocument ();
- doc2.Load (args [1]);
-
- XmlNodeList memberList1 = doc1.SelectNodes ("/doc/members/member");
- XmlNodeList memberList2 = doc2.SelectNodes ("/doc/members/member");
-
- Hashtable namedItems = new Hashtable ();
-
- foreach (XmlElement el in memberList1)
- namedItems.Add (el.GetAttribute ("name"), el);
- foreach (XmlElement el2 in memberList2) {
- string name = el2.GetAttribute ("name");
- XmlElement el1 = namedItems [name] as XmlElement;
- if (el1 == null) {
- Report ("Extraneous element found. Name is '{0}'", name);
- continue;
- }
- namedItems.Remove (name);
-
- CompareNodes (el1, el2);
-
- }
- foreach (string name in namedItems.Keys)
- Report ("Expected comment was not found. Name is {0}, XML is {1}", name, ((XmlElement) namedItems [name]).OuterXml);
-
- // finally, check other nodes than members
- doc1.SelectSingleNode ("/doc/members").RemoveAll ();
- doc2.SelectSingleNode ("/doc/members").RemoveAll ();
- string xml1 = doc1.OuterXml.Replace ("\r", "").Trim ();
- string xml2 = doc2.OuterXml.Replace ("\r", "").Trim ();
- if (xml1 != xml2)
- Report (@"Either of doc, assembly, name, members elements are different.
-doc1: {0}
-doc2: {1}", xml1, xml2);
- }
-
- private static void CompareNodes (XmlNode n1, XmlNode n2)
- {
- if (n2 == null) {
- Report (@"Nodes does not exist:
-Node1: {0}", n1.OuterXml);
- return;
- }
- if (n1.NodeType != n2.NodeType) {
- Report (@"Nodes differ:
-Node1: {0}
-Node2: {1}", n1.OuterXml, n2.OuterXml);
- return;
- }
- if (n1.Name != n2.Name) {
- Report (@"Node names differ:
-Node1: {0}
-Node2: {1}", n1.OuterXml, n2.OuterXml);
- return;
- }
- if (n1 is XmlElement) {
- for (int i = 0; i < n1.Attributes.Count; i++)
- CompareNodes (n1.Attributes [i],
- n2.Attributes [i]);
- for (int i = 0; i < n1.ChildNodes.Count; i++)
- CompareNodes (n1.ChildNodes [i],
- n2.ChildNodes [i]);
- }
- if (n1.NodeType != XmlNodeType.Comment && n1.Value != null) {
- string v1 = n1.Value.Trim ().Replace ("\r", "");
- string v2 = n2.Value.Trim ().Replace ("\r", "");
- if (v1 != v2)
- Report (@"Node values differ:
-Node1: {0}
-Node2: {1}", v1, v2);
- }
- }
-
- static void Report (string format, params object [] args)
- {
- error = true;
- if (debug)
- Console.WriteLine (format, args);
- else
- throw new ComparisonException (String.Format (format, args));
- }
-}
-
+2005-06-06 Ben Maurer <bmaurer@ximian.com>
+
+ * Makefile: Depreciate mono-rpm-helpers
+
+2005-06-06 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile (net_2_0_SUBDIRS): Add 'compiler-tester'.
+
+2005-06-06 Marek Safar <marek.safar@seznam.cz>
+
+ * Makefile: Added compiler-tester.
+
2005-05-31 Joanthan Pryor <jonpryor@vt.edu>
* Makefile (SUBDIRS): Add mono-shlib-cop to the build.
thisdir = tools
SUBDIRS = \
al cilc corcompare ictool mono-xsd security wsdl genxs sqlsharp \
- disco soapsuds browsercaps-updater monop gacutil mono-rpm-helpers \
+ disco soapsuds browsercaps-updater monop gacutil \
resgen macpack mkbundle dtd2xsd mjs prj2make mono-service \
- mono-shlib-cop
+ mono-shlib-cop compiler-tester
net_1_1_bootstrap_SUBDIRS = gacutil security
-net_2_0_SUBDIRS = corcompare wsdl
+net_2_0_SUBDIRS = corcompare wsdl compiler-tester
include ../build/rules.make
--- /dev/null
+2005-06-09 Marek Safar <marek.safar@seznam.cz>
+
+ * compiler-tester: Add process test runner to cope with
+ too many files in AppDomain(s).
+
+2005-06-06 Raja R Harinath <harinath@gmail.com>
+
+ * Makefile (NO_INSTALL): Set.
+
+2005-06-06 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile: Convert to use executable.make.
+ * compiler-tester.exe.sources: New.
+
+2005-06-06 Marek Safar <marek.safar@seznam.cz>
+
+ * Initial commit
+
--- /dev/null
+thisdir = tools/compiler-tester
+SUBDIRS =
+include ../../build/rules.make
+
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
+NO_INSTALL = yes
+
+include $(topdir)/build/executable.make
--- /dev/null
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Reflection;
+using System.Text;
+using System.Collections;
+
+namespace TestRunner {
+
+ interface ITester
+ {
+ string Output { get; }
+ bool Invoke (string[] args);
+ }
+
+ class ReflectionTester: ITester {
+ MethodInfo ep;
+ object[] method_arg;
+ StringWriter output;
+
+ public ReflectionTester (Assembly a)
+ {
+ ep = a.GetType ("Mono.CSharp.CompilerCallableEntryPoint").GetMethod ("InvokeCompiler",
+ BindingFlags.Static | BindingFlags.Public);
+ if (ep == null)
+ throw new MissingMethodException ("static InvokeCompiler");
+ method_arg = new object [2];
+ }
+
+ public string Output {
+ get {
+ return output.GetStringBuilder ().ToString ();
+ }
+ }
+
+ public bool Invoke(string[] args)
+ {
+ output = new StringWriter ();
+ method_arg [0] = args;
+ method_arg [1] = output;
+ return (bool)ep.Invoke (null, method_arg);
+ }
+ }
+
+ class ProcessTester: ITester
+ {
+ ProcessStartInfo pi;
+ string output;
+
+ public ProcessTester (string p_path)
+ {
+ pi = new ProcessStartInfo ();
+ pi.FileName = p_path;
+ pi.CreateNoWindow = true;
+ pi.WindowStyle = ProcessWindowStyle.Hidden;
+ pi.RedirectStandardOutput = true;
+ pi.RedirectStandardError = true;
+ pi.UseShellExecute = false;
+ }
+
+ public string Output {
+ get {
+ return output;
+ }
+ }
+
+ public bool Invoke(string[] args)
+ {
+ StringBuilder sb = new StringBuilder ("/nologo ");
+ foreach (string s in args) {
+ sb.Append (s);
+ sb.Append (" ");
+ }
+ pi.Arguments = sb.ToString ();
+ Process p = Process.Start (pi);
+ output = p.StandardError.ReadToEnd ();
+ if (output.Length == 0)
+ output = p.StandardOutput.ReadToEnd ();
+ p.WaitForExit ();
+ return p.ExitCode == 0;
+ }
+ }
+
+ class Checker: IDisposable
+ {
+ protected ITester tester;
+ protected int success;
+ protected int total;
+ protected int ignored;
+ string issue_file;
+ StreamWriter log_file;
+ protected string[] compiler_options;
+
+ protected ArrayList regression = new ArrayList ();
+ protected ArrayList know_issues = new ArrayList ();
+ protected ArrayList ignore_list = new ArrayList ();
+ protected ArrayList no_error_list = new ArrayList ();
+
+ protected Checker (ITester tester, string log_file, string issue_file)
+ {
+ this.tester = tester;
+ this.issue_file = issue_file;
+ ReadWrongErrors (issue_file);
+ this.log_file = new StreamWriter (log_file, false);
+ }
+
+ protected virtual bool GetExtraOptions (string file)
+ {
+ int row = 0;
+ using (StreamReader sr = new StreamReader (file)) {
+ String line;
+ while (row++ < 3 && (line = sr.ReadLine()) != null) {
+ if (!AnalyzeTestFile (row, line))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected virtual bool AnalyzeTestFile (int row, string line)
+ {
+ const string options = "// Compiler options:";
+
+ if (row == 1)
+ compiler_options = null;
+
+ int index = line.IndexOf (options);
+ if (index != -1) {
+ compiler_options = line.Substring (index + options.Length).Trim().Split (' ');
+ for (int i = 0; i < compiler_options.Length; i++)
+ compiler_options[i] = compiler_options[i].TrimStart ();
+ }
+ return true;
+ }
+
+ public void Do (string filename)
+ {
+ Log (filename);
+ Log ("...\t");
+
+ if (ignore_list.Contains (filename)) {
+ ++ignored;
+ LogLine ("NOT TESTED");
+ return;
+ }
+
+ if (!GetExtraOptions (filename)) {
+ return;
+ }
+
+ ++total;
+ Check (filename);
+ }
+
+ protected virtual bool Check (string filename)
+ {
+ string[] test_args;
+
+ if (compiler_options != null) {
+ test_args = new string [1 + compiler_options.Length];
+ compiler_options.CopyTo (test_args, 0);
+ } else {
+ test_args = new string [1];
+ }
+ test_args [test_args.Length - 1] = filename;
+
+ return tester.Invoke (test_args);
+ }
+
+
+ void ReadWrongErrors (string file)
+ {
+ const string ignored = "IGNORE";
+ const string no_error = "NO ERROR";
+
+ using (StreamReader sr = new StreamReader (file)) {
+ string line;
+ while ((line = sr.ReadLine()) != null) {
+ if (line.StartsWith ("#"))
+ continue;
+
+ ArrayList active_cont = know_issues;
+
+ if (line.IndexOf (ignored) > 0)
+ active_cont = ignore_list;
+ else if (line.IndexOf (no_error) > 0)
+ active_cont = no_error_list;
+
+ string file_name = line.Split (' ')[0];
+ if (file_name.Length == 0)
+ continue;
+
+ active_cont.Add (file_name);
+ }
+ }
+ }
+
+ public void PrintSummary ()
+ {
+ LogLine ("Done" + Environment.NewLine);
+ LogLine ("{0} test cases passed ({1:.##%})", success, (float) (success) / (float)total);
+
+ if (ignored > 0)
+ LogLine ("{0} test cases ignored", ignored);
+
+ know_issues.AddRange (no_error_list);
+ if (know_issues.Count > 0) {
+ LogLine ("");
+ LogLine (issue_file + " contains {0} already fixed issues. Please remove", know_issues.Count);
+ foreach (string s in know_issues)
+ LogLine (s);
+ }
+ if (regression.Count > 0) {
+ LogLine ("");
+ LogLine ("The latest changes caused regression in {0} file(s)", regression.Count);
+ foreach (string s in regression)
+ LogLine (s);
+ }
+ }
+
+ public int ResultCode
+ {
+ get {
+ return regression.Count == 0 ? 0 : 1;
+ }
+ }
+
+ protected void Log (string msg, params object [] rest)
+ {
+ Console.Write (msg, rest);
+ log_file.Write (msg, rest);
+ }
+
+ protected void LogLine (string msg, params object [] rest)
+ {
+ Console.WriteLine (msg, rest);
+ log_file.WriteLine (msg, rest);
+ }
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ log_file.Close ();
+ }
+
+ #endregion
+ }
+
+ class PositiveChecker: Checker {
+ readonly string files_folder;
+ readonly static object[] default_args = new object[1] { new string[] {} };
+ string doc_output;
+
+ // When we cannot load assembly to domain we are automaticaly switching to process calling
+ bool appdomain_limit_reached;
+
+ ProcessStartInfo pi;
+ readonly string mono;
+
+ // This is really pain
+ // This number is highly experimental on my box I am not able to load more than 1000 files to domain
+ // Every files is there twice and we need some space for tests which reference assemblies
+ const int MAX_TESTS_IN_DOMAIN = 420;
+ int test_counter;
+
+ protected enum TestResult {
+ CompileError,
+ ExecError,
+ LoadError,
+ XmlError,
+ Success
+ }
+
+ public PositiveChecker (ITester tester, string log_file, string issue_file):
+ base (tester, log_file, issue_file)
+ {
+ files_folder = Directory.GetCurrentDirectory ();
+
+ pi = new ProcessStartInfo ();
+ pi.CreateNoWindow = true;
+ pi.WindowStyle = ProcessWindowStyle.Hidden;
+ pi.RedirectStandardOutput = true;
+ pi.RedirectStandardError = true;
+ pi.UseShellExecute = false;
+
+ mono = Environment.GetEnvironmentVariable ("MONO_RUNTIME");
+ if (mono != null) {
+ pi.FileName = mono;
+ }
+ }
+
+ protected override bool GetExtraOptions(string file) {
+ if (!base.GetExtraOptions (file))
+ return false;
+
+ doc_output = null;
+ if (compiler_options == null)
+ return true;
+
+ foreach (string one_opt in compiler_options) {
+ if (one_opt.StartsWith ("-doc:")) {
+ doc_output = one_opt.Split (':')[1];
+ }
+ }
+ return true;
+ }
+
+ protected override bool Check(string filename) {
+ try {
+ if (!base.Check (filename)) {
+ HandleFailure (filename, TestResult.CompileError, tester.Output);
+ return false;
+ }
+ }
+ catch (Exception e) {
+ HandleFailure (filename, TestResult.CompileError, e.ToString ());
+ return false;
+ }
+
+ // Test setup
+ if (filename.EndsWith ("-lib.cs") || filename.EndsWith ("-mod.cs")) {
+ LogLine ("OK");
+ --total;
+ return true;
+ }
+
+ MethodInfo mi = null;
+ string file = Path.Combine (files_folder, Path.GetFileNameWithoutExtension (filename) + ".exe");
+ if (!appdomain_limit_reached) {
+ try {
+ mi = Assembly.LoadFile (file).EntryPoint;
+ if (test_counter++ > MAX_TESTS_IN_DOMAIN)
+ appdomain_limit_reached = true;
+ }
+ catch (FileNotFoundException) {
+ if (File.Exists (file)) {
+ Console.WriteLine ("APPDOMAIN LIMIT REACHED");
+ appdomain_limit_reached = true;
+ }
+ }
+ catch (Exception e) {
+ HandleFailure (filename, TestResult.LoadError, e.ToString ());
+ return false;
+ }
+ }
+
+ if (appdomain_limit_reached) {
+ if (!ExecuteFile (file, filename))
+ return false;
+ } else {
+ if (!ExecuteFile (mi, filename))
+ return false;
+ }
+
+ if (doc_output != null) {
+ string ref_file = filename.Replace (".cs", "-ref.xml");
+ try {
+ XmlComparer.Compare (ref_file, doc_output);
+ }
+ catch (Exception e) {
+ HandleFailure (filename, TestResult.XmlError, e.Message);
+ return false;
+ }
+ }
+
+ HandleFailure (filename, TestResult.Success, null);
+ return true;
+ }
+
+ bool ExecuteFile (string exe_name, string filename)
+ {
+ if (mono == null)
+ pi.FileName = exe_name;
+ else
+ pi.Arguments = exe_name;
+
+ Process p = Process.Start (pi);
+ p.WaitForExit ();
+
+ // TODO: How can I recognize return type void ?
+ if (p.ExitCode == 0)
+ return true;
+
+ HandleFailure (filename, TestResult.ExecError, "Wrong return code: " + p.ExitCode.ToString ());
+ return false;
+ }
+
+ bool ExecuteFile (MethodInfo entry_point, string filename)
+ {
+ TextWriter standart_ouput = Console.Out;
+ TextWriter standart_error = Console.Error;
+ Console.SetOut (TextWriter.Null);
+ Console.SetError (TextWriter.Null);
+ ParameterInfo[] pi = entry_point.GetParameters ();
+ object[] args = pi.Length == 0 ? null : default_args;
+
+ object result = null;
+ try {
+ result = entry_point.Invoke (null, args);
+ Console.SetOut (standart_ouput);
+ Console.SetError (standart_error);
+ }
+ catch (Exception e) {
+ Console.SetOut (standart_ouput);
+ Console.SetError (standart_error);
+ HandleFailure (filename, TestResult.ExecError, e.ToString ());
+ return false;
+ }
+
+ if (result is int && (int)result != 0) {
+ HandleFailure (filename, TestResult.ExecError, "Wrong return code: " + result.ToString ());
+ return false;
+ }
+ return true;
+ }
+
+ void HandleFailure (string file, TestResult status, string extra)
+ {
+ switch (status) {
+ case TestResult.Success:
+ success++;
+ if (know_issues.Contains (file)) {
+ LogLine ("FIXED ISSUE");
+ return;
+ }
+ LogLine ("OK");
+ return;
+
+ case TestResult.CompileError:
+ if (know_issues.Contains (file)) {
+ LogLine ("KNOWN ISSUE (Compilation error)");
+ know_issues.Remove (file);
+ return;
+ }
+ LogLine ("REGRESSION (SUCCESS -> COMPILATION ERROR)");
+ break;
+
+ case TestResult.ExecError:
+ if (know_issues.Contains (file)) {
+ LogLine ("KNOWN ISSUE (Execution error)");
+ know_issues.Remove (file);
+ return;
+ }
+ LogLine ("REGRESSION (SUCCESS -> EXECUTION ERROR)");
+ break;
+
+ case TestResult.XmlError:
+ if (know_issues.Contains (file)) {
+ LogLine ("KNOWN ISSUE (Xml comparision error)");
+ know_issues.Remove (file);
+ return;
+ }
+ LogLine ("REGRESSION (SUCCESS -> DOCUMENTATION ERROR)");
+ break;
+
+ case TestResult.LoadError:
+ LogLine ("REGRESSION (SUCCESS -> LOAD ERROR)");
+ break;
+ }
+
+ if (extra != null)
+ LogLine (extra);
+
+ regression.Add (file);
+ }
+ }
+
+ class NegativeChecker: Checker
+ {
+ string expected_message;
+ string error_message;
+
+ protected enum CompilerError {
+ Expected,
+ Wrong,
+ Missing,
+ WrongMessage
+ }
+
+ public NegativeChecker (ITester tester, string log_file, string issue_file):
+ base (tester, log_file, issue_file)
+ {
+ }
+
+ protected override bool AnalyzeTestFile(int row, string line)
+ {
+ if (row == 1) {
+ expected_message = null;
+
+ int index = line.IndexOf (':');
+ if (index == -1 || index > 15) {
+ LogLine ("IGNORING: Wrong test file syntax (missing error mesage text)");
+ ++ignored;
+ base.AnalyzeTestFile (row, line);
+ return false;
+ }
+
+ expected_message = line.Substring (index + 1).Trim ();
+ }
+
+ return base.AnalyzeTestFile (row, line);
+ }
+
+
+ protected override bool Check (string filename)
+ {
+ int start_char = 0;
+ while (Char.IsLetter (filename, start_char))
+ ++start_char;
+
+ int end_char = filename.IndexOfAny (new char [] { '-', '.' } );
+ string expected = filename.Substring (start_char, end_char - start_char);
+
+ try {
+ if (base.Check (filename)) {
+ HandleFailure (filename, CompilerError.Missing);
+ return false;
+ }
+ }
+ catch (Exception e) {
+ HandleFailure (filename, CompilerError.Missing);
+ Log (e.ToString ());
+ return false;
+ }
+
+ CompilerError result_code = GetCompilerError (expected, tester.Output);
+ if (HandleFailure (filename, result_code)) {
+ success++;
+ return true;
+ }
+
+ if (result_code == CompilerError.Wrong)
+ LogLine (tester.Output);
+
+ return false;
+ }
+
+ CompilerError GetCompilerError (string expected, string buffer)
+ {
+ const string error_prefix = "CS";
+ const string ignored_error = "error CS5001";
+ string tested_text = "error " + error_prefix + expected;
+ StringReader sr = new StringReader (buffer);
+ string line = sr.ReadLine ();
+ bool any_error = false;
+ while (line != null) {
+
+ if (line.IndexOf (tested_text) != -1) {
+// string msg = line.Substring (line.IndexOf (':', 22) + 1).TrimEnd ('.').Trim ();
+// if (msg != expected_message && msg != expected_message.Replace ('`', '\'')) {
+// error_message = msg;
+// return CompilerError.WrongMessage;
+// }
+ return CompilerError.Expected;
+ }
+
+ if (line.IndexOf (error_prefix) != -1 &&
+ line.IndexOf (ignored_error) == -1)
+ any_error = true;
+
+ line = sr.ReadLine ();
+ }
+
+ return any_error ? CompilerError.Wrong : CompilerError.Missing;
+ }
+
+ bool HandleFailure (string file, CompilerError status)
+ {
+ switch (status) {
+ case CompilerError.Expected:
+ if (know_issues.Contains (file) || no_error_list.Contains (file)) {
+ LogLine ("FIXED ISSUE");
+ return true;
+ }
+ LogLine ("OK");
+ return true;
+
+ case CompilerError.Wrong:
+ if (know_issues.Contains (file)) {
+ LogLine ("KNOWN ISSUE (Wrong error reported)");
+ know_issues.Remove (file);
+ return false;
+ }
+ if (no_error_list.Contains (file)) {
+ LogLine ("REGRESSION (NO ERROR -> WRONG ERROR CODE)");
+ no_error_list.Remove (file);
+ }
+ else {
+ LogLine ("REGRESSION (CORRECT ERROR -> WRONG ERROR CODE)");
+ }
+ break;
+
+ case CompilerError.WrongMessage:
+ if (know_issues.Contains (file)) {
+ LogLine ("KNOWN ISSUE (Wrong error message reported)");
+ know_issues.Remove (file);
+ return false;
+ }
+ if (no_error_list.Contains (file)) {
+ LogLine ("REGRESSION (NO ERROR -> WRONG ERROR MESSAGE)");
+ no_error_list.Remove (file);
+ }
+ else {
+ LogLine ("REGRESSION (CORRECT ERROR -> WRONG ERROR MESSAGE)");
+ Console.WriteLine ("E: {0}", expected_message);
+ Console.WriteLine ("W: {0}", error_message);
+ }
+ break;
+
+ case CompilerError.Missing:
+ if (no_error_list.Contains (file)) {
+ LogLine ("KNOWN ISSUE (No error reported)");
+ no_error_list.Remove (file);
+ return false;
+ }
+
+ if (know_issues.Contains (file)) {
+ LogLine ("REGRESSION (WRONG ERROR -> NO ERROR)");
+ know_issues.Remove (file);
+ }
+ else {
+ LogLine ("REGRESSION (CORRECT ERROR -> NO ERROR)");
+ }
+
+ break;
+ }
+
+ regression.Add (file);
+ return false;
+ }
+ }
+
+ class Tester {
+
+ static int Main(string[] args) {
+ if (args.Length != 5) {
+ Console.Error.WriteLine ("Usage: TestRunner [negative|positive] test-pattern compiler know-issues log-file");
+ return 1;
+ }
+
+ string mode = args[0].ToLower ();
+ string test_pattern = args [1];
+ string mcs = args [2];
+ string issue_file = args [3];
+ string log_fname = args [4];
+
+ string[] files = Directory.GetFiles (".", test_pattern);
+
+ ITester tester;
+ try {
+ Console.WriteLine ("Loading: " + mcs);
+ tester = new ReflectionTester (Assembly.LoadFile (mcs));
+ }
+ catch (Exception) {
+ Console.Error.WriteLine ("Switching to command line mode (compiler entry point was not found)");
+ if (!File.Exists (mcs)) {
+ Console.Error.WriteLine ("ERROR: Tested compiler was not found");
+ return 1;
+ }
+ tester = new ProcessTester (mcs);
+ }
+
+ Checker checker;
+ switch (mode) {
+ case "negative":
+ checker = new NegativeChecker (tester, log_fname, issue_file);
+ break;
+ case "positive":
+ checker = new PositiveChecker (tester, log_fname, issue_file);
+ break;
+ default:
+ Console.Error.WriteLine ("You must specify testing mode (positive or negative)");
+ return 1;
+ }
+
+ foreach (string s in files) {
+ string filename = Path.GetFileName (s);
+ if (Char.IsUpper (filename, 0)) { // Windows hack
+ continue;
+ }
+
+ if (filename.EndsWith ("-p2.cs"))
+ continue;
+
+ checker.Do (filename);
+ }
+
+ checker.PrintSummary ();
+
+ checker.Dispose ();
+
+ return checker.ResultCode;
+ }
+ }
+}
--- /dev/null
+compiler-tester.cs
+xmldocdiff.cs
--- /dev/null
+using System;\r
+using System.Collections;\r
+using System.Xml;\r
+\r
+public class XmlComparer\r
+{\r
+ public class ComparisonException : Exception\r
+ {\r
+ public ComparisonException (string message)\r
+ : base (message)\r
+ {\r
+ }\r
+ }\r
+\r
+ static bool debug = false;\r
+/*\r
+\r
+ public static void Main (string [] args)\r
+ {\r
+ if (args.Length < 2) {\r
+ Console.Error.WriteLine ("Usage: xmldocdiff [reference_output.xml] [actual_output.xml]");\r
+ return;\r
+ }\r
+ if (args.Length > 2 && args [2].EndsWith ("-debug"))\r
+ debug = true;\r
+\r
+ try {\r
+ Run (args[0], args[1]);\r
+ } catch (Exception ex) {\r
+ Console.WriteLine ("FAIL: " + args [1]);\r
+ throw ex;\r
+ }\r
+ Console.WriteLine ("PASS: " + args [1]);\r
+ }\r
+*/\r
+ public static void Compare (string reference, string output)\r
+ {\r
+ XmlDocument doc1 = new XmlDocument ();\r
+ doc1.Load (reference);\r
+ XmlDocument doc2 = new XmlDocument ();\r
+ doc2.Load (output);\r
+\r
+ XmlNodeList memberList1 = doc1.SelectNodes ("/doc/members/member");\r
+ XmlNodeList memberList2 = doc2.SelectNodes ("/doc/members/member");\r
+\r
+ Hashtable namedItems = new Hashtable ();\r
+\r
+ foreach (XmlElement el in memberList1)\r
+ namedItems.Add (el.GetAttribute ("name"), el);\r
+ foreach (XmlElement el2 in memberList2) {\r
+ string name = el2.GetAttribute ("name");\r
+ XmlElement el1 = namedItems [name] as XmlElement;\r
+ if (el1 == null) {\r
+ Report ("Extraneous element found. Name is '{0}'", name);\r
+ continue;\r
+ }\r
+ namedItems.Remove (name);\r
+\r
+ CompareNodes (el1, el2);\r
+\r
+ }\r
+ foreach (string name in namedItems.Keys)\r
+ Report ("Expected comment was not found. Name is {0}, XML is {1}", name, ((XmlElement) namedItems [name]).OuterXml);\r
+\r
+ // finally, check other nodes than members\r
+ doc1.SelectSingleNode ("/doc/members").RemoveAll ();\r
+ doc2.SelectSingleNode ("/doc/members").RemoveAll ();\r
+ string xml1 = doc1.OuterXml.Replace ("\r", "").Trim ();\r
+ string xml2 = doc2.OuterXml.Replace ("\r", "").Trim ();\r
+ if (xml1 != xml2)\r
+ Report (@"Either of doc, assembly, name, members elements are different.\r
+doc1: {0}\r
+doc2: {1}", xml1, xml2);\r
+ }\r
+\r
+ private static void CompareNodes (XmlNode n1, XmlNode n2)\r
+ {\r
+ if (n2 == null) {\r
+ Report (@"Nodes does not exist:\r
+Node1: {0}", n1.OuterXml);\r
+ return;\r
+ }\r
+ if (n1.NodeType != n2.NodeType) {\r
+ Report (@"Nodes differ:\r
+Node1: {0}\r
+Node2: {1}", n1.OuterXml, n2.OuterXml);\r
+ return;\r
+ }\r
+ if (n1.Name != n2.Name) {\r
+ Report (@"Node names differ:\r
+Node1: {0}\r
+Node2: {1}", n1.OuterXml, n2.OuterXml);\r
+ return;\r
+ }\r
+ if (n1 is XmlElement) {\r
+ for (int i = 0; i < n1.Attributes.Count; i++)\r
+ CompareNodes (n1.Attributes [i],\r
+ n2.Attributes [i]);\r
+ for (int i = 0; i < n1.ChildNodes.Count; i++)\r
+ CompareNodes (n1.ChildNodes [i],\r
+ n2.ChildNodes [i]);\r
+ }\r
+ if (n1.NodeType != XmlNodeType.Comment && n1.Value != null) {\r
+ string v1 = n1.Value.Trim ().Replace ("\r", "");\r
+ string v2 = n2.Value.Trim ().Replace ("\r", "");\r
+ if (v1 != v2)\r
+ Report (@"Node values differ:\r
+Node1: {0}\r
+Node2: {1}", v1, v2);\r
+ }\r
+ }\r
+\r
+ static void Report (string format, params object [] args)\r
+ {\r
+ if (debug)\r
+ Console.WriteLine (format, args);\r
+ else\r
+ throw new ComparisonException (String.Format (format, args));\r
+ }\r
+}\r
+\r
+2005-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono-api-info.cs: exclude the ReservedMask bits from method
+ attributes.
+
2005-06-01 Ben Maurer <bmaurer@ximian.com>
* mono-api-info.cs: Hack to support generics better
protected override string GetMemberAttributes (MemberInfo member)
{
MethodBase method = (MethodBase) member;
- return ((int) method.Attributes).ToString (CultureInfo.InvariantCulture);
+ return ((int)( method.Attributes & ~MethodAttributes.ReservedMask)).ToString (CultureInfo.InvariantCulture);
}
protected override void AddExtraData (XmlNode p, MemberInfo member)
+++ /dev/null
-2004-11-26 Raja R Harinath <rharinath@novell.com>
-
- * Makefile (dist-local): Use the default dist rules.
-
-2004-09-02 Duncan Mak <duncan@ximian.com>
-
- * mono-find-provides/mono-find-provides.cs (PrintProvides): Fix
- the handling of 2.0 mscorlib.
-
-2004-08-10 Duncan Mak <duncan@ximian.com>
-
- * mono-find-requires/mono-find-requires.cs (PrintRequires): Since
- assembly versions are not changing with releases, use "=" instead
- of ">=" to ensure that 2.0 packages will not be picked over 1.0 packages.
-
-2004-08-04 Duncan Mak <duncan@ximian.com>
-
- * mono-find-provides/mono-find-provides.cs: Add a hack to work
- around the issue with a 2.0 corlib.
-
-2004-06-01 Todd Berman <tberman@sevenl.net>
-
- * all: move stuff around so that it builds properly.
- build system cant handle building two exes from one directory.
-
-2004-05-27 Duncan Mak <duncan@ximian.com>
-
- * mono-find-provides.cs
- * mono-find-requires.cs: Added. These are
- helper tools to help RPM packaging.
+++ /dev/null
-thisdir = tools/mono-rpm-helpers
-SUBDIRS = mono-find-provides mono-find-requires
-
-include ../../build/rules.make
-
-all-local install-local test-local run-test-local run-test-ondotnet-local clean-local uninstall-local:
-
-dist-local: dist-default
+++ /dev/null
-thisdir = tools/mono-rpm-helpers/mono-find-provides
-SUBDIRS =
-include ../../../build/rules.make
-
-PROGRAM = mono-find-provides.exe
-
-include ../../../build/executable.make
+++ /dev/null
-//
-// mono-find-provides.cs - Prints out an assembly's name and version
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// 2004 Copyright Novell Inc.
-//
-
-using System;
-using System.Reflection;
-
-namespace Mono {
-class FindProvides {
-
- static void Main (string [] args)
- {
- if (args.Length == 0) {
- string s = Console.ReadLine ();
-
- while (s != null) {
- PrintProvides (s);
- s = Console.ReadLine ();
- }
-
- } else {
- foreach (string s in args)
- PrintProvides (s);
- }
- }
-
- static void PrintProvides (string s)
- {
- try {
- Assembly a = Assembly.LoadFrom (s);
- AssemblyName an = a.GetName ();
-
- // hack to work around the issue with a 2.0 corlib
- if (s.Trim ().EndsWith ("2.0/mscorlib.dll"))
- Console.WriteLine ("mono({0}) = {1}", "mscorlib", "2.0.3600.0");
- else
- Console.WriteLine ("mono({0}) = {1}", an.Name, an.Version);
-
- } catch {}
- }
-}
-}
+++ /dev/null
-mono-find-provides.cs
+++ /dev/null
-thisdir = tools/mono-rpm-helpers/mono-find-requires
-SUBDIRS =
-include ../../../build/rules.make
-
-PROGRAM = mono-find-requires.exe
-
-include ../../../build/executable.make
+++ /dev/null
-//
-// mono-find-requires.cs - Prints out referenced assembles
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// 2004 Copyright Novell Inc.
-//
-
-using System;
-using System.Reflection;
-
-namespace Mono {
-class FindRequires {
-
- static void Main (string [] args)
- {
- if (args.Length == 0) {
- string s = Console.ReadLine ();
-
- while (s != null) {
- PrintRequires (s);
- s = Console.ReadLine ();
- }
-
- } else {
- foreach (string s in args)
- PrintRequires (s);
- }
- }
-
- static void PrintRequires (string s)
- {
- try {
- Assembly a = Assembly.LoadFrom (s);
-
- foreach (AssemblyName an in a.GetReferencedAssemblies ())
- Console.WriteLine ("mono({0}) = {1}", an.Name, an.Version);
-
- } catch {}
- }
-}
-}
+++ /dev/null
-mono-find-requires.cs
+2005-06-10 Joerg Rosenkranz <joergr@voelcker.com>
+
+ * mono-service.cs: Removed AutoResetEvent code from signal
+ handler because it was unsafe and not guaranteed to work.
+ Use polling in main loop instead.
+ Use signal functions from Mono.Unix instead of self defined ones.
+
2005-06-01 Raja R Harinath <rharinath@novell.com>
* mono-service.cs (MonoServiceRunner.Main): Replace LockFlags with
Environment.Exit (1);
}
- delegate void sighandler_t (int arg);
-
- AutoResetEvent signal_event;
-
- [DllImport ("libc")]
- extern static int signal (int signum, sighandler_t handler);
-
int signum;
void my_handler (int sig)
{
signum = sig;
- signal_event.Set ();
}
static void call (object o, string method, object [] arg)
public int StartService ()
{
try {
- //
- // Setup signals
- //
- signal_event = new AutoResetEvent (false);
-
// Invoke all the code used in the signal handler, so the JIT does
// not kick-in inside the signal handler
- signal_event.Set ();
- signal_event.Reset ();
-
+ my_handler (0);
+
// Hook up
- signal (UnixConvert.FromSignum (Signum.SIGTERM), new sighandler_t (my_handler));
- signal (UnixConvert.FromSignum (Signum.SIGUSR1), new sighandler_t (my_handler));
- signal (UnixConvert.FromSignum (Signum.SIGUSR2), new sighandler_t (my_handler));
+ Stdlib.signal (Signum.SIGTERM, new SignalHandler (my_handler));
+ Stdlib.signal (Signum.SIGUSR1, new SignalHandler (my_handler));
+ Stdlib.signal (Signum.SIGUSR2, new SignalHandler (my_handler));
// Load service assembly
Assembly a = null;
return 0;
} catch ( Exception ex ) {
- for (Exception e = ex; e != null; e = e.InnerException)
+ for (Exception e = ex; e != null; e = e.InnerException) {
error (logname, e.Message);
+ }
return 1;
}
info (logname, "Service {0} started", service.ServiceName);
for (bool running = true; running; ){
- signal_event.WaitOne ();
+ // Poll only after 500ms
+ Thread.Sleep (500);
+
Signum v;
if (UnixConvert.TryToSignum (signum, out v)){
+2005-06-06 Jonathan Pryor <jonpryor@vt.edu>
+
+ * mono-shlib-cop.cs: Use better default prefix handling (don't always assume
+ `/' is the prefix, instead base the choice off runtime information).
+
+2005-06-06 Jonathan Pryor <jonpryor@vt.edu>
+
+ * mono-shlib-cop.cs: Rename Report to AssemblyCheckInfo. Add -p
+ command-line option to specify mono prefixes to search for.
+ Store $prefix/etc/mono/config and ASSEMBLY.config XmlDocuments in
+ AssemblyCheckInfo, and use AssemblyCheckInfo to search for <dllmap>
+ entries. This allows us to cache XmlDocuments across AppDomains (since
+ AssemblyCheckInfo is a MarshalByRefObject), and should cut down on file
+ I/O (since we don't re-read the .config for every member of every type).
+
2005-06-03 Jonathan Pryor <jonpryor@vt.edu>
* mono-shlib-cop.cs: Add MessageInfo, MessageCollection, & Report classes to
// - Create AppDomain with ApplicationBase path set to directory assembly
// resides in
// - Create an AssemblyChecker instance within the AppDomain
-// - Check an assembly with AssemblyChecker; store results in Report.
+// - Check an assembly with AssemblyChecker; store results in AssemblyCheckInfo.
// - Print results.
//
// TODO:
// - AppDomain use
-// - specify $prefix to use for finding $prefix/etc/mono/config
-// - dllmap caching? (Is it possible to avoid reading the .config file
-// into each AppDomain at least once? OS file caching may keep perf from
-// dieing with all the potential I/O.)
// - Make -r work correctly (-r:Mono.Posix should read Mono.Posix from the
// GAC and inspect it.)
//
}
}
- sealed class Report : MarshalByRefObject {
+ sealed class AssemblyCheckInfo : MarshalByRefObject {
private MessageCollection errors = new MessageCollection ();
private MessageCollection warnings = new MessageCollection ();
public MessageCollection Warnings {
get {return warnings;}
}
+
+ private XmlDocument[] mono_configs = new XmlDocument [0];
+ private IDictionary assembly_configs = new Hashtable ();
+
+ public void SetInstallationPrefixes (string[] prefixes)
+ {
+ mono_configs = new XmlDocument [prefixes.Length];
+ for (int i = 0; i < mono_configs.Length; ++i) {
+ mono_configs [i] = new XmlDocument ();
+ mono_configs [i].Load (prefixes [i] + "/etc/mono/config");
+ }
+ }
+
+ public string GetDllmapEntry (string assemblyPath, string library)
+ {
+ string xpath = "//dllmap[@dll=\"" + library + "\"]";
+
+ XmlDocument d = GetAssemblyConfig (assemblyPath);
+ if (d != null) {
+ XmlNodeList maps = d.SelectNodes (xpath);
+ if (maps.Count > 0)
+ return maps [0].Attributes ["target"].Value;
+ }
+ foreach (XmlDocument config in mono_configs) {
+ XmlNodeList maps = config.SelectNodes (xpath);
+ Trace.WriteLine (string.Format ("{0} <dllmap/> entries found!", maps.Count));
+ if (maps.Count > 0)
+ return maps [0].Attributes ["target"].Value;
+ }
+ return null;
+ }
+
+ private XmlDocument GetAssemblyConfig (string assemblyPath)
+ {
+ XmlDocument d = null;
+ if (assembly_configs.Contains (assemblyPath)) {
+ d = (XmlDocument) assembly_configs [assemblyPath];
+ }
+ else {
+ string _config = assemblyPath + ".config";
+ if (File.Exists (_config)) {
+ d = new XmlDocument ();
+ d.Load (_config);
+ }
+ assembly_configs.Add (assemblyPath, d);
+ }
+ return d;
+ }
}
sealed class AssemblyChecker : MarshalByRefObject {
- public void CheckFile (string file, Report report)
+ public void CheckFile (string file, AssemblyCheckInfo report)
{
try {
Check (Assembly.LoadFile (file), report);
}
}
- public void CheckWithPartialName (string partial, Report report)
+ public void CheckWithPartialName (string partial, AssemblyCheckInfo report)
{
AssemblyName an = new AssemblyName ();
an.Name = partial;
}
}
- private void Check (Assembly a, Report report)
+ private void Check (Assembly a, AssemblyCheckInfo report)
{
foreach (Type t in a.GetTypes ()) {
Check (t, report);
}
}
- private void Check (Type type, Report report)
+ private void Check (Type type, AssemblyCheckInfo report)
{
BindingFlags bf = BindingFlags.Instance | BindingFlags.Static |
BindingFlags.Public | BindingFlags.NonPublic;
}
}
- private void CheckMember (Type type, MemberInfo mi, Report report)
+ private void CheckMember (Type type, MemberInfo mi, AssemblyCheckInfo report)
{
DllImportAttribute[] attributes = null;
MethodBase[] methods = null;
}
private void CheckLibrary (MethodBase method, DllImportAttribute attribute,
- Report report)
+ AssemblyCheckInfo report)
{
string library = attribute.Value;
string entrypoint = attribute.EntryPoint;
Trace.WriteLine ("Trying to load base library: " + library);
- foreach (string name in GetLibraryNames (method.DeclaringType, library)) {
+ foreach (string name in GetLibraryNames (method.DeclaringType, library, report)) {
if (LoadLibrary (type, mname, name, entrypoint, report, out error)) {
found = name;
break;
[DllImport ("libglib-2.0.so")]
private static extern void g_free (IntPtr mem);
- private static string[] GetLibraryNames (Type type, string library)
+ private static string[] GetLibraryNames (Type type, string library, AssemblyCheckInfo report)
{
// TODO: keep in sync with
// mono/metadata/loader.c:mono_lookup_pinvoke_call
ArrayList names = new ArrayList ();
- string dll_map = GetDllMapEntry (type, library);
+ string dll_map = report.GetDllmapEntry (type.Assembly.Location, library);
if (dll_map != null)
names.Add (dll_map);
}
private static bool LoadLibrary (string type, string member,
- string library, string symbol, Report report, out string error)
+ string library, string symbol, AssemblyCheckInfo report, out string error)
{
error = null;
IntPtr h = g_module_open (library,
}
return false;
}
-
- private static XmlDocument etc_mono_config;
-
- static AssemblyChecker ()
- {
- etc_mono_config = new XmlDocument ();
- etc_mono_config.Load ("/etc/mono/config");
- }
-
- private static string GetDllMapEntry (Type type, string library)
- {
- string xpath = "//dllmap[@dll=\"" + library + "\"]";
- // string xpath = "//dllmap";
- string _config = type.Assembly.Location + ".config";
- if (File.Exists (_config)) {
- Trace.WriteLine ("Reading .config file: " + _config);
- XmlDocument config = new XmlDocument ();
- config.Load (_config);
- XmlNodeList entry = config.SelectNodes (xpath);
- if (entry.Count > 0)
- return entry[0].Attributes ["target"].Value;
- }
- Trace.WriteLine (".config not found; using /etc/mono/config");
- XmlNodeList maps = etc_mono_config.SelectNodes (xpath);
- Trace.WriteLine (string.Format ("{0} <dllmap/> entries found!", maps.Count));
- if (maps.Count > 0)
- return maps[0].Attributes ["target"].Value;
- return null;
- }
}
class MyOptions : Options {
[Option (int.MaxValue, "Assemblies to load by partial names (e.g. from the GAC)", 'r')]
public string[] references = new string[]{};
+ [Option (int.MaxValue, "Mono installation prefixes (for $prefix/etc/mono/config)", 'p')]
+ public string[] prefixes = new string[]{};
}
class Runner {
o.ProcessArgs (args);
AssemblyChecker checker = new AssemblyChecker ();
- Report report = new Report ();
+ AssemblyCheckInfo report = new AssemblyCheckInfo ();
+ if (o.prefixes.Length == 0) {
+ DirectoryInfo configDir =
+ new DirectoryInfo (RuntimeEnvironment.GetRuntimeDirectory());
+ o.prefixes = new string[]{configDir.Parent.Parent.Parent.ToString ()};
+ }
+ report.SetInstallationPrefixes (o.prefixes);
foreach (string assembly in o.RemainingArguments) {
checker.CheckFile (assembly, report);
}
[assembly: AssemblyCompany("Motus Technologies, Novell")]
[assembly: AssemblyProduct("Mono Security Tools")]
[assembly: AssemblyCopyright("Copyright 2002, 2003 Motus Technologies. Copyright 2004-2005 Novell. BSD licensed.")]
-[assembly: AssemblyVersion("1.1.7.0")]
+[assembly: AssemblyVersion("1.1.8.0")]
//[assembly: AssemblyConfiguration("")]
//[assembly: AssemblyTrademark("")]
+2005-06-09 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyInfo.cs: Bump security tools version to 1.1.8.
+
2005-05-02 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Bump security tools version to 1.1.7.
+++ /dev/null
-Summary: The mono CIL runtime, suitable for running .NET code
-Name: mono
-Version: @VERSION@
-Release: 1
-License: LGPL
-Group: System Environment/Base
-# the original file is in .gz format but I want to save a few bytes
-Source0: http://go-mono.com/archive/mono-@VERSION@.tar.gz
-URL: http://go-mono.com/
-BuildRoot: %{_tmppath}/%{name}-root
-Requires: /sbin/ldconfig, libxml2, libxslt
-BuildRequires: libgc-devel
-BuildRequires: bison
-Packager: Miguel de Icaza <miguel@ximian.com>
-Requires: mono-classes
-
-%description
-The Mono runtime implements a JIT engine for the ECMA CLI virtual machine (as
-well as a byte code interpreter, the class loader, the garbage collector, threading system and
-metadata access libraries.
-
-%package devel
-Summary: Files and programs needed for mono development
-Group: Development/Tools
-PreReq: %{name} = %{version}-%{release}
-
-%description devel
-Header files, programs and documentation needed to develop programs with
-the Mono .NET implementation
-
-%prep
-%setup -q
-
-%build
-./configure
-make
-
-%install
-rm -rf %{buildroot}
-%makeinstall
-
-%clean
-rm -rf %{buildroot}
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%defattr(-, root, root)
-%doc AUTHORS COPYING.LIB ChangeLog NEWS README
-%{_bindir}/mono
-%{_bindir}/mint
-%{_libdir}/*.so.*
-%{_mandir}/man1/mono.*
-%{_mandir}/man1/mint.*
-%{_mandir}/man5/*
-
-%files devel
-%defattr(-, root, root)
-%{_bindir}/monodis
-%{_bindir}/monograph
-%{_libdir}/*.a
-%{_libdir}/*.la
-%{_libdir}/*.so
-%{_libdir}/pkgconfig/*
-%{_includedir}/*
-%{_mandir}/man1/monodis.*
-%{_mandir}/man1/monostyle.*
-%{_mandir}/man1/monoburg.*
-%{_mandir}/man1/mcs.*
-%{_datadir}/%{name}/*
-
-%changelog
-* Wed Aug 21 2002 Miguel de Icaza <miguel@ximian.com>
-Few touches, check into cvs
-
-* Mon Aug 19 2002 Daniel Resare <noa@resare.com>
-- Initial RPM release.
+2005-06-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * ia64/ia64-codegen.h: Ongoing IA64 work.
+
+2005-06-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * ia64/ia64-codegen.h: Ongoing IA64 work.
+
2005-05-30 Zoltan Varga <vargaz@freemail.hu>
* ia64/codegen.c: Fix it after latest changes.
IA64_B4 = 4,
IA64_B5 = 5,
IA64_B6 = 6,
- IA64_B7 = 7
+ IA64_B7 = 7,
+
+ /* Aliases */
+ IA64_RP = IA64_B0
} Ia64BranchRegister;
typedef enum {
#define ia64_ins_b2(ins) ((((guint64)(ins)) >> 13) & 0x7)
#define ia64_ins_btype(ins) ((((guint64)(ins)) >> 6) & 0x7)
#define ia64_ins_x(ins) ((((guint64)(ins)) >> 22) & 0x1)
+#define ia64_ins_x2a(ins) ((((guint64)(ins)) >> 34) & 0x3)
#define ia64_ins_x3(ins) ((((guint64)(ins)) >> 33) & 0x7)
#define ia64_ins_x6(ins) ((((guint64)(ins)) >> 27) & 0x3f)
#define ia64_ins_y(ins) ((((guint64)(ins)) >> 26) & 0x1)
#define ia64_ins_vc(ins) ((((guint64)(ins)) >> 20) & 0x1)
+#define ia64_ins_ve(ins) ((((guint64)(ins)) >> 33) & 0x1)
#define IA64_NOP_I ((0x01 << 27))
#define IA64_NOP_M ((0x01 << 27))
*/
typedef struct {
+ gboolean automatic;
guint8 *buf;
guint64 instructions [3];
int itypes [3], stops [3];
- int nins;
+ int nins, template;
} Ia64CodegenState;
+#ifdef IA64_SIMPLE_EMIT_BUNDLE
G_GNUC_UNUSED static void ia64_emit_bundle (Ia64CodegenState *code, gboolean flush);
+#else
+void ia64_emit_bundle (Ia64CodegenState *code, gboolean flush);
+#endif
/*
- * FIXME:
- *
- * In order to simplify things, we emit a stop after every instruction for
- * now. Also, we emit 1 ins + 2 nops.
+ * There are two code generation modes:
+ * - in automatic mode, bundling and stops are handled automatically by the
+ * code generation macros.
+ * FIXME: In order to simplify things, we emit a stop after every instruction for
+ * now. Also, we emit 1 ins + 2 nops.
+ * - in non-automatic mode, the caller is responsible for handling bundling and
+ * stops using the appropriate macros.
*/
#define ia64_codegen_init(code, codegen_buf) do { \
code.buf = codegen_buf; \
code.nins = 0; \
+ code.automatic = 1; \
} while (0)
#define ia64_codegen_close(code) do { \
ia64_emit_bundle (&code, TRUE); \
} while (0)
+#define ia64_end_bundle(code) do { \
+ ia64_emit_bundle (&code, TRUE); \
+} while (0)
+
+#define ia64_codegen_set_automatic(code, is_automatic) do { \
+ code.automatic = (is_automatic); \
+} while (0)
+
+#define ia64_stop(code) do { \
+ g_assert ((code.nins > 0)); \
+ code.stops [code.nins - 1] = 1; \
+} while (0)
+
+#define ia64_begin_bundle_template(code, bundle_template) do { \
+ ia64_emit_bundle (&code, TRUE); \
+ code.template = (bundle_template); \
+} while (0)
+
/* To ease debugging, we emit instructions immediately */
#define ia64_emit_ins(code, itype, ins) do { \
- code.instructions [code.nins] = ins; \
- code.itypes [code.nins] = itype; \
- code.stops [code.nins] = 1; \
- code.nins ++; \
- if ((itype != IA64_INS_TYPE_LX) || (code.nins == 2)) ia64_emit_bundle (&code, FALSE); \
- if (code.nins == 3) \
- ia64_emit_bundle (&code, FALSE); \
+ if (G_LIKELY (code.automatic)) { \
+ code.instructions [code.nins] = ins; \
+ code.itypes [code.nins] = itype; \
+ code.stops [code.nins] = 1; \
+ code.nins ++; \
+ if ((itype != IA64_INS_TYPE_LX) || (code.nins == 2)) ia64_emit_bundle (&code, FALSE); \
+ if (code.nins == 3) \
+ ia64_emit_bundle (&code, FALSE); \
+ } else { \
+ g_assert (code.nins < 3); \
+ code.instructions [code.nins] = ins; \
+ code.itypes [code.nins] = itype; \
+ code.nins ++; \
+ } \
} while (0)
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
(code)->buf += 16; \
} while (0)
+#ifdef IA64_SIMPLE_EMIT_BUNDLE
+
G_GNUC_UNUSED static void
ia64_emit_bundle (Ia64CodegenState *code, gboolean flush)
{
code->nins = 0;
}
+#endif /* IA64_SIMPLE_EMIT_BUNDLE */
+
#define ia64_is_imm8(imm) (((gint64)(imm) >= -128) && ((gint64)(imm) <= 127))
#define ia64_is_imm14(imm) (((gint64)(imm) >= -8192) && ((gint64)(imm) <= 8191))
+#define ia64_is_imm21(imm) (((gint64)(imm) >= -0x100000) && ((gint64)(imm) <= (0x100000 - 1)))
#if 1
#define check_imm8(imm) check_assert (((gint64)(imm) >= -128) && ((gint64)(imm) <= 127))
#define check_imm9(imm) check_assert (((gint64)(imm) >= -256) && ((gint64)(imm) <= 255))
#define check_imm14(imm) check_assert (((gint64)(imm) >= -8192) && ((gint64)(imm) <= 8191))
-#define check_imm21(imm) check_assert (((gint64)(imm) >= -0x200000) && ((gint64)(imm) <= (0x200000 - 1)))
-#define check_imm22(imm) check_assert (((gint64)(imm) >= -0x400000) && ((gint64)(imm) <= (0x400000 - 1)))
+#define check_imm21(imm) check_assert (((gint64)(imm) >= -0x100000) && ((gint64)(imm) <= (0x100000 - 1)))
+#define check_imm22(imm) check_assert (((gint64)(imm) >= -0x200000) && ((gint64)(imm) <= (0x200000 - 1)))
#define check_imm62(imm) check_assert (((gint64)(imm) >= -0x2fffffffffffffffLL) && ((gint64)(imm) <= (0x2fffffffffffffffLL - 1)))
#define check_len4(len) check_assert (((gint64)(len) >= 1) && ((gint64)(len) <= 16))
#define ia64_break_x_pred(code, qp, imm) ia64_x1 ((code), (qp), (imm), 0, 0x00)
-#define ia64_x2(code, qp, r1, imm, vc) do { check_greg ((r1)); ia64_begin_bundle (code); ia64_emit_ins_1 ((code), IA64_INS_TYPE_LX, ((guint64)(imm) >> 22) & 0x1ffffffffffULL, 0); ia64_emit_ins_9 ((code), IA64_INS_TYPE_LX, (qp), 0, (r1), 6, (guint64)(imm) & 0x7f, (13), (vc), 20, ((guint64)(imm) >> 21) & 0x1, 21, ((guint64)(imm) >> 16) & 0x1f, 22, ((guint64)(imm) >> 7) & 0x1ff, 27, ((guint64)(imm) >> 63) & 0x1, 36, (6), 37); } while (0)
+#define ia64_x2(code, qp, r1, imm, vc) do { check_greg ((r1)); if (code.automatic) ia64_begin_bundle (code); ia64_emit_ins_1 ((code), IA64_INS_TYPE_LX, ((guint64)(imm) >> 22) & 0x1ffffffffffULL, 0); ia64_emit_ins_9 ((code), IA64_INS_TYPE_LX, (qp), 0, (r1), 6, (guint64)(imm) & 0x7f, (13), (vc), 20, ((guint64)(imm) >> 21) & 0x1, 21, ((guint64)(imm) >> 16) & 0x1f, 22, ((guint64)(imm) >> 7) & 0x1ff, 27, ((guint64)(imm) >> 63) & 0x1, 36, (6), 37); } while (0)
#define ia64_movl_pred(code, qp, r1, imm) ia64_x2 ((code), (qp), (r1), (imm), 0)
+2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
+ When the buffer has not enough space, close the file before returning.
+
+2005-06-09 Duncan Mak <duncan@novell.com>
+
+ * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
+ all public headers. Fixes #74919.
+
2005-05-30 Zoltan Varga <vargaz@freemail.hu>
* atomic.h: Add IA64 atomic ops.
#include <glib.h>
+G_BEGIN_DECLS
+
#define _WAPI_HANDLE_COLLECTION_UPDATE_INTERVAL 10
#define _WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL 60
_wapi_thr_ret = _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_COLLECTION); \
g_assert (_wapi_thr_ret == 0); \
}
-
+
extern void _wapi_collection_init (void);
extern void _wapi_handle_collect (void);
+G_END_DECLS
+
#endif /* _WAPI_COLLECTION_H_ */
guint8 ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
} WapiContext;
+G_BEGIN_DECLS
+
extern gboolean GetThreadContext(gpointer handle, WapiContext *context);
+G_END_DECLS
+
#endif /* _WAPI_COMPEX_H_ */
#include "mono-mutex.h"
+G_BEGIN_DECLS
+
typedef struct _WapiCriticalSection WapiCriticalSection;
struct _WapiCriticalSection
extern void EnterCriticalSection(WapiCriticalSection *section);
extern void LeaveCriticalSection(WapiCriticalSection *section);
+G_END_DECLS
+
#endif /* _WAPI_CRITICAL_SECTIONS_H_ */
#include <glib.h>
+G_BEGIN_DECLS
+
extern gpointer CreateEvent(WapiSecurityAttributes *security, gboolean manual,
gboolean initial, const gunichar2 *name);
extern gboolean PulseEvent(gpointer handle);
extern gboolean ResetEvent(gpointer handle);
extern gboolean SetEvent(gpointer handle);
+G_END_DECLS
+
#endif /* _WAPI_EVENTS_H_ */
#define INVALID_HANDLE_VALUE (gpointer)-1
+G_BEGIN_DECLS
+
extern gboolean CloseHandle(gpointer handle);
+G_END_DECLS
+
#endif /* _WAPI_HANDLES_H_ */
continue;
splitted = g_strsplit (buffer, " ", 0);
- if (!*splitted || !*(splitted + 1))
+ if (!*splitted || !*(splitted + 1)) {
+ g_strfreev (splitted);
continue;
+ }
dir = g_utf8_to_utf16 (*(splitted + 1), -1, &length, NULL, NULL);
g_strfreev (splitted);
if (total + length + 1 > len) {
+ fclose (fp);
return len * 2; /* guess */
}
#include "mono/io-layer/wapi.h"
#include "mono/io-layer/timefuncs.h"
+G_BEGIN_DECLS
+
typedef struct _WapiSecurityAttributes WapiSecurityAttributes;
struct _WapiSecurityAttributes
guint32 offset_high, guint32 length_low,
guint32 length_high);
+G_END_DECLS
+
#endif /* _WAPI_IO_H_ */
#include <pthread.h>
#include <time.h>
+G_BEGIN_DECLS
+
typedef struct {
pthread_mutex_t mutex;
gboolean complete;
#define MONO_MUTEX_INITIALIZER { 0, MONO_THREAD_NONE, 0, 0, PTHREAD_MUTEX_INITIALIZER, 0 }
#define MONO_RECURSIVE_MUTEX_INITIALIZER { 0, MONO_THREAD_NONE, 0, 0, PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER }
-
int mono_mutexattr_init (mono_mutexattr_t *attr);
int mono_mutexattr_settype (mono_mutexattr_t *attr, int type);
int mono_mutexattr_gettype (mono_mutexattr_t *attr, int *type);
#include <glib.h>
+G_BEGIN_DECLS
+
extern gpointer CreateMutex(WapiSecurityAttributes *security, gboolean owned,
const gunichar2 *name);
extern gboolean ReleaseMutex(gpointer handle);
+G_END_DECLS
+
#endif /* _WAPI_MUTEXES_H_ */
#include <mono/io-layer/handles.h>
#include <mono/io-layer/access.h>
+G_BEGIN_DECLS
+
typedef enum {
STARTF_USESHOWWINDOW=0x001,
STARTF_USESIZE=0x002,
extern gboolean TerminateProcess (gpointer process, gint32 exitCode);
+G_END_DECLS
+
#endif /* _WAPI_PROCESSES_H_ */
#include <glib.h>
+G_BEGIN_DECLS
+
extern gboolean ImpersonateLoggedOnUser (gpointer handle);
extern gboolean RevertToSelf (void);
+G_END_DECLS
+
#endif /* _WAPI_SECURITY_H_ */
#include <glib.h>
+G_BEGIN_DECLS
+
extern gpointer CreateSemaphore(WapiSecurityAttributes *security,
gint32 initial, gint32 max,
const gunichar2 *name);
extern gboolean ReleaseSemaphore(gpointer handle, gint32 count,
gint32 *prevcount);
+G_END_DECLS
#endif /* _WAPI_SEMAPHORES_H_ */
#include "mono/io-layer/wapi.h"
+G_BEGIN_DECLS
+
#define WSADESCRIPTION_LEN 256
#define WSASYS_STATUS_LEN 128
gchar *output, gint o_len, glong *written,
void *unused1, void *unused2);
+G_END_DECLS
#endif /* _WAPI_SOCKETS_H_ */
#include <glib.h>
+G_BEGIN_DECLS
+
typedef struct _WapiSystemInfo WapiSystemInfo;
struct _WapiSystemInfo
extern void GetSystemInfo(WapiSystemInfo *info);
+G_END_DECLS
#endif /* _WAPI_SYSTEM_H_ */
#include <mono/io-layer/processes.h>
#include <mono/io-layer/access.h>
+G_BEGIN_DECLS
+
#define TLS_MINIMUM_AVAILABLE 64
#define TLS_OUT_OF_INDEXES 0xFFFFFFFF
extern guint32 SleepEx(guint32 ms, gboolean alertable);
extern guint32 QueueUserAPC (WapiApcProc apc_callback, gpointer thread_handle,
gpointer param);
-
+G_END_DECLS
#endif /* _WAPI_THREADS_H_ */
#include "mono/io-layer/wapi.h"
+G_BEGIN_DECLS
+
/* The typical idiom for this struct is to cast it to and from 64bit
* ints, hence the endian switch.
*/
extern gboolean QueryPerformanceFrequency(WapiLargeInteger *freq);
extern guint32 GetTickCount (void);
+G_END_DECLS
#endif /* _WAPI_TIME_H_ */
#include "mono/io-layer/status.h"
+G_BEGIN_DECLS
+
#define MAXIMUM_WAIT_OBJECTS 64
#define INFINITE 0xFFFFFFFF
extern guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
gboolean waitall, guint32 timeout, gboolean alertable);
+G_END_DECLS
#endif /* _WAPI_WAIT_H_ */
+2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: no need to convert from utf16 to utf8 and then back again
+ after the call to GetLogicalDrives.
+
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: frombase64. Fix problems exposed by new tests.
+
+2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added internal calls for converting char [] and strings in
+ base64 into byte [].
+
+2005-06-10 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_create_generic_2): Read the nested classes
+ from the metadata rather than from `gklass->nested_classes' since
+ `gklass' might not be initialized yet.
+
+2005-06-09 Duncan Mak <duncan@novell.com>
+
+ * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
+ all public headers. Fixes #74919.
+
+2005-06-09 Lluis Sanchez Gual <lluis@novell.com>
+
+ * domain.c: The key for proxy_vtable_hash is now a pointer
+ array. Added new GHashFunc and GCompareFunc functions for this.
+
+ * class.h: The list of interfaces in MonoRemoteClass is known in
+ advance and can't grow (we create a new MonoRemoteClass if needed),
+ so now the interface array can be allocated together with
+ MonoRemoteClass.
+
+ * object.c: Added a new method create_remote_class_key.
+ Fixed mono_remote_class so it does not depend on
+ mono_upgrade_remote_class.
+ Removed extend_interface_array.
+ Added new method clone_remote_class(), which makes a copy of a remote
+ class and adds a new interface or class to it.
+ mono_upgrade_remote_class() now creates a new remote class (or gets
+ it from the cache) if an vtable upgrade is needed. In this way
+ we make sure that other objects sharing the same remote class
+ don't get the new vtable with unwanted interfaces.
+
+ * object-internals.h:
+ * object.h: Moved mono_upgrade_remote_class to object-internals.h.
+
+ * marshal.c: Track changes in mono_upgrade_remote_class().
+
+2005-06-08 Kamil Skalski <nazgul@nemerle.org>
+ * icall.c: Add runtime methods for obtaining members of inflated
+ class, which were created from supplied non-inflated members. It
+ is used in internal Get{Method,Constructor,Field} methods in
+ System.Type
+
+2005-06-09 Martin Baulig <martin@ximian.com>
+
+ * reflection.c
+ (mono_reflection_bind_generic_method_parameters): Fix #75169.
+
+2005-06-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+ * reflection.c (mono_image_basic_init): Define
+ Version in MonoDynamicAssembly.
+
+2005-06-08 Martin Baulig <martin@ximian.com>
+
+ Fix #75136.
+
+ * loader.c
+ (mono_method_signature_full): New public method; takes a
+ `MonoGenericContext *'.
+ (find_method): Use mono_method_signature_full() and pass the
+ klass'es context to it.
+
+ * class.c (mono_class_is_inflated_method): Use
+ mono_method_signature_full() and pass the context to it.
+
+Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: add proper locking in mono_remote_class_vtable(),
+ fixes possible memory corruption.
+
+2005-06-08 Michael Meeks <michael.meeks@novell.com>
+
+ * marshal.c (mono_remoting_marshal_init): set
+ initialized after initialization.
+
+2005-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * locales.c : hush.
+
+2005-06-06 Michael Meeks <michael.meeks@novell.com>
+
+ * object.c (extend_interface_array): fix really silly
+ memory corrupting / comparison bug.
+
+2005-06-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * reflection.c: Functions added to support the creation
+ of CustomAttributeData, which includes Attribute data
+ used by ReflectionOnly methods.
+
+ * reflection.h: mono_reflection_get_custom_attrs_data and
+ mono_custom_attrs_data_construct added (functions exposed).
+
+ * icall.c: Added mono_reflection_get_custom_attrs_data
+ as icall.
+
+2005-06-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
+ lupus's request.
+
+2005-06-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
+ dynamic DllImportAttribute.
+
+ * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of
+ dynamic DllImportAttribute.
+
+ * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
+ Fixes #75162.
+
2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* threads.c: avoid segfault when an unstarted thread is aborted.
marshal.h \
monitor.c \
monitor.h \
+ tabledefs.h \
threads.c \
threads-types.h \
threadpool.c \
opcodes.c \
image.c \
cil-coff.h \
- tabledefs.h \
metadata.c \
metadata-internals.h \
verify.c \
#include <mono/metadata/reflection.h>
#include <mono/metadata/mempool.h>
+G_BEGIN_DECLS
+
typedef void (*MonoThreadStartCB) (guint32 tid, gpointer stack_start,
gpointer func);
typedef void (*MonoThreadAttachCB) (guint32 tid, gpointer stack_start);
MonoClass*
mono_get_exception_class (void);
+G_END_DECLS
#endif /* _MONO_METADATA_APPDOMAIN_H_ */
#include <mono/metadata/image.h>
+G_BEGIN_DECLS
+
void mono_assemblies_init (void);
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
void mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
void mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
+G_END_DECLS
#endif
MonoMethodSignature*
mono_class_inflate_generic_signature (MonoImage *image, MonoMethodSignature *sig, MonoGenericContext *context);
+MonoMethodSignature *
+mono_method_signature_full (MonoMethod *image, MonoGenericContext *context);
+
MonoGenericClass *
mono_get_shared_generic_class (MonoGenericContainer *container, gboolean is_dynamic);
(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
return method;
- if (method->is_inflated || mono_method_signature (method)->is_inflated) {
+ if (method->is_inflated || mono_method_signature_full (method, context)->is_inflated) {
MonoMethodInflated *imethod = (MonoMethodInflated *) method;
context = inflate_generic_context (imethod->context, context);
klass->interfaces [i] = mono_class_from_mono_type (inflated);
}
- for (list = gklass->nested_classes; list; list = list->next)
- klass->nested_classes = g_list_append (
- klass->nested_classes, list->data);
+ i = mono_metadata_nesting_typedef (klass->image, gklass->type_token, 1);
+ while (i) {
+ MonoClass* nclass;
+ guint32 cols [MONO_NESTED_CLASS_SIZE];
+ mono_metadata_decode_row (&klass->image->tables [MONO_TABLE_NESTEDCLASS], i - 1, cols, MONO_NESTED_CLASS_SIZE);
+ nclass = mono_class_create_from_typedef (klass->image, MONO_TOKEN_TYPE_DEF | cols [MONO_NESTED_CLASS_NESTED]);
+ klass->nested_classes = g_list_prepend (klass->nested_classes, nclass);
+
+ i = mono_metadata_nesting_typedef (klass->image, gklass->type_token, i + 1);
+ }
if (gclass->parent)
klass->parent = mono_class_from_mono_type (gclass->parent);
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
+G_BEGIN_DECLS
+
typedef struct MonoVTable MonoVTable;
typedef struct _MonoClassField MonoClassField;
MonoVTable *default_vtable;
MonoVTable *xdomain_vtable;
MonoClass *proxy_class;
- guint interface_count;
- MonoClass **interfaces;
char* proxy_class_name;
+ guint interface_count;
+ MonoClass *interfaces [MONO_ZERO_LEN_ARRAY];
} MonoRemoteClass;
MonoClass *
char *
mono_class_name_from_token (MonoImage *image, guint32 type_token, MonoGenericContext *context);
+G_END_DECLS
+
#endif /* _MONO_CLI_CLASS_H_ */
#include <glib.h>
#include <mono/metadata/class.h>
+G_BEGIN_DECLS
+
typedef struct MonoDisHelper MonoDisHelper;
typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, guint32 ip_offset);
char* mono_method_full_name (MonoMethod *method, gboolean signature);
+G_END_DECLS
+
#endif /* __MONO_DEBUG_HELPERS_H__ */
#define MONO_SYMBOL_FILE_VERSION 38
#define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
+G_BEGIN_DECLS
+
MonoSymbolFile *
mono_debug_open_mono_symbol_file (MonoDebugHandle *handle,
gboolean create_symfile);
MonoDebugMethodInfo *
mono_debug_find_method (MonoDebugHandle *handle,
MonoMethod *method);
+G_END_DECLS
#endif /* __MONO_SYMFILE_H__ */
return h;
}
+gboolean
+mono_ptrarray_equal (gpointer *s1, gpointer *s2)
+{
+ int len = GPOINTER_TO_INT (s1 [0]);
+ if (len != GPOINTER_TO_INT (s2 [0]))
+ return FALSE;
+
+ return memcmp (s1 + 1, s2 + 1, len * sizeof(gpointer)) == 0;
+}
+
+guint
+mono_ptrarray_hash (gpointer *s)
+{
+ int i;
+ int len = GPOINTER_TO_INT (s [0]);
+ guint hash = 0;
+
+ for (i = 1; i < len; i++)
+ hash += GPOINTER_TO_UINT (s [i]);
+
+ return hash;
+}
+
/*
* Allocate an id for domain and set domain->domain_id.
* LOCKING: must be called while holding appdomains_mutex.
domain->env = mono_g_hash_table_new ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal);
domain->domain_assemblies = NULL;
domain->class_vtable_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
- domain->proxy_vtable_hash = mono_g_hash_table_new ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal);
+ domain->proxy_vtable_hash = mono_g_hash_table_new ((GHashFunc)mono_ptrarray_hash, (GCompareFunc)mono_ptrarray_equal);
domain->static_data_hash = mono_g_hash_table_new (mono_aligned_addr_hash, NULL);
domain->jit_code_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
domain->ldstr_table = mono_g_hash_table_new ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal);
#ifndef _MONO_METADATA_ENVIRONMENT_H_
#define _MONO_METADATA_ENVIRONMENT_H_
+G_BEGIN_DECLS
+
extern gint32 mono_environment_exitcode_get (void);
extern void mono_environment_exitcode_set (gint32 value);
extern MonoString* ves_icall_System_Environment_GetOSVersionString (void);
+G_END_DECLS
+
#endif /* _MONO_METADATA_ENVIRONMENT_H_ */
#include <mono/metadata/object.h>
#include <mono/metadata/image.h>
+G_BEGIN_DECLS
+
extern MonoException *
mono_exception_from_name (MonoImage *image,
const char* name_space,
MonoException *
mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
+G_END_DECLS
+
#endif /* _MONO_METADATA_EXCEPTION_H_ */
#include <mono/metadata/object-internals.h>
#include <mono/io-layer/io-layer.h>
+G_BEGIN_DECLS
+
/* This is a copy of System.IO.FileAccess */
typedef enum {
FileAccess_Read=0x01,
extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
gint64 length, gint32 *error);
+G_END_DECLS
+
#endif /* _MONO_METADATA_FILEIO_H_ */
result = bsd_strtod (ptr, &endptr);
if (!*ptr || (endptr && *endptr))
- mono_raise_exception (mono_exception_from_name (mono_defaults.corlib,
+ mono_raise_exception (mono_exception_from_name (mono_get_corlib (),
"System",
"FormatException"));
return res;
}
+
+static MonoReflectionMethod*
+ves_icall_MonoGenericClass_GetCorrespondingInflatedMethod (MonoReflectionGenericClass *type,
+ MonoMethod* generic)
+{
+ MonoGenericClass *gclass;
+ MonoDynamicGenericClass *dgclass;
+ MonoDomain *domain;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ gclass = type->type.type->data.generic_class;
+ g_assert (gclass->is_dynamic);
+
+ dgclass = (MonoDynamicGenericClass *) gclass;
+
+ domain = mono_object_domain (type);
+
+ for (i = 0; i < dgclass->count_methods; i++)
+ if (generic->token == dgclass->methods [i]->token)
+ return mono_method_get_object (domain, dgclass->methods [i], NULL);
+
+ return NULL;
+}
+
+static MonoReflectionMethod*
+ves_icall_MonoGenericClass_GetCorrespondingInflatedConstructor (MonoReflectionGenericClass *type,
+ MonoMethod* generic)
+{
+ MonoGenericClass *gclass;
+ MonoDynamicGenericClass *dgclass;
+ MonoDomain *domain;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ gclass = type->type.type->data.generic_class;
+ g_assert (gclass->is_dynamic);
+
+ dgclass = (MonoDynamicGenericClass *) gclass;
+
+ domain = mono_object_domain (type);
+
+ for (i = 0; i < dgclass->count_ctors; i++)
+ if (generic->token == dgclass->ctors [i]->token)
+ return mono_method_get_object (domain, dgclass->ctors [i], NULL);
+
+ return NULL;
+}
+
+
+static MonoReflectionField*
+ves_icall_MonoGenericClass_GetCorrespondingInflatedField (MonoReflectionGenericClass *type,
+ MonoClassField* generic)
+{
+ MonoGenericClass *gclass;
+ MonoDynamicGenericClass *dgclass;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ gclass = type->type.type->data.generic_class;
+ g_assert (gclass->is_dynamic);
+
+ dgclass = (MonoDynamicGenericClass *) gclass;
+
+ refclass = mono_class_from_mono_type (type->type.type);
+
+ domain = mono_object_domain (type);
+
+ for (i = 0; i < dgclass->count_fields; i++)
+ if (strcmp (generic->name, dgclass->fields [i].name) == 0)
+ return mono_field_get_object (domain, refclass, &dgclass->fields [i]);
+
+ return NULL;
+}
+
+
+static MonoReflectionMethod*
+ves_icall_MonoType_GetCorrespondingInflatedMethod (MonoReflectionType *type,
+ MonoMethod* generic)
+{
+ MonoDomain *domain;
+ MonoClass *klass;
+ MonoMethod *method;
+ gpointer iter;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = ((MonoObject *)type)->vtable->domain;
+
+ klass = mono_class_from_mono_type (type->type);
+
+ iter = NULL;
+ while ((method = mono_class_get_methods (klass, &iter))) {
+ if (method->token == generic->token)
+ return mono_method_get_object (domain, method, klass);
+ }
+
+ return NULL;
+}
+
+
+static MonoReflectionField*
+ves_icall_MonoType_GetCorrespondingInflatedField (MonoReflectionType *type,
+ MonoClassField* generic)
+{
+ MonoDomain *domain;
+ MonoClass *klass;
+ MonoClassField *field;
+ gpointer iter;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = ((MonoObject *)type)->vtable->domain;
+
+ klass = mono_class_from_mono_type (type->type);
+
+ iter = NULL;
+ while ((field = mono_class_get_fields (klass, &iter))) {
+ if (field->name == generic->name)
+ return mono_field_get_object (domain, klass, field);
+ }
+
+ return NULL;
+}
+
+
static MonoArray*
ves_icall_MonoGenericClass_GetMethods (MonoReflectionGenericClass *type,
MonoReflectionType *reflected_type)
if (attr->charset == 1)
attr->charset = 2;
attr->exact_spelling = (flags & 0x1) != 0;
- attr->set_last_error = (flags & 0x4) != 0;
- attr->best_fit_mapping = (flags & 0x10) != 0;
- attr->throw_on_unmappable = (flags & 0x1000) != 0;
+ attr->set_last_error = (flags & 0x40) != 0;
+ attr->best_fit_mapping = (flags & 0x30) == 0x10;
+ attr->throw_on_unmappable = (flags & 0x3000) == 0x1000;
attr->preserve_sig = FALSE;
return attr;
ves_icall_System_Environment_GetLogicalDrives (void)
{
gunichar2 buf [128], *ptr, *dname;
- gchar *u8;
+ gunichar2 *u16;
gint initial_size = 127, size = 128;
gint ndrives;
MonoArray *result;
MonoString *drivestr;
MonoDomain *domain = mono_domain_get ();
+ gint len;
MONO_ARCH_SAVE_REGS;
result = mono_array_new (domain, mono_defaults.string_class, ndrives);
ndrives = 0;
do {
- u8 = g_utf16_to_utf8 (dname, -1, NULL, NULL, NULL);
- drivestr = mono_string_new (domain, u8);
- g_free (u8);
+ len = 0;
+ u16 = dname;
+ while (*u16) { u16++; len ++; }
+ drivestr = mono_string_new_utf16 (domain, dname, len);
mono_array_set (result, gpointer, ndrives++, drivestr);
while (*dname++);
} while (*dname);
}
static MonoString*
-ves_icall_Mono_Runtime_GetDisplayName ()
+ves_icall_Mono_Runtime_GetDisplayName (void)
{
char *display_name_str = g_strdup_printf ("Mono %s", VERSION);
MonoString *display_name = mono_string_new (mono_domain_get (), display_name_str);
return display_name;
}
+static guchar dbase64 [] = {
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 62, 128, 128, 128, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 128, 128, 128, 0, 128, 128,
+ 128, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 128, 128, 128, 128, 128,
+ 128, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
+ };
+
+static MonoArray *
+base64_to_byte_array (gunichar2 *start, gint ilength)
+{
+ gint ignored;
+ gint i;
+ gunichar2 c;
+ gint olength;
+ MonoArray *result;
+ guchar *res_ptr;
+ gint a [4], b [4];
+ MonoException *exc;
+
+ ignored = 0;
+ for (i = 0; i < ilength; i++) {
+ c = start [i];
+ if (isspace (c)) {
+ ignored++;
+ } else if (c >= sizeof (dbase64)) {
+ exc = mono_exception_from_name_msg (mono_get_corlib (),
+ "System", "FormatException",
+ "Invalid character found.");
+ mono_raise_exception (exc);
+ }
+ }
+
+ olength = ilength - ignored;
+ if ((olength & 3) != 0 || olength <= 0) {
+ exc = mono_exception_from_name_msg (mono_get_corlib (), "System",
+ "FormatException", "Invalid length.");
+ mono_raise_exception (exc);
+ }
+
+ olength = (olength * 3) / 4;
+ if (start [ilength - 1] == '=')
+ olength--;
+
+ if (start [ilength - 2] == '=')
+ olength--;
+
+ result = mono_array_new (mono_domain_get (), mono_defaults.byte_class, olength);
+ res_ptr = mono_array_addr (result, guchar, 0);
+ for (i = 0; i < ilength; ) {
+ int k;
+
+ for (k = 0; k < 4 && i < ilength; k++) {
+ c = start [i++];
+ if (isspace (c))
+ continue;
+
+ a [k] = (guchar) c;
+ if (((b [k] = dbase64 [c]) & 0x80) != 0) {
+ exc = mono_exception_from_name_msg (mono_get_corlib (),
+ "System", "FormatException",
+ "Invalid character found.");
+ mono_raise_exception (exc);
+ }
+ }
+
+ *res_ptr++ = (b [0] << 2) | (b [1] >> 4);
+ if (a [2] != '=')
+ *res_ptr++ = (b [1] << 4) | (b [2] >> 2);
+ if (a [3] != '=')
+ *res_ptr++ = (b [2] << 6) | b [3];
+
+ while (i < ilength && isspace (start [i]))
+ i++;
+ }
+
+ return result;
+}
+
+static MonoArray *
+InternalFromBase64String (MonoString *str)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return base64_to_byte_array (mono_string_chars (str), mono_string_length (str));
+}
+
+static MonoArray *
+InternalFromBase64CharArray (MonoArray *input, gint offset, gint length)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return base64_to_byte_array (mono_array_addr (input, gunichar2, offset), length);
+}
+
/* icall map */
typedef struct {
const char *method;
{"Isatty", ves_icall_System_ConsoleDriver_Isatty },
{"SetBreak", ves_icall_System_ConsoleDriver_SetBreak },
{"SetEcho", ves_icall_System_ConsoleDriver_SetEcho },
- {"TtySetup", ves_icall_System_ConsoleDriver_TtySetup },
+ {"TtySetup", ves_icall_System_ConsoleDriver_TtySetup }
+};
+
+static const IcallEntry convert_icalls [] = {
+ {"InternalFromBase64CharArray", InternalFromBase64CharArray },
+ {"InternalFromBase64String", InternalFromBase64String }
};
static const IcallEntry timezone_icalls [] = {
};
static const IcallEntry customattrs_icalls [] = {
+ {"GetCustomAttributesDataInternal", mono_reflection_get_custom_attrs_data},
{"GetCustomAttributesInternal", mono_reflection_get_custom_attrs},
{"IsDefinedInternal", custom_attrs_defined_internal}
};
{"GetArrayRank", ves_icall_MonoType_GetArrayRank},
{"GetConstructors", ves_icall_Type_GetConstructors_internal},
{"GetConstructors_internal", ves_icall_Type_GetConstructors_internal},
+ {"GetCorrespondingInflatedConstructor", ves_icall_MonoType_GetCorrespondingInflatedMethod},
+ {"GetCorrespondingInflatedField", ves_icall_MonoType_GetCorrespondingInflatedField},
+ {"GetCorrespondingInflatedMethod", ves_icall_MonoType_GetCorrespondingInflatedMethod},
{"GetElementType", ves_icall_MonoType_GetElementType},
{"GetEvents_internal", ves_icall_Type_GetEvents_internal},
{"GetField", ves_icall_Type_GetField},
static const IcallEntry monogenericclass_icalls [] = {
{"GetConstructors_internal", ves_icall_MonoGenericClass_GetConstructors},
+ {"GetCorrespondingInflatedConstructor", ves_icall_MonoGenericClass_GetCorrespondingInflatedConstructor},
+ {"GetCorrespondingInflatedField", ves_icall_MonoGenericClass_GetCorrespondingInflatedField},
+ {"GetCorrespondingInflatedMethod", ves_icall_MonoGenericClass_GetCorrespondingInflatedMethod},
{"GetEvents_internal", ves_icall_MonoGenericClass_GetEvents},
{"GetFields_internal", ves_icall_MonoGenericClass_GetFields},
{"GetInterfaces_internal", ves_icall_MonoGenericClass_GetInterfaces},
{"System.Char", char_icalls, G_N_ELEMENTS (char_icalls)},
{"System.Configuration.DefaultConfig", defaultconf_icalls, G_N_ELEMENTS (defaultconf_icalls)},
{"System.ConsoleDriver", consoledriver_icalls, G_N_ELEMENTS (consoledriver_icalls)},
+ {"System.Convert", convert_icalls, G_N_ELEMENTS (convert_icalls)},
{"System.CurrentTimeZone", timezone_icalls, G_N_ELEMENTS (timezone_icalls)},
{"System.DateTime", datetime_icalls, G_N_ELEMENTS (datetime_icalls)},
#ifndef DISABLE_DECIMAL
#include <glib.h>
#include <gmodule.h>
+G_BEGIN_DECLS
+
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
typedef struct _MonoTableInfo MonoTableInfo;
const char *name, guint32 idx);
gboolean mono_image_has_authenticode_entry (MonoImage *image);
+G_END_DECLS
#endif
class_name = qname = fqname = NULL;
while (klass) {
+ MonoGenericContext *context = NULL;
+
+ if (klass->generic_container)
+ context = &klass->generic_container->context;
+ else if (klass->generic_class)
+ context = klass->generic_class->context;
+
mono_class_setup_methods (klass);
for (i = 0; i < klass->method.count; ++i) {
MonoMethod *m = klass->methods [i];
goto out;
}
} else {
- if (mono_metadata_signature_equal (sig, mono_method_signature (m))) {
+ MonoMethodSignature *msig = mono_method_signature_full (m, context);
+ if (mono_metadata_signature_equal (sig, msig)) {
result = m;
goto out;
}
MonoMethodSignature*
mono_method_signature (MonoMethod *m)
+{
+ return mono_method_signature_full (m, NULL);
+}
+
+MonoMethodSignature*
+mono_method_signature_full (MonoMethod *m, MonoGenericContext *context)
{
int idx;
int size;
sig = mono_metadata_blob_heap (img, mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_SIGNATURE));
size = mono_metadata_decode_blob_size (sig, &sig);
- m->signature = mono_metadata_parse_method_signature_full (img, NULL, idx, sig, NULL);
+ m->signature = mono_metadata_parse_method_signature_full (img, context, idx, sig, NULL);
if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
m->signature->pinvoke = 1;
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
+G_BEGIN_DECLS
+
typedef struct _MonoMethod MonoMethod;
typedef gboolean (*MonoStackWalk) (MonoMethod *method, gint32 native_offset, gint32 il_offset, gboolean managed, gpointer data);
void
mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data);
+G_END_DECLS
+
#endif
sizeof (CultureInfoNameEntry), culture_name_locator);
if (ne == NULL) {
- g_print ("ne (%s) is null\n", n);
+ /*g_print ("ne (%s) is null\n", n);*/
g_free (n);
return FALSE;
}
klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
method_needs_context_sink = mono_class_get_method_from_name (klass, "get_NeedsContextSink", -1);
+
+ module_initialized = TRUE;
}
}
MonoClass *klass;
MonoDomain *domain = ((MonoObject*)tproxy)->vtable->domain;
klass = mono_class_from_mono_type (rtype->type);
- mono_upgrade_remote_class (domain, tproxy->remote_class, klass);
- ((MonoObject*)tproxy)->vtable = mono_remote_class_vtable (domain, tproxy->remote_class, tproxy->rp);
+ mono_upgrade_remote_class (domain, (MonoObject*)tproxy, klass);
}
/**
#include <mono/metadata/opcodes.h>
#include <mono/metadata/reflection.h>
+G_BEGIN_DECLS
+
typedef struct _MonoMethodBuilder MonoMethodBuilder;
/* marshaling helper functions */
MonoDelegate*
ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionType *type);
+G_END_DECLS
+
#endif /* __MONO_MARSHAL_H__ */
#ifndef _MONO_MEMPOOL_H_
#define _MONO_MEMPOOL_H_
+G_BEGIN_DECLS
+
typedef struct _MonoMemPool MonoMemPool;
MonoMemPool *
gboolean
mono_mempool_contains_addr (MonoMemPool *pool,
- gpointer addr);
+ gpointer addr);
+
+G_END_DECLS
#endif
#include <mono/metadata/row-indexes.h>
#include <mono/metadata/image.h>
+G_BEGIN_DECLS
+
#ifdef __GNUC__
#define MONO_ZERO_LEN_ARRAY 0
#else
guint32 mono_metadata_declsec_from_index (MonoImage *meta, guint32 idx);
+G_END_DECLS
+
#endif /* __MONO_METADATA_H__ */
#define _MONO_METADATA_MONITOR_H_
#include <glib.h>
-
#include <mono/metadata/object.h>
+G_BEGIN_DECLS
+
void mono_monitor_init (void);
extern gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj, guint32 ms);
extern void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj);
extern gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj, guint32 ms);
+G_END_DECLS
+
#endif /* _MONO_METADATA_MONITOR_H_ */
#include <glib.h>
+G_BEGIN_DECLS
+
void mono_gc_collect (int generation);
int mono_gc_max_generation (void);
gint64 mono_gc_get_used_size (void);
gint64 mono_gc_get_heap_size (void);
+G_END_DECLS
+
#endif /* __METADATA_MONO_GC_H__ */
MonoMethodSignature*
mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context);
+void
+mono_upgrade_remote_class (MonoDomain *domain, MonoObject *tproxy, MonoClass *klass);
+
#endif /* __MONO_OBJECT_INTERNALS_H__ */
return pvt;
}
+/**
+ * create_remote_class_key:
+ * Creates an array of pointers that can be used as a hash key for a remote class.
+ * The first element of the array is the number of pointers.
+ */
+static gpointer*
+create_remote_class_key (MonoRemoteClass *remote_class, MonoClass *extra_class)
+{
+ gpointer *key;
+ int i, j;
+
+ if (remote_class == NULL) {
+ if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ key = g_malloc (sizeof(gpointer) * 3);
+ key [0] = GINT_TO_POINTER (2);
+ key [1] = mono_defaults.marshalbyrefobject_class;
+ key [2] = extra_class;
+ } else {
+ key = g_malloc (sizeof(gpointer) * 2);
+ key [0] = GINT_TO_POINTER (1);
+ key [1] = extra_class;
+ }
+ } else {
+ if (extra_class != NULL && (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE)) {
+ key = g_malloc (sizeof(gpointer) * (remote_class->interface_count + 3));
+ key [0] = GINT_TO_POINTER (remote_class->interface_count + 2);
+ key [1] = remote_class->proxy_class;
+
+ // Keep the list of interfaces sorted
+ for (i = 0, j = 2; i < remote_class->interface_count; i++, j++) {
+ if (extra_class && remote_class->interfaces [i] > extra_class) {
+ key [j++] = extra_class;
+ extra_class = NULL;
+ }
+ key [j] = remote_class->interfaces [i];
+ }
+ if (extra_class)
+ key [j] = extra_class;
+ } else {
+ // Replace the old class. The interface list is the same
+ key = g_malloc (sizeof(gpointer) * (remote_class->interface_count + 2));
+ key [0] = GINT_TO_POINTER (remote_class->interface_count + 1);
+ key [1] = extra_class != NULL ? extra_class : remote_class->proxy_class;
+ for (i = 0; i < remote_class->interface_count; i++)
+ key [2 + i] = remote_class->interfaces [i];
+ }
+ }
+
+ return key;
+}
+
/**
* mono_remote_class:
* @domain: the application domain
mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class)
{
MonoRemoteClass *rc;
-
+ gpointer* key;
+
+ key = create_remote_class_key (NULL, proxy_class);
+
mono_domain_lock (domain);
- rc = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class_name);
+ rc = mono_g_hash_table_lookup (domain->proxy_vtable_hash, key);
if (rc) {
+ g_free (key);
mono_domain_unlock (domain);
return rc;
}
- rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass));
+ if (proxy_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass) + sizeof(MonoClass*));
+ rc->interface_count = 1;
+ rc->interfaces [0] = proxy_class;
+ rc->proxy_class = mono_defaults.marshalbyrefobject_class;
+ } else {
+ rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass));
+ rc->interface_count = 0;
+ rc->proxy_class = proxy_class;
+ }
+
rc->default_vtable = NULL;
rc->xdomain_vtable = NULL;
- rc->interface_count = 0;
- rc->interfaces = NULL;
- rc->proxy_class = mono_defaults.marshalbyrefobject_class;
rc->proxy_class_name = mono_string_to_utf8 (class_name);
- mono_g_hash_table_insert (domain->proxy_vtable_hash, class_name, rc);
- mono_upgrade_remote_class (domain, rc, proxy_class);
+ mono_g_hash_table_insert (domain->proxy_vtable_hash, key, rc);
mono_domain_unlock (domain);
-
return rc;
}
-static void
-extend_interface_array (MonoDomain *domain, MonoRemoteClass *remote_class, int amount)
+/**
+ * clone_remote_class:
+ * Creates a copy of the remote_class, adding the provided class or interface
+ */
+static MonoRemoteClass*
+clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass *extra_class)
{
- /* Extends the array of interfaces. Memory is extended using blocks of 5 pointers */
-
- int current_size = ((remote_class->interface_count / 5) + 1) * 5;
- remote_class->interface_count += amount;
-
- if (remote_class->interface_count > current_size || remote_class->interfaces == NULL)
- {
- int new_size = ((remote_class->interface_count / 5) + 1) * 5;
- MonoClass **new_array = mono_mempool_alloc (domain->mp, new_size * sizeof (MonoClass*));
+ MonoRemoteClass *rc;
+ gpointer* key;
- if (remote_class->interfaces != NULL)
- memcpy (new_array, remote_class->interfaces, current_size * sizeof (MonoClass*));
+ key = create_remote_class_key (remote_class, extra_class);
+ rc = mono_g_hash_table_lookup (domain->proxy_vtable_hash, key);
+ if (rc != NULL) {
+ g_free (key);
+ return rc;
+ }
+
+ if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ int i,j;
+ rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass) + sizeof(MonoClass*) * (remote_class->interface_count + 1));
+ rc->proxy_class = remote_class->proxy_class;
+ rc->interface_count = remote_class->interface_count + 1;
- remote_class->interfaces = new_array;
+ // Keep the list of interfaces sorted, since the hash key of
+ // the remote class depends on this
+ for (i = 0, j = 0; i < remote_class->interface_count; i++, j++) {
+ if (remote_class->interfaces [i] > extra_class && i == j)
+ rc->interfaces [j++] = extra_class;
+ rc->interfaces [j] = remote_class->interfaces [i];
+ }
+ if (i == j)
+ rc->interfaces [j] = extra_class;
+ } else {
+ // Replace the old class. The interface array is the same
+ rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass) + sizeof(MonoClass*) * remote_class->interface_count);
+ rc->proxy_class = extra_class;
+ rc->interface_count = remote_class->interface_count;
+ if (rc->interface_count > 0)
+ memcpy (rc->interfaces, remote_class->interfaces, rc->interface_count * sizeof (MonoClass*));
}
+
+ rc->default_vtable = NULL;
+ rc->xdomain_vtable = NULL;
+ rc->proxy_class_name = remote_class->proxy_class_name;
+
+ mono_g_hash_table_insert (domain->proxy_vtable_hash, key, rc);
+
+ return rc;
}
gpointer
mono_remote_class_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, MonoRealProxy *rp)
{
+ mono_domain_lock (domain);
if (rp->target_domain_id != -1) {
if (remote_class->xdomain_vtable == NULL)
remote_class->xdomain_vtable = mono_class_proxy_vtable (domain, remote_class, MONO_REMOTING_TARGET_APPDOMAIN);
+ mono_domain_unlock (domain);
return remote_class->xdomain_vtable;
}
if (remote_class->default_vtable == NULL)
remote_class->default_vtable = mono_class_proxy_vtable (domain, remote_class, MONO_REMOTING_TARGET_UNKNOWN);
+ mono_domain_unlock (domain);
return remote_class->default_vtable;
}
-
/**
* mono_upgrade_remote_class:
* @domain: the application domain
- * @remote_class: the remote class
+ * @tproxy: the proxy whose remote class has to be upgraded.
* @klass: class to which the remote class can be casted.
*
* Updates the vtable of the remote class by adding the necessary method slots
* and interface offsets so it can be safely casted to klass. klass can be a
* class or an interface.
*/
-void mono_upgrade_remote_class (MonoDomain *domain, MonoRemoteClass *remote_class, MonoClass *klass)
+void
+mono_upgrade_remote_class (MonoDomain *domain, MonoObject *proxy_object, MonoClass *klass)
{
+ MonoTransparentProxy *tproxy;
+ MonoRemoteClass *remote_class;
gboolean redo_vtable;
mono_domain_lock (domain);
+ tproxy = (MonoTransparentProxy*) proxy_object;
+ remote_class = tproxy->remote_class;
+
if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
int i;
redo_vtable = TRUE;
- for (i = 0; i < remote_class->interface_count; i++)
- if (remote_class->interfaces[i] == klass) redo_vtable = FALSE;
-
- if (redo_vtable) {
- extend_interface_array (domain, remote_class, 1);
- remote_class->interfaces [remote_class->interface_count-1] = klass;
- }
+ for (i = 0; i < remote_class->interface_count && redo_vtable; i++)
+ if (remote_class->interfaces [i] == klass)
+ redo_vtable = FALSE;
}
else {
redo_vtable = (remote_class->proxy_class != klass);
- remote_class->proxy_class = klass;
}
if (redo_vtable) {
- remote_class->default_vtable = NULL;
- remote_class->xdomain_vtable = NULL;
+ tproxy->remote_class = clone_remote_class (domain, remote_class, klass);
+ proxy_object->vtable = mono_remote_class_vtable (domain, tproxy->remote_class, tproxy->rp);
}
-/*
- int n;
- printf ("remote class upgrade - class:%s num-interfaces:%d\n", remote_class->proxy_class_name, remote_class->interface_count);
- for (n=0; n<remote_class->interface_count; n++)
- printf (" I:%s\n", remote_class->interfaces[n]->name);
-*/
-
mono_domain_unlock (domain);
}
+
/**
* mono_object_get_virtual_method:
* @obj: object to operate on.
if (*(MonoBoolean *) mono_object_unbox(res)) {
/* Update the vtable of the remote type, so it can safely cast to this new type */
- mono_upgrade_remote_class (domain, ((MonoTransparentProxy *)obj)->remote_class, klass);
- obj->vtable = mono_remote_class_vtable (domain, ((MonoTransparentProxy *)obj)->remote_class, (MonoRealProxy *)rp);
+ mono_upgrade_remote_class (domain, obj, klass);
return obj;
}
}
#include <mono/metadata/class.h>
+G_BEGIN_DECLS
+
typedef guchar MonoBoolean;
typedef struct _MonoReflectionMethod MonoReflectionMethod;
MonoRemoteClass*
mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class);
-void
-mono_upgrade_remote_class (MonoDomain *domain, MonoRemoteClass *remote_class, MonoClass *klass);
-
/* accessors for fields and properties */
void
mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value);
MonoObject* mono_gchandle_get_target (guint32 gchandle);
void mono_gchandle_free (guint32 gchandle);
+G_END_DECLS
+
#endif
#include <glib.h>
+G_BEGIN_DECLS
+
#define MONO_CUSTOM_PREFIX 0xf0
#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
MonoOpcodeEnum
mono_opcode_value (const guint8 **ip, const guint8 *end);
+G_END_DECLS
+
#endif /* __MONO_METADATA_OPCODES_H__ */
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
+G_BEGIN_DECLS
+
typedef enum {
MONO_PROFILE_NONE = 0,
MONO_PROFILE_APPDOMAIN_EVENTS = 1 << 0,
typedef struct _MonoProfiler MonoProfiler;
+
/*
* Functions that the runtime will call on the profiler.
*/
void mono_profiler_load (const char *desc);
+G_END_DECLS
+
#endif /* __MONO_PROFILER_H__ */
else
assembly->assembly.aname.culture = g_strdup ("");
+ if (assemblyb->version) {
+ char **version = g_strsplit (mono_string_to_utf8 (assemblyb->version), ".", 4);
+ char **parts = version;
+ assembly->assembly.aname.major = atoi (*parts++);
+ assembly->assembly.aname.minor = atoi (*parts++);
+ assembly->assembly.aname.build = *parts != NULL ? atoi (*parts++) : 0;
+ assembly->assembly.aname.revision = *parts != NULL ? atoi (*parts) : 0;
+
+ g_strfreev (version);
+ } else {
+ assembly->assembly.aname.major = 0;
+ assembly->assembly.aname.minor = 0;
+ assembly->assembly.aname.build = 0;
+ assembly->assembly.aname.revision = 0;
+ }
+
assembly->run = assemblyb->access != 2;
assembly->save = assemblyb->access != 1;
return NULL;
}
+static MonoObject*
+create_cattr_typed_arg (MonoType *t, MonoObject *val)
+{
+ static MonoClass *klass;
+ static MonoMethod *ctor;
+ MonoObject *retval;
+ void *params [2], *unboxed;
+
+ if (!klass)
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "CustomAttributeTypedArgument");
+ if (!ctor)
+ ctor = mono_class_get_method_from_name (klass, ".ctor", 2);
+
+ params [0] = mono_type_get_object (mono_domain_get (), t);
+ params [1] = val;
+ retval = mono_object_new (mono_domain_get (), klass);
+ unboxed = mono_object_unbox (retval);
+ mono_runtime_invoke (ctor, unboxed, params, NULL);
+
+ return retval;
+}
+
+static MonoObject*
+create_cattr_named_arg (void *minfo, MonoObject *typedarg)
+{
+ static MonoClass *klass;
+ static MonoMethod *ctor;
+ MonoObject *retval;
+ void *unboxed, *params [2];
+
+ if (!klass)
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "CustomAttributeNamedArgument");
+ if (!ctor)
+ ctor = mono_class_get_method_from_name (klass, ".ctor", 2);
+
+ params [0] = minfo;
+ params [1] = typedarg;
+ retval = mono_object_new (mono_domain_get (), klass);
+ unboxed = mono_object_unbox (retval);
+ mono_runtime_invoke (ctor, unboxed, params, NULL);
+
+ return retval;
+}
+
static gboolean
type_is_reference (MonoType *type)
{
return attr;
}
+static MonoObject*
+create_custom_attr_data (MonoImage *image, MonoMethod *method, const char *data, guint32 len)
+{
+ MonoArray *typedargs, *namedargs;
+ MonoClass *attrklass;
+ static MonoClass *klass;
+ static MonoMethod *ctor;
+ MonoDomain *domain;
+ MonoObject *attr;
+ const char *p = data;
+ const char *named;
+ guint32 i, j, num_named;
+ void *params [3];
+
+ mono_class_init (method->klass);
+
+ if (!klass)
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "CustomAttributeData");
+ if (!ctor)
+ ctor = mono_class_get_method_from_name (klass, ".ctor", 3);
+
+ domain = mono_domain_get ();
+ if (len == 0) {
+ /* This is for Attributes with no parameters */
+ attr = mono_object_new (domain, klass);
+ params [0] = mono_method_get_object (domain, method, NULL);
+ params [1] = params [2] = NULL;
+ mono_runtime_invoke (method, attr, params, NULL);
+ return attr;
+ }
+
+ if (len < 2 || read16 (p) != 0x0001) /* Prolog */
+ return NULL;
+
+ typedargs = mono_array_new (domain, mono_get_object_class (), mono_method_signature (method)->param_count);
+
+ /* skip prolog */
+ p += 2;
+ for (i = 0; i < mono_method_signature (method)->param_count; ++i) {
+ MonoObject *obj, *typedarg;
+ void *val;
+
+ val = load_cattr_value (image, mono_method_signature (method)->params [i], p, &p);
+ obj = type_is_reference (mono_method_signature (method)->params [i]) ?
+ val : mono_value_box (domain, mono_class_from_mono_type (mono_method_signature (method)->params [i]), val);
+ typedarg = create_cattr_typed_arg (mono_method_signature (method)->params [i], obj);
+ mono_array_set (typedargs, void*, i, typedarg);
+
+ if (!type_is_reference (mono_method_signature (method)->params [i]))
+ g_free (val);
+ }
+
+ named = p;
+ num_named = read16 (named);
+ namedargs = mono_array_new (domain, mono_get_object_class (), num_named);
+ named += 2;
+ attrklass = method->klass;
+ for (j = 0; j < num_named; j++) {
+ gint name_len;
+ char *name, named_type, data_type;
+ named_type = *named++;
+ data_type = *named++; /* type of data */
+ if (data_type == 0x55) {
+ gint type_len;
+ char *type_name;
+ type_len = mono_metadata_decode_blob_size (named, &named);
+ type_name = g_malloc (type_len + 1);
+ memcpy (type_name, named, type_len);
+ type_name [type_len] = 0;
+ named += type_len;
+ /* FIXME: lookup the type and check type consistency */
+ } else if (data_type == MONO_TYPE_SZARRAY && (named_type == 0x54 || named_type == 0x53)) {
+ /* this seems to be the type of the element of the array */
+ /* g_print ("skipping 0x%02x after prop\n", *named); */
+ named++;
+ }
+ name_len = mono_metadata_decode_blob_size (named, &named);
+ name = g_malloc (name_len + 1);
+ memcpy (name, named, name_len);
+ name [name_len] = 0;
+ named += name_len;
+ if (named_type == 0x53) {
+ MonoObject *obj, *typedarg, *namedarg;
+ MonoClassField *field = mono_class_get_field_from_name (attrklass, name);
+ void *minfo, *val = load_cattr_value (image, field->type, named, &named);
+
+ minfo = mono_field_get_object (domain, NULL, field);
+ obj = type_is_reference (field->type) ? val : mono_value_box (domain, mono_class_from_mono_type (field->type), val);
+ typedarg = create_cattr_typed_arg (field->type, obj);
+ namedarg = create_cattr_named_arg (minfo, typedarg);
+ mono_array_set (namedargs, void*, j, namedarg);
+ if (!type_is_reference (field->type))
+ g_free (val);
+ } else if (named_type == 0x54) {
+ MonoObject *obj, *typedarg, *namedarg;
+ MonoType *prop_type;
+ void *val, *minfo;
+ MonoProperty *prop = mono_class_get_property_from_name (attrklass, name);
+
+ prop_type = prop->get? mono_method_signature (prop->get)->ret :
+ mono_method_signature (prop->set)->params [mono_method_signature (prop->set)->param_count - 1];
+ minfo = mono_property_get_object (domain, NULL, prop);
+ val = load_cattr_value (image, prop_type, named, &named);
+ obj = type_is_reference (prop_type) ? val : mono_value_box (domain, mono_class_from_mono_type (prop_type), val);
+ typedarg = create_cattr_typed_arg (prop_type, obj);
+ namedarg = create_cattr_named_arg (minfo, typedarg);
+ mono_array_set (namedargs, void*, j, namedarg);
+ if (!type_is_reference (prop_type))
+ g_free (val);
+ }
+ g_free (name);
+ }
+ attr = mono_object_new (domain, klass);
+ params [0] = mono_method_get_object (domain, method, NULL);
+ params [1] = typedargs;
+ params [2] = namedargs;
+ mono_runtime_invoke (ctor, attr, params, NULL);
+ return attr;
+}
+
MonoArray*
mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo)
{
return result;
}
+MonoArray*
+mono_custom_attrs_data_construct (MonoCustomAttrInfo *cinfo)
+{
+ MonoArray *result;
+ static MonoClass *klass;
+ MonoObject *attr;
+ int i;
+
+ if (!klass)
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "CustomAttributeData");
+
+ result = mono_array_new (mono_domain_get (), klass, cinfo->num_attrs);
+ for (i = 0; i < cinfo->num_attrs; ++i) {
+ attr = create_custom_attr_data (cinfo->image, cinfo->attrs [i].ctor, cinfo->attrs [i].data, cinfo->attrs [i].data_size);
+ mono_array_set (result, gpointer, i, attr);
+ }
+ return result;
+}
+
MonoCustomAttrInfo*
mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
{
return result;
}
+/*
+ * mono_reflection_get_custom_attrs_data:
+ * @obj: a reflection obj handle
+ *
+ * Returns an array of System.Reflection.CustomAttributeData,
+ * which include information about attributes reflected on
+ * types loaded using the Reflection Only methods
+ */
+MonoArray*
+mono_reflection_get_custom_attrs_data (MonoObject *obj)
+{
+ MonoArray *result;
+ MonoCustomAttrInfo *cinfo;
+
+ cinfo = mono_reflection_get_custom_attrs_info (obj);
+ if (cinfo) {
+ result = mono_custom_attrs_data_construct (cinfo);
+ if (!cinfo->cached)
+ mono_custom_attrs_free (cinfo);
+ } else {
+ MonoClass *klass;
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "CustomAttributeData");
+ result = mono_array_new (mono_domain_get (), klass, 0);
+ }
+
+ return result;
+}
+
static MonoMethodSignature*
parameters_to_signature (MonoArray *parameters) {
MonoMethodSignature *sig;
method_aux = g_new0 (MonoReflectionMethodAux, 1);
- method_aux->dllentry = g_strdup (mono_string_to_utf8 (rmb->dllentry));
+ method_aux->dllentry = rmb->dllentry ? g_strdup (mono_string_to_utf8 (rmb->dllentry)) : g_strdup (m->name);
method_aux->dll = g_strdup (mono_string_to_utf8 (rmb->dll));
- ((MonoMethodPInvoke*)m)->piflags = (rmb->native_cc << 8) | (rmb->charset ? (rmb->charset - 1) * 2 : 1) | rmb->extra_flags;
+ ((MonoMethodPInvoke*)m)->piflags = (rmb->native_cc << 8) | (rmb->charset ? (rmb->charset - 1) * 2 : 0) | rmb->extra_flags;
if (klass->image->dynamic)
g_hash_table_insert (((MonoDynamicImage*)klass->image)->method_aux_hash, m, method_aux);
method = rmethod->method;
}
+ method = mono_get_inflated_method (method);
+
count = mono_method_signature (method)->generic_param_count;
if (count != mono_array_length (types))
return NULL;
context->gclass = method->klass->generic_class;
context->gmethod = gmethod;
- inflated = mono_class_inflate_generic_method (method, context, NULL);
+ if (method->is_inflated)
+ method = ((MonoMethodInflated *) method)->declaring;
+
+ inflated = mono_class_inflate_generic_method (method, context, method->klass);
g_hash_table_insert (container->method_hash, gmethod, inflated);
return mono_method_get_object (mono_object_domain (rmethod), inflated, NULL);
#include <mono/metadata/object.h>
+G_BEGIN_DECLS
+
typedef struct MonoTypeNameParse MonoTypeNameParse;
struct MonoTypeNameParse {
MonoObject* mono_get_dbnull_object (MonoDomain *domain);
MonoArray* mono_reflection_get_custom_attrs (MonoObject *obj);
+MonoArray* mono_reflection_get_custom_attrs_data (MonoObject *obj);
MonoArray* mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
MonoCustomAttrInfo* mono_reflection_get_custom_attrs_info (MonoObject *obj);
MonoArray* mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo);
+MonoArray* mono_custom_attrs_data_construct (MonoCustomAttrInfo *cinfo);
MonoCustomAttrInfo* mono_custom_attrs_from_index (MonoImage *image, guint32 idx);
MonoCustomAttrInfo* mono_custom_attrs_from_method (MonoMethod *method);
MonoCustomAttrInfo* mono_custom_attrs_from_class (MonoClass *klass);
MonoBoolean mono_declsec_get_class_action (MonoClass *klass, guint32 action, MonoDeclSecurityEntry *entry);
MonoBoolean mono_declsec_get_assembly_action (MonoAssembly *assembly, guint32 action, MonoDeclSecurityEntry *entry);
+G_END_DECLS
+
#endif /* __METADATA_REFLECTION_H__ */
#include <mono/metadata/object.h>
+G_BEGIN_DECLS
/* System.Environment */
extern MonoString* ves_icall_System_Environment_get_UserName (void);
/* System.Security.Policy.Evidence */
MonoBoolean ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent (MonoReflectionAssembly *refass);
+G_END_DECLS
#endif /* _MONO_METADATA_SECURITY_H_ */
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
+G_BEGIN_DECLS
+
typedef void (*MonoThreadCleanupFunc) (MonoThread* thread);
extern int mono_thread_get_abort_signal (void);
extern void mono_thread_force_interruption_checkpoint (void);
extern gint32* mono_thread_interruption_request_flag (void);
+G_END_DECLS
+
#endif /* _MONO_METADATA_THREADS_H_ */
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
+G_BEGIN_DECLS
+
typedef enum {
MONO_VERIFY_OK,
MONO_VERIFY_ERROR,
void mono_free_verify_list (GSList *list);
char* mono_verify_corlib (void);
+G_END_DECLS
+
#endif /* __MONO_METADATA_VERIFY_H__ */
+2005-06-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_jit_free_method): Remove the method from the JitInfo table
+ before freeing the code memory. Fixes #74990.
+
+ * objects.cs: Add regression test for #74992.
+
+ * liveness.c: Extend live ranges of arguments to the beginning of the
+ method. Fixes #74992.
+
+ * exceptions-ia64.c mini-ia64.h: Modify ip during exception handling
+ so it points into the faulting instruction.
+
+2005-06-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * jit-icalls.c (mono_imul_ovf): Add exception handling.
+
+ * *-ia64.*: Ongoing IA64 work.
+
+ * mini.c (mini_init): Fix signature of mono_delegate_ctor.
+
+2005-06-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-ia64.h exceptions-ia64.c: Ongoing IA64 work.
+
+ * *-ia64.*: Ongoing IA64 work.
+
+2005-06-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic-long.cs: Add tests for add/sub.ovf.
+
+ * basic.cs: Add tests for sub.ovf.
+
+ * *-ia64.*: Ongoing IA64 work.
+
+2005-06-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * *-ia64.*: Ongoing IA64 work.
+
+ * basic.cs: Add conv.ovf.i4.un test.
+
+2005-06-09 Massimiliano Mantione <massi@ximian.com>
+
+ * mini.c: (remove_block_if_useless) Fixed bug 75061.
+
+2005-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: no SIGUSR2 on windows. Remove it for PLATFORM_WIN32.
+
+2005-06-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * *-ia64.*: Ongoing IA64 work.
+
+2005-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * trace.[ch]:
+ * mini.c: added the ability to toggle trace on/off using SIGUSR2.
+
2005-06-04 Zoltan Varga <vargaz@freemail.hu>
* mini-ia64.c mini-ia64.h: Fix cleanup of memory stack.
return (int)((a - 1) + 1);
}
+ public static int test_0_add_ovf () {
+ long i, j, k;
+
+ checked {
+ i = System.Int64.MinValue;
+ j = 0;
+ k = i + j;
+ }
+
+ if (k != System.Int64.MinValue)
+ return 1;
+
+ checked {
+ i = System.Int64.MaxValue;
+ j = 0;
+ k = i + j;
+ }
+
+ if (k != System.Int64.MaxValue)
+ return 2;
+
+ checked {
+ i = System.Int64.MinValue;
+ j = System.Int64.MaxValue;
+ k = i + j;
+ }
+
+ if (k != -1)
+ return 3;
+
+ checked {
+ i = System.Int64.MaxValue;
+ j = System.Int64.MinValue;
+ k = i + j;
+ }
+
+ if (k != -1)
+ return 4;
+
+ checked {
+ i = System.Int64.MinValue + 1234;
+ j = -1234;
+ k = i + j;
+ }
+
+ if (k != System.Int64.MinValue)
+ return 5;
+
+ checked {
+ i = System.Int64.MaxValue - 1234;
+ j = 1234;
+ k = i + j;
+ }
+
+ if (k != System.Int64.MaxValue)
+ return 6;
+
+ return 0;
+ }
+
+ public static int test_0_add_un_ovf () {
+ ulong n = (ulong)134217728 * 16;
+ ulong number = checked (n + (uint)0);
+
+ return number == n ? 0 : 1;
+ }
+
+ public static int test_0_sub_ovf () {
+ long i, j, k;
+
+ checked {
+ i = System.Int64.MinValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.Int64.MinValue)
+ return 1;
+
+ checked {
+ i = System.Int64.MaxValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.Int64.MaxValue)
+ return 2;
+
+ checked {
+ i = System.Int64.MinValue;
+ j = System.Int64.MinValue + 1234;
+ k = i - j;
+ }
+
+ if (k != -1234)
+ return 3;
+
+ checked {
+ i = System.Int64.MaxValue;
+ j = 1234;
+ k = i - j;
+ }
+
+ if (k != System.Int64.MaxValue - 1234)
+ return 4;
+
+ checked {
+ i = System.Int64.MaxValue - 1234;
+ j = -1234;
+ k = i - j;
+ }
+
+ if (k != System.Int64.MaxValue)
+ return 5;
+
+ checked {
+ i = System.Int64.MinValue + 1234;
+ j = 1234;
+ k = i - j;
+ }
+
+ if (k != System.Int64.MinValue)
+ return 6;
+
+ return 0;
+ }
+
+ public static int test_0_sub_ovf_un () {
+ ulong i, j, k;
+
+ checked {
+ i = System.UInt64.MaxValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.UInt64.MaxValue)
+ return 1;
+
+ checked {
+ i = System.UInt64.MaxValue;
+ j = System.UInt64.MaxValue;
+ k = i - j;
+ }
+
+ if (k != 0)
+ return 2;
+
+ return 0;
+ }
+
public static int test_2_neg () {
long a = -2;
return (int)(-a);
}
}
- public static int test_0_shl () {
- long a = 9;
- int b = 1;
-
- if ((a >> b) != 4)
- return 1;
-
-
- return 0;
- }
-
- public static int test_1_rshift ()
- {
- long a = 9;
- int b = 1;
- a = -9;
- if ((a >> b) != -5)
- return 0;
- return 1;
- }
-
public static int test_5_shift ()
{
long a = 9;
}
return (int)res;
}
+
+ public static int test_0_mul_imm () {
+ long i = 4;
+
+ if ((i * 0) != 0)
+ return 1;
+ if ((i * 1) != 4)
+ return 2;
+ if ((i * 2) != 8)
+ return 3;
+ if ((i * 3) != 12)
+ return 4;
+ if ((i * 1234) != 4936)
+ return 5;
+ if ((i * -1) != -4)
+ return 6;
+ if ((i * -2) != -8)
+ return 7;
+ if ((i * -3) != -12)
+ return 8;
+ if ((i * -1234) != -4936)
+ return 9;
+
+ return 0;
+ }
public static int test_4_divun () {
uint b = 12;
return number == n ? 0 : 1;
}
+ public static int test_0_sub_ovf () {
+ int i, j, k;
+
+ checked {
+ i = System.Int32.MinValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.Int32.MinValue)
+ return 1;
+
+ checked {
+ i = System.Int32.MaxValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.Int32.MaxValue)
+ return 2;
+
+ checked {
+ i = System.Int32.MinValue;
+ j = System.Int32.MinValue + 1234;
+ k = i - j;
+ }
+
+ if (k != -1234)
+ return 3;
+
+ checked {
+ i = System.Int32.MaxValue;
+ j = 1234;
+ k = i - j;
+ }
+
+ if (k != System.Int32.MaxValue - 1234)
+ return 4;
+
+ checked {
+ i = System.Int32.MaxValue - 1234;
+ j = -1234;
+ k = i - j;
+ }
+
+ if (k != System.Int32.MaxValue)
+ return 5;
+
+ checked {
+ i = System.Int32.MinValue + 1234;
+ j = 1234;
+ k = i - j;
+ }
+
+ if (k != System.Int32.MinValue)
+ return 6;
+
+ return 0;
+ }
+
+ public static int test_0_sub_ovf_un () {
+ uint i, j, k;
+
+ checked {
+ i = System.UInt32.MaxValue;
+ j = 0;
+ k = i - j;
+ }
+
+ if (k != System.UInt32.MaxValue)
+ return 1;
+
+ checked {
+ i = System.UInt32.MaxValue;
+ j = System.UInt32.MaxValue;
+ k = i - j;
+ }
+
+ if (k != 0)
+ return 2;
+
+ return 0;
+ }
+
public static int test_3_or () {
int b = 2;
int a = 3;
return 0;
}
+
+ public static int test_0_conv_ovf_i4_un () {
+ uint c;
+
+ checked {
+ c = 0x7fffffff;
+ int b = (int)c;
+ }
+
+ return 0;
+ }
public static int test_0_bool () {
bool val = true;
isinst:
conv.r.un: dest:f src1:i len:48
unbox:
-throw: src1:i len:48
+throw: src1:i len:96
op_rethrow: src1:i len:48
ldfld:
ldflda:
stobj:
conv.ovf.i1.un:
conv.ovf.i2.un:
-conv.ovf.i4.un: dest:i src1:i len:48
+conv.ovf.i4.un: dest:i src1:i len:96
conv.ovf.i8.un:
conv.ovf.u1.un:
conv.ovf.u2.un:
mul.ovf.un: dest:i src1:i src2:i len:48
sub.ovf:
sub.ovf.un:
-endfinally:
leave:
leave.s:
stind.i:
ldloca:
stloc:
localloc: dest:i src1:i len:48
-endfilter:
unaligned.:
volatile.:
tail.:
float_clt_un_membase: dest:i src1:f src2:b len:48
float_conv_to_u: dest:i src1:f len:48
fmove: dest:f src1:f len:48
-call_handler: len:48
+call_handler: len:96
+start_handler: len:96
+op_endfilter: len:96
+endfinally: len:96
+endfilter: len:96
aot_const: dest:i len:48
tls_get: dest:i len:48
atomic_add_i4: src1:b src2:i dest:i len:48
op_bigmul_un: len:48 dest:i src1:a src2:i
sext_i1: dest:i src1:i len:48
sext_i2: dest:i src1:i len:48
+sext_i4: dest:i src1:i len:48
+zext_i1: dest:i src1:i len:48
+zext_i2: dest:i src1:i len:48
+zext_i4: dest:i src1:i len:48
# 32 bit opcodes
int_add: dest:i src1:i src2:i len:48
int_sbb: dest:i src1:i src2:i len:48
int_sbb_imm: dest:i src1:i len:48
int_addcc: dest:i src1:i src2:i len:96
-int_subcc: dest:i src1:i src2:i len:48
+int_subcc: dest:i src1:i src2:i len:96
int_add_imm: dest:i src1:i len:48
int_sub_imm: dest:i src1:i len:48
int_mul_imm: dest:i src1:i len:48
ia64_br_cond: len:48
ia64_cond_exc: len:48
ia64_cset: dest:i len:48
+
* (C) 2001 Ximian, Inc.
*/
+/*
+ * We implement exception handling with the help of the libuwind library:
+ *
+ * http://www.hpl.hp.com/research/linux/libunwind/
+ *
+ * Under IA64 all functions are assumed to have unwind info, we do not need to save
+ * the machine state in the LMF. But we have to generate unwind info for all
+ * dynamically generated code.
+ */
+
#include <config.h>
#include <glib.h>
#include <signal.h>
#define NOT_IMPLEMENTED g_assert_not_reached ()
+#define GP_SCRATCH_REG 31
+#define GP_SCRATCH_REG2 30
+
+static gpointer
+mono_create_ftnptr (gpointer ptr)
+{
+ gpointer *desc = g_malloc (2 * sizeof (gpointer));
+ desc [0] = ptr;
+ desc [1] = NULL;
+
+ return desc;
+}
+
+static void
+restore_context (MonoContext *ctx)
+{
+ int res;
+
+ /* Set this to 0 to tell OP_START_HANDLER that it doesn't have to set the frame pointer */
+ res = unw_set_reg (&ctx->cursor, UNW_IA64_GR + 15, 0);
+ g_assert (res == 0);
+
+ unw_resume (&ctx->cursor);
+}
+
/*
* mono_arch_get_restore_context:
*
gpointer
mono_arch_get_restore_context (void)
{
- static guint8 *start = NULL;
+ return restore_context;
+}
+
+static gpointer
+get_real_call_filter (void)
+{
+ static guint8 *start;
static gboolean inited = FALSE;
Ia64CodegenState code;
+ int in0, local0, out0, nout;
if (inited)
return start;
- /* restore_contect (MonoContext *ctx) */
+ start = mono_global_codeman_reserve (1024);
- start = mono_global_codeman_reserve (256);
+ /* FIXME: add unwind info */
+
+ /* int call_filter (guint64 fp, guint64 ip) */
+
+ /*
+ * We have to create a register+stack frame similar to the frame which contains
+ * the filter.
+ * - setting fp
+ * - setting up a register stack frame
+ * These cannot be set up in this function, because the fp register is a stacked
+ * register which is different in each method. Also, the register stack frame is
+ * different in each method. So we pass the FP value in a a non-stacked
+ * register and the code generated by the OP_START_HANDLER opcode will copy it
+ * to the appropriate register after setting up the register stack frame.
+ * The stacked registers are not need to be set since variables used in
+ * handler registers are never allocated to registers.
+ */
+
+ in0 = 32;
+ local0 = in0 + 2;
+ out0 = local0 + 4;
+ nout = 0;
- /* FIXME: */
ia64_codegen_init (code, start);
- ia64_break_i (code, 0);
+
+ ia64_alloc (code, local0 + 0, local0 - in0, out0 - local0, nout, 0);
+ ia64_mov_from_br (code, local0 + 1, IA64_B0);
+
+ /* Frame pointer */
+ ia64_mov (code, IA64_R15, in0 + 0);
+ /* Target ip */
+ ia64_mov_to_br (code, IA64_B0, in0 + 1);
+ /* Return address */
+ ia64_mov_from_ip (code, GP_SCRATCH_REG);
+ ia64_adds_imm (code, GP_SCRATCH_REG, 3 * 16, GP_SCRATCH_REG);
+
+ /* Call the filter */
+ ia64_br_cond_reg (code, IA64_B0);
+
+ /* R8 contains the result of the filter */
+ ia64_mov_to_ar_i (code, IA64_PFS, local0 + 0);
+ ia64_mov_ret_to_br (code, IA64_B0, local0 + 1);
+ ia64_br_ret_reg (code, IA64_B0);
+
ia64_codegen_close (code);
g_assert ((code.buf - start) <= 256);
mono_arch_flush_icache (start, code.buf - start);
- return start;
+ return mono_create_ftnptr (start);
+}
+
+static int
+call_filter (MonoContext *ctx, gpointer ip)
+{
+ static int (*filter) (MonoContext *, gpointer) = NULL;
+ gpointer fp = MONO_CONTEXT_GET_BP (ctx);
+
+ /* FIXME: thread safety */
+ if (!filter)
+ filter = get_real_call_filter ();
+
+ return filter (fp, ip);
}
/*
gpointer
mono_arch_get_call_filter (void)
{
- static guint8 *start;
- static gboolean inited = FALSE;
- int i;
- guint32 pos;
- Ia64CodegenState code;
-
- if (inited)
- return start;
-
- if (inited)
- return start;
-
- start = mono_global_codeman_reserve (256);
-
- /* call_filter (MonoContext *ctx, unsigned long eip) */
-
- /* FIXME: */
- ia64_codegen_init (code, start);
- ia64_break_i (code, 0);
- ia64_codegen_close (code);
-
- g_assert ((code.buf - start) <= 256);
-
- mono_arch_flush_icache (start, code.buf - start);
-
- return start;
+ return call_filter;
}
static void
-throw_exception (MonoObject *exc, guint64 rip, guint64 rsp,
- guint64 rbx, guint64 rbp, guint64 r12, guint64 r13,
- guint64 r14, guint64 r15, guint64 rethrow)
+throw_exception (MonoObject *exc, guint64 rethrow)
{
- static void (*restore_context) (MonoContext *);
+ unw_context_t unw_ctx;
MonoContext ctx;
-
- if (!restore_context)
- restore_context = mono_arch_get_restore_context ();
-
- NOT_IMPLEMENTED;
+ MonoJitInfo *ji;
+ unw_word_t ip;
+ int res;
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ if (!rethrow)
+ mono_ex->stack_trace = NULL;
+ }
+
+ res = unw_getcontext (&unw_ctx);
+ g_assert (res == 0);
+ res = unw_init_local (&ctx.cursor, &unw_ctx);
+ g_assert (res == 0);
+
+ /*
+ * Unwind until the first managed frame. This is needed since
+ * mono_handle_exception expects the variables in the original context to
+ * correspond to the method returned by mono_find_jit_info.
+ */
+ while (TRUE) {
+ res = unw_get_reg (&ctx.cursor, UNW_IA64_IP, &ip);
+ g_assert (res == 0);
+
+ ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)ip);
+
+ if (ji)
+ break;
+
+ res = unw_step (&ctx.cursor);
+ g_assert (res >= 0);
+ }
+
+ mono_handle_exception (&ctx, exc, (gpointer)(ip), FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
}
static gpointer
{
guint8* start;
Ia64CodegenState code;
+ gpointer ptr = throw_exception;
+ int i, in0, local0, out0;
+ unw_dyn_info_t *di;
+ unw_dyn_region_info_t *r_pro;
- start = mono_global_codeman_reserve (64);
+ start = mono_global_codeman_reserve (256);
+
+ in0 = 32;
+ local0 = in0 + 1;
+ out0 = local0 + 2;
- /* FIXME: */
ia64_codegen_init (code, start);
+ ia64_alloc (code, local0 + 0, local0 - in0, out0 - local0, 3, 0);
+ ia64_mov_from_br (code, local0 + 1, IA64_B0);
+
+ /* FIXME: This depends on the current instruction emitter */
+
+ r_pro = g_malloc0 (_U_dyn_region_info_size (2));
+ r_pro->op_count = 2;
+ r_pro->insn_count = 6;
+ i = 0;
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 2,
+ /* reg=*/ UNW_IA64_AR_PFS, /* dst=*/ UNW_IA64_GR + local0 + 0);
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 5,
+ /* reg=*/ UNW_IA64_RP, /* dst=*/ UNW_IA64_GR + local0 + 1);
+ g_assert ((unsigned) i <= r_pro->op_count);
+
+ /* Set args */
+ ia64_mov (code, out0 + 0, in0 + 0);
+ ia64_adds_imm (code, out0 + 1, rethrow, IA64_R0);
+
+ /* Call throw_exception */
+ ia64_movl (code, GP_SCRATCH_REG, ptr);
+ ia64_ld8_inc_imm (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 8);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_ld8 (code, IA64_GP, GP_SCRATCH_REG);
+ ia64_br_call_reg (code, IA64_B0, IA64_B6);
+
+ /* Not reached */
ia64_break_i (code, 0);
ia64_codegen_close (code);
mono_arch_flush_icache (start, code.buf - start);
- return start;
+ di = g_malloc0 (sizeof (unw_dyn_info_t));
+ di->start_ip = (unw_word_t) start;
+ di->end_ip = (unw_word_t) code.buf;
+ di->gp = 0;
+ di->format = UNW_INFO_FORMAT_DYNAMIC;
+ di->u.pi.name_ptr = (unw_word_t)"throw_trampoline";
+ di->u.pi.regions = r_pro;
+
+ _U_dyn_register (di);
+
+ return mono_create_ftnptr (start);
}
/**
gpointer
mono_arch_get_throw_exception_by_name (void)
{
- static gboolean inited = FALSE;
guint8* start;
Ia64CodegenState code;
{
static guint8* start;
static gboolean inited = FALSE;
- guint64 throw_ex;
+ gpointer ptr;
+ int i, in0, local0, out0, nout;
Ia64CodegenState code;
+ unw_dyn_info_t *di;
+ unw_dyn_region_info_t *r_pro;
if (inited)
return start;
- start = mono_global_codeman_reserve (64);
+ start = mono_global_codeman_reserve (1024);
+
+ in0 = 32;
+ local0 = in0 + 2;
+ out0 = local0 + 4;
+ nout = 3;
- /* FIXME: */
ia64_codegen_init (code, start);
+ ia64_alloc (code, local0 + 0, local0 - in0, out0 - local0, nout, 0);
+ ia64_mov_from_br (code, local0 + 1, IA64_RP);
+
+ r_pro = g_malloc0 (_U_dyn_region_info_size (2));
+ r_pro->op_count = 2;
+ r_pro->insn_count = 6;
+ i = 0;
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 2,
+ /* reg=*/ UNW_IA64_AR_PFS, /* dst=*/ UNW_IA64_GR + local0 + 0);
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 5,
+ /* reg=*/ UNW_IA64_RP, /* dst=*/ UNW_IA64_GR + local0 + 1);
+ g_assert ((unsigned) i <= r_pro->op_count);
+
+ /* Call exception_from_token */
+ ia64_movl (code, out0 + 0, mono_defaults.exception_class->image);
+ ia64_mov (code, out0 + 1, in0 + 0);
+ ptr = mono_exception_from_token;
+ ia64_movl (code, GP_SCRATCH_REG, ptr);
+ ia64_ld8_inc_imm (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 8);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_ld8 (code, IA64_GP, GP_SCRATCH_REG);
+ ia64_br_call_reg (code, IA64_B0, IA64_B6);
+ ia64_mov (code, local0 + 3, IA64_R8);
+
+ /* Compute throw ip */
+ ia64_mov (code, local0 + 2, local0 + 1);
+ ia64_sub (code, local0 + 2, local0 + 2, in0 + 1);
+
+ /* Trick the unwind library into using throw_ip as the IP in the caller frame */
+ ia64_mov (code, local0 + 1, local0 + 2);
+
+ /* Set args */
+ ia64_mov (code, out0 + 0, local0 + 3);
+ ia64_mov (code, out0 + 1, IA64_R0);
+
+ /* Call throw_exception */
+ ptr = throw_exception;
+ ia64_movl (code, GP_SCRATCH_REG, ptr);
+ ia64_ld8_inc_imm (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 8);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_ld8 (code, IA64_GP, GP_SCRATCH_REG);
+ ia64_br_call_reg (code, IA64_B0, IA64_B6);
+
ia64_break_i (code, 0);
ia64_codegen_close (code);
- g_assert ((code.buf - start) <= 256);
+ g_assert ((code.buf - start) <= 1024);
+
+ di = g_malloc0 (sizeof (unw_dyn_info_t));
+ di->start_ip = (unw_word_t) start;
+ di->end_ip = (unw_word_t) code.buf;
+ di->gp = 0;
+ di->format = UNW_INFO_FORMAT_DYNAMIC;
+ di->u.pi.name_ptr = (unw_word_t)"throw_corlib_exception_trampoline";
+ di->u.pi.regions = r_pro;
+
+ _U_dyn_register (di);
mono_arch_flush_icache (start, code.buf - start);
- return start;
+ return mono_create_ftnptr (start);
}
/* mono_arch_find_jit_info:
gboolean *managed)
{
MonoJitInfo *ji;
- int i;
- gpointer ip = MONO_CONTEXT_GET_IP (ctx);
-
- NOT_IMPLEMENTED;
- return NULL;
+ int err;
+ unw_word_t ip;
+
+ *new_ctx = *ctx;
+
+ while (TRUE) {
+ err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip);
+ g_assert (err == 0);
+
+ /* Avoid costly table lookup during stack overflow */
+ if (prev_ji && ((guint8*)ip > (guint8*)prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, (gpointer)ip);
+
+ if (managed)
+ *managed = FALSE;
+
+ /*
+ {
+ char name[256];
+ unw_word_t off;
+
+ unw_get_proc_name (&new_ctx->cursor, name, 256, &off);
+ printf ("F: %s\n", name);
+ }
+ */
+
+ if (ji != NULL) {
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ /*
+ * Some managed methods like pinvoke wrappers might have save_lmf set.
+ * In this case, register save/restore code is not generated by the
+ * JIT, so we have to restore callee saved registers from the lmf.
+ */
+ if (ji->method->save_lmf) {
+ }
+ else {
+ }
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (new_ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ break;
+ }
+
+ /* This is an unmanaged frame, so just unwind through it */
+ err = unw_step (&new_ctx->cursor);
+ g_assert (err >= 0);
+
+ if (err == 0)
+ break;
+ }
+
+ if (ji) {
+ err = unw_step (&new_ctx->cursor);
+ g_assert (err >= 0);
+
+ return ji;
+ }
+ else
+ return NULL;
}
/**
gboolean
mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
{
- ucontext_t *ctx = (ucontext_t*)sigctx;
- MonoContext mctx;
+ /* libunwind takes care of this */
+ unw_context_t unw_ctx;
+ MonoContext ctx;
+ MonoJitInfo *ji;
+ unw_word_t ip;
+ int res;
- NOT_IMPLEMENTED;
- return FALSE;
+ res = unw_getcontext (&unw_ctx);
+ g_assert (res == 0);
+ res = unw_init_local (&ctx.cursor, &unw_ctx);
+ g_assert (res == 0);
+
+ /*
+ * Unwind until the first managed frame. This skips the signal handler frames
+ * too.
+ */
+ while (TRUE) {
+ res = unw_get_reg (&ctx.cursor, UNW_IA64_IP, &ip);
+ g_assert (res == 0);
+
+ ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)ip);
+
+ if (ji)
+ break;
+
+ res = unw_step (&ctx.cursor);
+ g_assert (res >= 0);
+ }
+
+ mono_handle_exception (&ctx, obj, (gpointer)ip, test_only);
+
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
}
gpointer
stmt: OP_START_HANDLER {
- /* FIXME: */
+ mono_bblock_add_inst (s->cbb, tree);
}
stmt: CEE_ENDFINALLY {
- /* FIXME: */
+ mono_bblock_add_inst (s->cbb, tree);
}
stmt: OP_ENDFILTER (reg) {
- /* FIXME: */
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
}
%%
{
MONO_ARCH_SAVE_REGS;
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (0x80000000))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
return a / b;
}
{
MONO_ARCH_SAVE_REGS;
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
return a / b;
}
{
MONO_ARCH_SAVE_REGS;
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (0x80000000))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
+
return a % b;
}
{
MONO_ARCH_SAVE_REGS;
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
return a % b;
}
res = (gint64)a * (gint64)b;
- /* FIXME: */
+ if ((res > 0x7fffffffL) || (res < -2147483648))
+ mono_raise_exception (mono_get_exception_overflow ());
+
return res;
}
}
esize *= ind;
- ea = (gpointer*)((char*)this->vector + esize);
+ ea = (gpointer*)(gpointer)((char*)this->vector + esize);
va_end(ap);
handle_exception_clauses (cfg);
+ /*
+ * Arguments need to have their live ranges extended to the beginning of
+ * the method to account for the arg reg/memory -> global register copies
+ * in the prolog (bug #74992).
+ */
+
+ for (i = 0; i < max_vars; i ++) {
+ MonoMethodVar *vi = MONO_VARINFO (cfg, i);
+ if (cfg->varinfo [vi->idx]->opcode == OP_ARG)
+ vi->range.first_use.abs_pos = 0;
+ }
+
#ifdef DEBUG_LIVENESS
for (i = cfg->num_bblocks - 1; i >= 0; i--) {
MonoBasicBlock *bb = cfg->bblocks [i];
g_error ("Unknown opcode: %s\n", mono_inst_name (ins->opcode));
if (spec [MONO_INST_DEST]) {
- gboolean fp = (spec [MONO_INST_DEST] == 'f');
+ gboolean fp = dreg_is_fp (ins);
if (is_soft_reg (ins->dreg, fp))
g_print (" R%d <-", ins->dreg);
else if (spec [MONO_INST_DEST] == 'b') {
}
}
+static void
+free_up_reg (MonoCompile *cfg, InstList *item, MonoInst *ins, int hreg, gboolean fp)
+{
+ if (fp) {
+ if (!(cfg->rs->ffree_mask & (1 << hreg))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", cfg->rs->isymbolic [hreg]));
+ get_register_force_spilling (cfg, item, ins, cfg->rs->isymbolic [hreg], fp);
+ mono_regstate_free_float (cfg->rs, hreg);
+ }
+ }
+ else {
+ if (!(cfg->rs->ifree_mask & (1 << hreg))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", cfg->rs->isymbolic [hreg]));
+ get_register_force_spilling (cfg, item, ins, cfg->rs->isymbolic [hreg], fp);
+ mono_regstate_free_int (cfg->rs, hreg);
+ }
+ }
+}
+
static MonoInst*
create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins, gboolean fp)
{
copy->next = ins->next;
ins->next = copy;
}
- DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_regname_full (src, fp), mono_regname_full (dest, fp)));
return copy;
}
fpcount--;
}
- if (spec [MONO_INST_DEST] == 'f') {
+ if (dreg_is_fp (ins)) {
if (use_fpstack && (spec [MONO_INST_CLOB] != 'm')) {
if (fpcount >= MONO_ARCH_FPSTACK_SIZE) {
reginfof [ins->dreg].flags |= MONO_FP_NEEDS_SPILL;
if (spec [MONO_INST_DEST]) {
int dest_dreg;
- if (spec [MONO_INST_DEST] == 'f')
+ if (dreg_is_fp (ins))
reginfod = reginfof;
else
reginfod = reginfo;
* TRACK FP STACK
*/
if (use_fpstack && (spec [MONO_INST_CLOB] != 'm')) {
- if (spec [MONO_INST_DEST] == 'f') {
+ if (dreg_is_fp (ins)) {
if (reginfof [ins->dreg].flags & MONO_FP_NEEDS_SPILL) {
GList *spill_node;
MonoInst *store;
create_copy_ins (cfg, ins->dreg, dest_dreg, ins, fp);
ins->dreg = dest_dreg;
- if (rs->isymbolic [dest_dreg] >= MONO_MAX_IREGS)
- free_up_ireg (cfg, tmp, ins, dest_dreg);
+ if (fp) {
+ if (rs->fsymbolic [dest_dreg] >= MONO_MAX_FREGS)
+ free_up_reg (cfg, tmp, ins, dest_dreg, fp);
+ }
+ else {
+ if (rs->isymbolic [dest_dreg] >= MONO_MAX_IREGS)
+ free_up_reg (cfg, tmp, ins, dest_dreg, fp);
+ }
}
/*
}
/* Handle dreg==sreg1 */
- if (((spec [MONO_INST_DEST] == 'f' && spec [MONO_INST_SRC1] == 'f' && !use_fpstack) || spec [MONO_INST_CLOB] == '1') && ins->dreg != ins->sreg1) {
+ if (((dreg_is_fp (ins) && spec [MONO_INST_SRC1] == 'f' && !use_fpstack) || spec [MONO_INST_CLOB] == '1') && ins->dreg != ins->sreg1) {
MonoInst *sreg2_copy = NULL;
MonoInst *copy;
gboolean fp = (spec [MONO_INST_SRC1] == 'f');
cfg->arch.reg_saved_b0 = cfg->arch.reg_local0 - 2;
cfg->arch.reg_saved_sp = cfg->arch.reg_local0 - 3;
+ /*
+ * Need to allocate at least 2 out register for use by CEE_THROW / the system
+ * exception throwing code.
+ */
+ cfg->arch.n_out_regs = MAX (cfg->arch.n_out_regs, 2);
+
g_free (cinfo);
}
}
case OP_MUL_IMM: {
/* This should be emulated, but rules in inssel.brg generate it */
- int i;
+ int i, sum_reg;
/* First the easy cases */
if (ins->inst_imm == 1) {
break;
}
+ /* This could be optimized */
if (ins->opcode == OP_MUL_IMM) {
- /* FIXME: */
- g_error ("Multiplication by %ld not implemented\n", ins->inst_imm);
+ sum_reg = 0;
+ for (i = 0; i < 64; ++i) {
+ if (ins->inst_imm & (((gint64)1) << i)) {
+ NEW_INS (cfg, temp, OP_SHL_IMM);
+ temp->dreg = mono_regstate_next_int (cfg->rs);
+ temp->sreg1 = ins->sreg1;
+ temp->inst_imm = i;
+
+ if (sum_reg == 0)
+ sum_reg = temp->dreg;
+ else {
+ NEW_INS (cfg, temp2, CEE_ADD);
+ temp2->dreg = mono_regstate_next_int (cfg->rs);
+ temp2->sreg1 = sum_reg;
+ temp2->sreg2 = temp->dreg;
+ sum_reg = temp2->dreg;
+ }
+ }
+ }
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = sum_reg;
}
break;
}
+ case CEE_CONV_OVF_U4:
+ NEW_INS (cfg, temp, OP_IA64_CMP4_LT);
+ temp->sreg1 = ins->sreg1;
+ temp->sreg2 = IA64_R0;
+
+ NEW_INS (cfg, temp, OP_IA64_COND_EXC);
+ temp->inst_p1 = (char*)"OverflowException";
+
+ ins->opcode = OP_MOVE;
+ break;
+ case CEE_CONV_OVF_I4_UN:
+ NEW_INS (cfg, temp, OP_ICONST);
+ temp->inst_c0 = 0x7fffffff;
+ temp->dreg = mono_regstate_next_int (cfg->rs);
+
+ NEW_INS (cfg, temp2, OP_IA64_CMP4_GT_UN);
+ temp2->sreg1 = ins->sreg1;
+ temp2->sreg2 = temp->dreg;
+
+ NEW_INS (cfg, temp, OP_IA64_COND_EXC);
+ temp->inst_p1 = (char*)"OverflowException";
+
+ ins->opcode = OP_MOVE;
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I2:
+ case OP_FCONV_TO_U2:
+ case OP_FCONV_TO_U1:
+ NEW_INS (cfg, temp, OP_FCONV_TO_I8);
+ temp->sreg1 = ins->sreg1;
+ temp->dreg = ins->dreg;
+
+ switch (ins->opcode) {
+ case OP_FCONV_TO_I4:
+ ins->opcode = OP_SEXT_I4;
+ break;
+ case OP_FCONV_TO_I2:
+ ins->opcode = OP_SEXT_I2;
+ break;
+ case OP_FCONV_TO_U2:
+ ins->opcode = OP_ZEXT_I4;
+ break;
+ case OP_FCONV_TO_U1:
+ ins->opcode = OP_ZEXT_I1;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ins->sreg1 = ins->dreg;
+ break;
default:
break;
}
{
mono_add_patch_info (cfg, code.buf - cfg->native_code, patch_type, data);
- if (patch_type == MONO_PATCH_INFO_ABS) {
+ if ((patch_type == MONO_PATCH_INFO_ABS) || (patch_type == MONO_PATCH_INFO_INTERNAL_METHOD)) {
/* Indirect call */
ia64_movl (code, GP_SCRATCH_REG, 0);
ia64_ld8_inc_imm (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 8);
while (ins) {
offset = code.buf - cfg->native_code;
- max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ max_len = ((int)(((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN])) + 128;
- if (offset > (cfg->code_size - max_len - 16)) {
+ while (offset + max_len + 16 > cfg->code_size) {
ia64_codegen_close (code);
offset = code.buf - cfg->native_code;
ia64_begin_bundle (code);
ins->inst_c0 = code.buf - cfg->native_code;
break;
+ case CEE_NOP:
+ break;
case OP_BR_REG:
ia64_mov_to_br (code, IA64_B6, ins->sreg1);
ia64_br_cond_reg (code, IA64_B6);
/* (sreg2 <= 0) && (res > ins->sreg1) => signed overflow */
ia64_cmp4_lt_pred (code, 9, 6, 10, ins->sreg1, GP_SCRATCH_REG);
+ /* res <u sreg1 => unsigned overflow */
+ ia64_cmp4_ltu (code, 7, 10, GP_SCRATCH_REG, ins->sreg1);
+
+ /* FIXME: Predicate this since this is a side effect */
+ ia64_mov (code, ins->dreg, GP_SCRATCH_REG);
+ break;
+ case OP_ISUBCC:
+ /* p6 and p7 is set if there is signed/unsigned overflow */
+
+ /* Set p8-p9 == (sreg2 > 0) */
+ ia64_cmp4_lt (code, 8, 9, IA64_R0, ins->sreg2);
+
+ ia64_sub (code, GP_SCRATCH_REG, ins->sreg1, ins->sreg2);
+
+ /* (sreg2 > 0) && (res > ins->sreg1) => signed overflow */
+ ia64_cmp4_gt_pred (code, 8, 6, 10, GP_SCRATCH_REG, ins->sreg1);
+ /* (sreg2 <= 0) && (res < ins->sreg1) => signed overflow */
+ ia64_cmp4_lt_pred (code, 9, 6, 10, GP_SCRATCH_REG, ins->sreg1);
+
+ /* sreg1 <u sreg2 => unsigned overflow */
+ ia64_cmp4_ltu (code, 7, 10, ins->sreg1, ins->sreg2);
+
+ /* FIXME: Predicate this since this is a side effect */
+ ia64_mov (code, ins->dreg, GP_SCRATCH_REG);
+ break;
+ case OP_ADDCC:
+ /* Same as OP_IADDCC */
+ ia64_cmp_lt (code, 8, 9, IA64_R0, ins->sreg2);
+
+ ia64_add (code, GP_SCRATCH_REG, ins->sreg1, ins->sreg2);
+
+ ia64_cmp_lt_pred (code, 8, 6, 10, GP_SCRATCH_REG, ins->sreg1);
+ ia64_cmp_lt_pred (code, 9, 6, 10, ins->sreg1, GP_SCRATCH_REG);
+
+ ia64_cmp_ltu (code, 7, 10, GP_SCRATCH_REG, ins->sreg1);
+
ia64_mov (code, ins->dreg, GP_SCRATCH_REG);
+ break;
+ case OP_SUBCC:
+ /* Same as OP_ISUBCC */
+
+ ia64_cmp_lt (code, 8, 9, IA64_R0, ins->sreg2);
+
+ ia64_sub (code, GP_SCRATCH_REG, ins->sreg1, ins->sreg2);
+
+ ia64_cmp_gt_pred (code, 8, 6, 10, GP_SCRATCH_REG, ins->sreg1);
+ ia64_cmp_lt_pred (code, 9, 6, 10, GP_SCRATCH_REG, ins->sreg1);
- /* FIXME: Set p7 as well */
+ ia64_cmp_ltu (code, 7, 10, ins->sreg1, ins->sreg2);
+
+ ia64_mov (code, ins->dreg, GP_SCRATCH_REG);
break;
case OP_ADD_IMM:
case OP_IADD_IMM:
case OP_SEXT_I2:
ia64_sxt2 (code, ins->dreg, ins->sreg1);
break;
+ case OP_SEXT_I4:
+ ia64_sxt4 (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_ZEXT_I1:
+ ia64_zxt1 (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_ZEXT_I2:
+ ia64_zxt2 (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_ZEXT_I4:
+ ia64_zxt4 (code, ins->dreg, ins->sreg1);
+ break;
/* Compare opcodes */
case OP_IA64_CMP4_EQ:
break;
case OP_COND_EXC_IOV:
- /* FIXME: */
- ia64_break_i_pred (code, 6, 0);
+ case OP_COND_EXC_OV:
+ mono_add_patch_info (cfg, code.buf - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ ia64_br_cond_pred (code, 6, 0);
break;
case OP_COND_EXC_IC:
- /* FIXME: */
- ia64_break_i_pred (code, 7, 0);
+ case OP_COND_EXC_C:
+ mono_add_patch_info (cfg, code.buf - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ ia64_br_cond_pred (code, 7, 0);
break;
case OP_IA64_COND_EXC:
- /* FIXME: */
- ia64_break_i_pred (code, 6, 0);
+ mono_add_patch_info (cfg, code.buf - cfg->native_code,
+ MONO_PATCH_INFO_EXC, ins->inst_p1);
+ ia64_br_cond_pred (code, 6, 0);
break;
case OP_IA64_CSET:
/* FIXME: Do this with one instruction ? */
case CEE_CONV_U:
ia64_zxt4 (code, ins->dreg, ins->sreg1);
break;
- case CEE_CONV_OVF_U4:
- /* FIXME: */
- ia64_mov (code, ins->dreg, ins->sreg1);
- break;
/*
* FLOAT OPCODES
case OP_FCONV_TO_R4:
ia64_fnorm_s_sf (code, ins->dreg, ins->sreg1, 0);
break;
- case OP_FCONV_TO_I4:
- case OP_FCONV_TO_I2:
- case OP_FCONV_TO_U2:
- case OP_FCONV_TO_U1:
- /* FIXME: sign/zero extend ? */
- ia64_fcvt_fx_trunc_sf (code, FP_SCRATCH_REG, ins->sreg1, 0);
- ia64_getf_sig (code, ins->dreg, FP_SCRATCH_REG);
- break;
case OP_FCONV_TO_I8:
- /* FIXME: Difference with OP_FCONV_TO_I4 ? */
ia64_fcvt_fx_trunc_sf (code, FP_SCRATCH_REG, ins->sreg1, 0);
ia64_getf_sig (code, ins->dreg, FP_SCRATCH_REG);
break;
code = emit_move_return_value (cfg, ins, code);
break;
+ case OP_LOCALLOC:
+ /* keep alignment */
+ ia64_adds_imm (code, GP_SCRATCH_REG, MONO_ARCH_FRAME_ALIGNMENT - 1, ins->sreg1);
+ ia64_movl (code, GP_SCRATCH_REG2, ~(MONO_ARCH_FRAME_ALIGNMENT - 1));
+ ia64_and (code, GP_SCRATCH_REG, GP_SCRATCH_REG, GP_SCRATCH_REG2);
+
+ ia64_sub (code, IA64_SP, IA64_SP, GP_SCRATCH_REG);
+
+ /* The first 16 bytes at sp are reserved by the ABI */
+ ia64_adds_imm (code, ins->dreg, 16, IA64_SP);
+
+ if (ins->flags & MONO_INST_INIT) {
+ /* Upper limit */
+ ia64_add (code, GP_SCRATCH_REG2, ins->dreg, GP_SCRATCH_REG);
+
+ /* Init loop */
+ ia64_st8_inc_imm_hint (code, ins->dreg, IA64_R0, 8, 0);
+ ia64_cmp_lt (code, 8, 9, ins->dreg, GP_SCRATCH_REG2);
+ ia64_br_cond_pred (code, 8, -2);
+
+ ia64_sub (code, ins->dreg, GP_SCRATCH_REG2, GP_SCRATCH_REG);
+ }
+
+ break;
+
/* Exception handling */
case OP_CALL_HANDLER:
- /* FIXME: */
+ /*
+ * Using a call instruction would mess up the register stack, so
+ * save the return address to a register and use a
+ * branch.
+ */
+ ia64_mov (code, IA64_R15, IA64_R0);
+ ia64_mov_from_ip (code, GP_SCRATCH_REG);
+ /* Add the length of OP_CALL_HANDLER */
+ ia64_adds_imm (code, GP_SCRATCH_REG, 5 * 16, GP_SCRATCH_REG);
+ mono_add_patch_info (cfg, code.buf - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ ia64_movl (code, GP_SCRATCH_REG2, 0);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_br_cond_reg (code, IA64_B6);
break;
+ case OP_START_HANDLER: {
+ /*
+ * We receive the return address in GP_SCRATCH_REG.
+ */
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ /*
+ * We might be called by the exception handling code, in which case the
+ * the register stack is not set up correctly. So do it now.
+ */
+ ia64_alloc (code, GP_SCRATCH_REG2, cfg->arch.reg_local0 - cfg->arch.reg_in0, cfg->arch.reg_out0 - cfg->arch.reg_local0, cfg->arch.n_out_regs, 0);
+
+ /* Set the fp register from the value passed in by the caller */
+ /* R15 is used since it is writable using libunwind */
+ /* R15 == 0 means we are called by OP_CALL_HANDLER or via resume_context () */
+ ia64_cmp_eq (code, 6, 7, IA64_R15, IA64_R0);
+ ia64_add_pred (code, 7, cfg->frame_reg, IA64_R0, IA64_R15);
+
+ ia64_adds_imm (code, GP_SCRATCH_REG2, spvar->inst_offset, cfg->frame_reg);
+ ia64_st8_hint (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 0);
+
+ break;
+ }
+ case CEE_ENDFINALLY: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ ia64_adds_imm (code, GP_SCRATCH_REG, spvar->inst_offset, cfg->frame_reg);
+ ia64_ld8_hint (code, GP_SCRATCH_REG, GP_SCRATCH_REG, 0);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG);
+ ia64_br_cond_reg (code, IA64_B6);
+ break;
+ }
+ case OP_ENDFILTER: {
+ /* FIXME: Return the value */
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ ia64_adds_imm (code, GP_SCRATCH_REG, spvar->inst_offset, cfg->frame_reg);
+ ia64_ld8_hint (code, GP_SCRATCH_REG, GP_SCRATCH_REG, 0);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG);
+ ia64_br_cond_reg (code, IA64_B6);
+ break;
+ }
case CEE_THROW:
- /* FIXME: */
- ia64_break_i (code, 0x1234);
+ ia64_mov (code, cfg->arch.reg_out0, ins->sreg1);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ break;
+ case OP_RETHROW:
+ ia64_mov (code, cfg->arch.reg_out0, ins->sreg1);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_rethrow_exception");
break;
default:
{0, 0, 0}
};
+static gboolean stops_in_template [32][3] = {
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, TRUE, FALSE },
+ { FALSE, TRUE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE },
+
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { TRUE, FALSE, FALSE },
+ { TRUE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, TRUE },
+ { FALSE, FALSE, FALSE },
+ { FALSE, FALSE, FALSE }
+};
+
+void
+ia64_emit_bundle (Ia64CodegenState *code, gboolean flush)
+{
+ int i, j, ins_type, template;
+
+ if (!code->automatic) {
+ if (code->nins == 0)
+ return;
+
+ g_assert (code->nins == 3);
+
+ /* Verify template is correct */
+ template = code->template;
+ for (j = 0; j < 3; ++j) {
+ if (code->stops [j])
+ g_assert (stops_in_template [template]);
+
+ ins_type = ins_types_in_template [template][j];
+ switch (code->itypes [j]) {
+ case IA64_INS_TYPE_A:
+ g_assert ((ins_type == IA64_INS_TYPE_I) || (ins_type == IA64_INS_TYPE_M));
+ break;
+ case IA64_INS_TYPE_LX:
+ g_assert (j == 1);
+ g_assert (ins_type == IA64_INS_TYPE_LX);
+ j ++;
+ break;
+ default:
+ g_assert (ins_type == code->itypes [j]);
+ }
+ }
+
+ ia64_emit_bundle_template (code, template, code->instructions [0], code->instructions [1], code->instructions [2]);
+ code->template = 0;
+ code->nins = 0;
+ return;
+ }
+
+ for (i = 0; i < code->nins; ++i) {
+ switch (code->itypes [i]) {
+ case IA64_INS_TYPE_A:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MIIS, code->instructions [i], IA64_NOP_I, IA64_NOP_I);
+ break;
+ case IA64_INS_TYPE_I:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MIIS, IA64_NOP_M, code->instructions [i], IA64_NOP_I);
+ break;
+ case IA64_INS_TYPE_M:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MIIS, code->instructions [i], IA64_NOP_I, IA64_NOP_I);
+ break;
+ case IA64_INS_TYPE_B:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MIBS, IA64_NOP_M, IA64_NOP_I, code->instructions [i]);
+ break;
+ case IA64_INS_TYPE_F:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MFIS, IA64_NOP_M, code->instructions [i], IA64_NOP_I);
+ break;
+ case IA64_INS_TYPE_LX:
+ ia64_emit_bundle_template (code, IA64_TEMPLATE_MLXS, IA64_NOP_M, code->instructions [i], code->instructions [i + 1]);
+ i ++;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ code->nins = 0;
+}
+
static void
ia64_patch (unsigned char* code, gpointer target)
{
int alloc_size, pos, max_offset, i;
Ia64CodegenState code;
CallInfo *cinfo;
+ unw_dyn_region_info_t *r_pro;
+ int unw_op_count;
sig = mono_method_signature (method);
pos = 0;
cfg->native_code = g_malloc (cfg->code_size);
ia64_codegen_init (code, cfg->native_code);
-
- ia64_alloc (code, cfg->arch.reg_saved_ar_pfs, cfg->arch.reg_local0 - cfg->arch.reg_in0, cfg->arch.reg_out0 - cfg->arch.reg_local0, cfg->arch.n_out_regs, 0);
- ia64_mov_from_br (code, cfg->arch.reg_saved_b0, IA64_B0);
+ ia64_codegen_set_automatic (code, FALSE);
alloc_size = ALIGN_TO (cfg->stack_offset, MONO_ARCH_FRAME_ALIGNMENT);
if (cfg->param_area)
alloc_size -= pos;
- if (alloc_size || cinfo->stack_usage)
+ /* Initialize unwind info */
+ r_pro = g_malloc0 (_U_dyn_region_info_size (3));
+ unw_op_count = 0;
+
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_MIIS);
+ ia64_alloc (code, cfg->arch.reg_saved_ar_pfs, cfg->arch.reg_local0 - cfg->arch.reg_in0, cfg->arch.reg_out0 - cfg->arch.reg_local0, cfg->arch.n_out_regs, 0);
+ ia64_mov_from_br (code, cfg->arch.reg_saved_b0, IA64_B0);
+
+ _U_dyn_op_save_reg (&r_pro->op[unw_op_count++], _U_QP_TRUE, /* when=*/ 0,
+ /* reg=*/ UNW_IA64_AR_PFS, /* dst=*/ UNW_IA64_GR + cfg->arch.reg_saved_ar_pfs);
+ _U_dyn_op_save_reg (&r_pro->op[unw_op_count++], _U_QP_TRUE, /* when=*/ 1,
+ /* reg=*/ UNW_IA64_RP, /* dst=*/ UNW_IA64_GR + cfg->arch.reg_saved_b0);
+
+ if (alloc_size || cinfo->stack_usage) {
ia64_mov (code, cfg->frame_reg, IA64_SP);
+ _U_dyn_op_save_reg (&r_pro->op[unw_op_count++], _U_QP_TRUE, /* when=*/ 2,
+ /* reg=*/ UNW_IA64_SP, /* dst=*/ UNW_IA64_GR + cfg->frame_reg);
+ }
+ else
+ ia64_nop_i (code, 0);
+ ia64_stop (code);
+ ia64_end_bundle (code);
+
+ /* Finish unwind info */
+ r_pro->op_count = unw_op_count;
+ r_pro->insn_count = (code.buf - cfg->native_code) >> 4;
+
+ cfg->arch.r_pro = r_pro;
if (alloc_size) {
/* See mono_emit_stack_alloc */
#if defined(MONO_ARCH_SIGSEGV_ON_ALTSTACK)
NOT_IMPLEMENTED;
#else
- ia64_mov (code, cfg->arch.reg_saved_sp, IA64_SP);
- if (ia64_is_imm14 (-alloc_size))
+ if (ia64_is_imm14 (-alloc_size)) {
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_MISI);
+ ia64_nop_m (code, 0);
+ ia64_mov (code, cfg->arch.reg_saved_sp, IA64_SP); ia64_stop (code);
ia64_adds_imm (code, IA64_SP, (-alloc_size), IA64_SP);
+ ia64_end_bundle (code);
+ }
else {
- ia64_movl (code, GP_SCRATCH_REG, -alloc_size);
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_MLXS);
+ ia64_mov (code, cfg->arch.reg_saved_sp, IA64_SP);
+ ia64_movl (code, GP_SCRATCH_REG, -alloc_size); ia64_stop (code);
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_MIIS);
ia64_add (code, IA64_SP, GP_SCRATCH_REG, IA64_SP);
+ ia64_nop_i (code, 0);
+ ia64_nop_i (code, 0); ia64_stop (code);
+ ia64_end_bundle (code);
}
#endif
}
-
- /* compute max_offset in order to use short forward jumps */
- max_offset = 0;
- if (cfg->opt & MONO_OPT_BRANCH) {
- for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
- MonoInst *ins = bb->code;
- bb->max_offset = max_offset;
-
- if (cfg->prof_options & MONO_PROFILE_COVERAGE)
- max_offset += 6;
- /* max alignment for loops */
- if ((cfg->opt & MONO_OPT_LOOP) && bb_is_loop_start (bb))
- max_offset += LOOP_ALIGNMENT;
-
- while (ins) {
- if (ins->opcode == OP_LABEL)
- ins->inst_c1 = max_offset;
-
- max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
- ins = ins->next;
- }
- }
- }
+ ia64_codegen_set_automatic (code, TRUE);
if (sig->ret->type != MONO_TYPE_VOID) {
if ((cinfo->ret.storage == ArgInIReg) && (cfg->ret->opcode != OP_REGVAR)) {
mono_jit_stats.code_reallocs++;
}
+ /* FIXME: Emit unwind info */
+
buf = cfg->native_code + cfg->code_len;
if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
}
g_free (cinfo);
+ ia64_end_bundle (code);
+ ia64_codegen_set_automatic (code, FALSE);
+
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_MIIS);
if (cfg->arch.stack_alloc_size)
ia64_mov (code, IA64_SP, cfg->arch.reg_saved_sp);
-
+ else
+ ia64_nop_m (code, 0);
ia64_mov_to_ar_i (code, IA64_PFS, cfg->arch.reg_saved_ar_pfs);
- ia64_mov_ret_to_br (code, IA64_B0, cfg->arch.reg_saved_b0);
+ ia64_mov_ret_to_br (code, IA64_B0, cfg->arch.reg_saved_b0); ia64_stop (code);
+ ia64_end_bundle (code);
+
+ ia64_begin_bundle_template (code, IA64_TEMPLATE_BBBS);
ia64_br_ret_reg (code, IA64_B0);
+ ia64_nop_b (code, 0);
+ ia64_nop_b (code, 0); ia64_stop (code);
+ ia64_end_bundle (code);
+ ia64_codegen_set_automatic (code, TRUE);
ia64_codegen_close (code);
cfg->code_len = code.buf - cfg->native_code;
/* Compute needed space */
for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
if (patch_info->type == MONO_PATCH_INFO_EXC)
- code_size += 40;
+ code_size += 256;
if (patch_info->type == MONO_PATCH_INFO_R8)
code_size += 8 + 7; /* sizeof (double) + alignment */
if (patch_info->type == MONO_PATCH_INFO_R4)
code_size += 4 + 7; /* sizeof (float) + alignment */
}
+ while (cfg->code_len + code_size > (cfg->code_size - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ mono_jit_stats.code_reallocs++;
+ }
+
ia64_codegen_init (code, cfg->native_code + cfg->code_len);
/* add code to raise exceptions */
+ /* FIXME: Optimize this */
nthrows = 0;
for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
switch (patch_info->type) {
case MONO_PATCH_INFO_EXC: {
- NOT_IMPLEMENTED;
- default:
+ MonoClass *exc_class;
+ guint8* throw_ip;
+ guint8* buf;
+
+ exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
+ g_assert (exc_class);
+ throw_ip = cfg->native_code + patch_info->ip.i;
+
+ ia64_patch (cfg->native_code + patch_info->ip.i, code.buf);
+
+ ia64_movl (code, cfg->arch.reg_out0 + 0, exc_class->type_token);
+
+ ia64_begin_bundle (code);
+
+ patch_info->data.name = "mono_arch_throw_corlib_exception";
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->ip.i = code.buf - cfg->native_code;
+
+ /* Indirect call */
+ ia64_movl (code, GP_SCRATCH_REG, 0);
+ ia64_ld8_inc_imm (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 8);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_ld8 (code, IA64_GP, GP_SCRATCH_REG);
+
+ /* Compute the offset */
+ buf = code.buf + 32;
+ ia64_movl (code, cfg->arch.reg_out0 + 1, buf - throw_ip);
+
+ ia64_br_call_reg (code, IA64_B0, IA64_B6);
break;
}
+ default:
+ break;
}
}
return NULL;
}
+void
+mono_arch_save_unwind_info (MonoCompile *cfg)
+{
+ unw_dyn_info_t *di;
+
+ /* FIXME: Unregister this for dynamic methods */
+
+ di = g_malloc0 (sizeof (unw_dyn_info_t));
+ di->start_ip = (unw_word_t) cfg->native_code;
+ di->end_ip = (unw_word_t) cfg->native_code + cfg->code_len;
+ di->gp = 0;
+ di->format = UNW_INFO_FORMAT_DYNAMIC;
+ di->u.pi.name_ptr = (unw_word_t)mono_method_full_name (cfg->method, TRUE);
+ di->u.pi.regions = cfg->arch.r_pro;
+
+ _U_dyn_register (di);
+}
+
void
mono_arch_flush_icache (guint8 *code, gint size)
{
void
mono_arch_flush_register_windows (void)
{
- NOT_IMPLEMENTED;
+ /* Not needed because of libunwind */
}
gboolean
gboolean
mono_arch_is_int_overflow (void *sigctx, void *info)
{
- NOT_IMPLEMENTED;
-
+ /* Division is emulated with explicit overflow checks */
return FALSE;
}
#include <glib.h>
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+
#include <mono/arch/ia64/ia64-codegen.h>
/* FIXME: regset -> 128 bits ! */
};
typedef struct MonoContext {
- guint8 *ip;
- gpointer *sp;
- gpointer *fp;
+ unw_cursor_t cursor;
} MonoContext;
typedef struct MonoCompileArch {
gint32 reg_saved_ar_pfs;
gint32 reg_saved_b0;
gint32 reg_saved_sp;
+ unw_dyn_region_info_t *r_pro;
} MonoCompileArch;
-#define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0);
-#define MONO_CONTEXT_SET_BP(ctx,ebp) do { (ctx)->fp = (gpointer*)(ebp); } while (0);
-#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->sp = (gpointer*)(esp); } while (0);
+static inline unw_word_t
+mono_ia64_context_get_ip (MonoContext *ctx)
+{
+ unw_word_t ip;
+ int err;
+
+ err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
+ g_assert (err == 0);
+
+ /* Subtrack 1 so ip points into the actual instruction */
+ return ip - 1;
+}
+
+static inline unw_word_t
+mono_ia64_context_get_sp (MonoContext *ctx)
+{
+ unw_word_t sp;
+ int err;
+
+ err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
+ g_assert (err == 0);
+
+ return sp;
+}
+
+static inline unw_word_t
+mono_ia64_context_get_fp (MonoContext *ctx)
+{
+ unw_cursor_t new_cursor;
+ unw_word_t fp;
+ int err;
+
+ {
+ unw_word_t ip, sp;
+
+ err = unw_get_reg (&ctx->cursor, UNW_IA64_SP, &sp);
+ g_assert (err == 0);
+
+ err = unw_get_reg (&ctx->cursor, UNW_IA64_IP, &ip);
+ g_assert (err == 0);
+ }
+
+ /* fp is the SP of the parent frame */
+ new_cursor = ctx->cursor;
+
+ err = unw_step (&new_cursor);
+ g_assert (err >= 0);
+
+ err = unw_get_reg (&new_cursor, UNW_IA64_SP, &fp);
+ g_assert (err == 0);
+
+ return fp;
+}
+
+#define MONO_CONTEXT_SET_IP(ctx,eip) do { int err = unw_set_reg (&(ctx)->cursor, UNW_IA64_IP, (eip)); g_assert (err == 0); } while (0)
+#define MONO_CONTEXT_SET_BP(ctx,ebp) do { } while (0)
+#define MONO_CONTEXT_SET_SP(ctx,esp) do { int err = unw_set_reg (&(ctx)->cursor, UNW_IA64_SP, (esp)); g_assert (err == 0); } while (0)
-#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->ip))
-#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->fp))
-#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->sp))
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)(mono_ia64_context_get_ip ((ctx))))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)(mono_ia64_context_get_fp ((ctx))))
+#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)(mono_ia64_context_get_sp ((ctx))))
#define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do { \
mono_arch_flush_register_windows (); \
#define MONO_ARCH_EMULATE_FREM 1
#define MONO_ARCH_EMULATE_MUL_DIV 1
#define MONO_ARCH_EMULATE_LONG_MUL_OPTS 1
+#define MONO_ARCH_NEED_DIV_CHECK 1
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
#define MONO_ARCH_HAVE_PIC_AOT 1
#define MONO_ARCH_HAVE_CREATE_TRAMPOLINE_FROM_TOKEN 1
+#define MONO_ARCH_HAVE_SAVE_UNWIND_INFO 1
#endif /* __MONO_MINI_IA64_H__ */
MINI_OP(OP_BR_REG, "br_reg")
MINI_OP(OP_SEXT_I1, "sext_i1")
MINI_OP(OP_SEXT_I2, "sext_i2")
+MINI_OP(OP_SEXT_I4, "sext_i4")
+MINI_OP(OP_ZEXT_I1, "zext_i1")
+MINI_OP(OP_ZEXT_I2, "zext_i2")
+MINI_OP(OP_ZEXT_I4, "zext_i4")
MINI_OP(OP_CNE, "cne")
/* to implement the upper half of long32 add and sub */
MINI_OP(OP_ADD_OVF_CARRY, "add_ovf_carry")
static MonoMethodSignature *helper_sig_obj_ptr_ptr = NULL;
static MonoMethodSignature *helper_sig_obj_obj_ptr_ptr = NULL;
static MonoMethodSignature *helper_sig_obj_obj_obj_ptr = NULL;
+static MonoMethodSignature *helper_sig_void_obj_obj_ptr = NULL;
static MonoMethodSignature *helper_sig_obj_void = NULL;
static MonoMethodSignature *helper_sig_ptr_void = NULL;
static MonoMethodSignature *helper_sig_void_void = NULL;
helper_sig_class_init_trampoline = make_icall_sig ("void");
helper_sig_obj_obj_obj_ptr = make_icall_sig ("object object object ptr");
+
+ helper_sig_void_obj_obj_ptr = make_icall_sig ("void object object ptr");
}
gconstpointer
return FALSE;
}
- if (target_bb != NULL) {
+ /* Check that there is a target BB, and that bb is not an empty loop (Bug 75061) */
+ if ((target_bb != NULL) && (target_bb != bb)) {
int i;
if (cfg->verbose_level > 1) {
}
#endif
+ /*
+ * This needs to be done before freeing code_mp, since the code address is the
+ * key in the table, so if we the code_mp first, another thread can grab the
+ * same code address and replace our entry in the table.
+ */
+ mono_jit_info_table_remove (domain, ji->ji);
+
if (destroy)
mono_code_manager_destroy (ji->code_mp);
- mono_jit_info_table_remove (domain, ji->ji);
g_free (ji->ji);
g_free (ji);
}
mono_arch_handle_exception (ctx, exc, FALSE);
}
+static void
+SIG_HANDLER_SIGNATURE (sigusr2_signal_handler)
+{
+ gboolean enabled = mono_trace_is_enabled ();
+
+ mono_trace_enable (!enabled);
+}
+
#ifndef PLATFORM_WIN32
static void
add_signal_handler (int signo, gpointer handler)
win32_seh_set_handler(SIGSEGV, sigsegv_signal_handler);
if (debug_options.handle_sigint)
win32_seh_set_handler(SIGINT, sigint_signal_handler);
+
#else /* !PLATFORM_WIN32 */
/* libpthreads has its own implementation of sigaction(),
add_signal_handler (SIGQUIT, sigquit_signal_handler);
add_signal_handler (SIGILL, sigill_signal_handler);
add_signal_handler (SIGBUS, sigsegv_signal_handler);
+ if (mono_jit_trace_calls != NULL)
+ add_signal_handler (SIGUSR2, sigusr2_signal_handler);
+
add_signal_handler (mono_thread_get_abort_signal (), sigusr1_signal_handler);
/* catch SIGSEGV */
#endif
/* other jit icalls */
- mono_register_jit_icall (mono_delegate_ctor, "mono_delegate_ctor", helper_sig_obj_obj_obj_ptr, FALSE);
+ mono_register_jit_icall (mono_delegate_ctor, "mono_delegate_ctor", helper_sig_void_obj_obj_ptr, FALSE);
mono_register_jit_icall (mono_class_static_field_address , "mono_class_static_field_address",
helper_sig_ptr_ptr_ptr, FALSE);
mono_register_jit_icall (mono_ldtoken_wrapper, "mono_ldtoken_wrapper", helper_sig_ptr_ptr_ptr_ptr, FALSE);
gpointer*mono_arch_get_vcall_slot_addr (guint8* code, gpointer *regs);
gpointer*mono_arch_get_delegate_method_ptr_addr (guint8* code, gpointer *regs);
void mono_arch_create_vars (MonoCompile *cfg);
+void mono_arch_save_unwind_info (MonoCompile *cfg);
/* Exception handling */
gboolean mono_handle_exception (MonoContext *ctx, gpointer obj,
return 1;
}
+ // bug #74992
+ public static int arg_only_written (string file_name, int[]
+ncells ) {
+ if (file_name == null)
+ return 1;
+
+ ncells = foo ();
+ bar (ncells [0]);
+
+ return 0;
+ }
+
+ public static int[] foo () {
+ return new int [3];
+ }
+
+ public static void bar (int i) {
+ }
+
+
+ public static int test_0_arg_only_written ()
+ {
+ return arg_only_written ("md.in", null);
+ }
}
TOKEN_NAMESPACE,
TOKEN_STRING,
TOKEN_EXCLUDE,
+ TOKEN_DISABLED,
TOKEN_SEPARATOR,
TOKEN_END,
TOKEN_ERROR
return TOKEN_ALL;
if (strcmp (value, "program") == 0)
return TOKEN_PROGRAM;
+ if (strcmp (value, "disabled") == 0)
+ return TOKEN_DISABLED;
return TOKEN_STRING;
}
if (*input == '-'){
} else if (token == TOKEN_STRING){
trace_spec.ops [*last].op = MONO_TRACEOP_ASSEMBLY;
trace_spec.ops [*last].data = g_strdup (value);
- }
- else {
+ } else if (token == TOKEN_DISABLED) {
+ trace_spec.enabled = FALSE;
+ } else {
fprintf (stderr, "Syntax error in trace option specification\n");
return TOKEN_ERROR;
}
int size = 1;
int last_used;
int token;
-
+
+ trace_spec.enabled = TRUE;
if (*p == 0){
trace_spec.len = 1;
trace_spec.ops = g_new0 (MonoTraceOperation, 1);
indent_level += diff;
}
-static gboolean enable_trace = TRUE;
-
void
mono_trace_enter_method (MonoMethod *method, char *ebp)
{
MonoMethodSignature *sig;
char *fname;
- if (!enable_trace)
+ if (!trace_spec.enabled)
return;
fname = mono_method_full_name (method, TRUE);
char *fname;
va_list ap;
- if (!enable_trace)
+ if (!trace_spec.enabled)
return;
va_start(ap, method);
//printf (" ip: %p\n", __builtin_return_address (1));
printf ("\n");
}
+
+void
+mono_trace_enable (gboolean enable)
+{
+ trace_spec.enabled = enable;
+}
+
+gboolean
+mono_trace_is_enabled ()
+{
+ return trace_spec.enabled;
+}
+
#ifndef __MONO_TRACE_H__
#define __MONO_TRACE_H__
+#include <glib.h>
typedef enum {
MONO_TRACEOP_ALL,
struct MonoTraceSpec {
int len;
+ gboolean enabled;
MonoTraceOperation *ops;
MonoAssembly *assembly;
};
+G_BEGIN_DECLS
+
void
mono_trace_enter_method (MonoMethod *method, char *ebp);
void
mono_trace_leave_method (MonoMethod *method, ...);
+void mono_trace_enable (gboolean enable);
+gboolean mono_trace_is_enabled (void);
+
+G_END_DECLS
+
#endif /* __MONO_TRACE_H__ */
#define NOT_IMPLEMENTED g_assert_not_reached ()
#define GP_SCRATCH_REG 31
+#define GP_SCRATCH_REG2 30
/*
* get_unbox_trampoline:
mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
{
guint8 *buf, *tramp;
- int i, lmf_offset, offset, tramp_offset, saved_regs_offset, saved_fpregs_offset, framesize;
- int l0, l1, l2, l3, l4, l5, l6, l7, o0, o1, o2, o3;
- gint64 disp;
+ int i, offset, saved_regs_offset, saved_fpregs_offset, framesize;
+ int in0, local0, out0, l0, l1, l2, l3, l4, l5, l6, l7, l8, o0, o1, o2, o3;
gboolean has_caller;
Ia64CodegenState code;
+ unw_dyn_info_t *di;
+ unw_dyn_region_info_t *r_pro;
if (tramp_type == MONO_TRAMPOLINE_JUMP)
has_caller = FALSE;
/* FIXME: Save/restore lmf */
/* Stacked Registers */
+ in0 = 32;
+ local0 = in0 + 8;
+ out0 = local0 + 16;
l0 = 40;
l1 = 41;
l2 = 42;
l5 = 45; /* saved ar.pfs */
l6 = 46; /* arg */
l7 = 47; /* code */
- o0 = 48; /* regs */
- o1 = 49; /* code */
- o2 = 50; /* arg */
- o3 = 51; /* tramp */
+ l8 = 48; /* saved sp */
+ o0 = out0 + 0; /* regs */
+ o1 = out0 + 1; /* code */
+ o2 = out0 + 2; /* arg */
+ o3 = out0 + 3; /* tramp */
framesize = (128 * 8) + 1024;
framesize = (framesize + (MONO_ARCH_FRAME_ALIGNMENT - 1)) & ~ (MONO_ARCH_FRAME_ALIGNMENT - 1);
/*
* Allocate a new register+memory stack frame.
* 8 input registers (the max used by the ABI)
- * 8 locals
+ * 16 locals
* 4 output (number of parameters passed to trampoline)
*/
- ia64_alloc (code, l5, 8, 8, 4, 0);
+ ia64_alloc (code, l5, local0 - in0, out0 - local0, 4, 0);
+ ia64_mov (code, l8, IA64_SP);
ia64_adds_imm (code, IA64_SP, (-framesize), IA64_SP);
offset = 16; /* scratch area */
/* Save the calling address */
ia64_mov_from_br (code, l7, IA64_B0);
+ /* Create unwind info for the prolog */
+ r_pro = g_malloc0 (_U_dyn_region_info_size (3));
+ r_pro->op_count = 3;
+ r_pro->insn_count = 16;
+ i = 0;
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 2,
+ /* reg=*/ UNW_IA64_AR_PFS, /* dst=*/ UNW_IA64_GR + local0 + 5);
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 5,
+ /* reg=*/ UNW_IA64_SP, /* dst=*/ UNW_IA64_GR + local0 + 8);
+ _U_dyn_op_save_reg (&r_pro->op[i++], _U_QP_TRUE, /* when=*/ 14,
+ /* reg=*/ UNW_IA64_RP, /* dst=*/ UNW_IA64_GR + local0 + 7);
+ g_assert ((unsigned) i <= r_pro->op_count);
+
/* Save registers */
saved_regs_offset = offset;
offset += 128 * 8;
g_assert ((code.buf - buf) <= 2048);
+ /* FIXME: emit unwind info for epilog */
+ di = g_malloc0 (sizeof (unw_dyn_info_t));
+ di->start_ip = (unw_word_t) buf;
+ di->end_ip = (unw_word_t) code.buf;
+ di->gp = 0;
+ di->format = UNW_INFO_FORMAT_DYNAMIC;
+ di->u.pi.name_ptr = (unw_word_t)"ia64_generic_trampoline";
+ di->u.pi.regions = r_pro;
+
+ _U_dyn_register (di);
+
mono_arch_flush_icache (buf, code.buf - buf);
return buf;
ia64_begin_bundle (code);
disp = (tramp - code.buf) >> 4;
- ia64_br_cond (code, disp);
+ if (ia64_is_imm21 (disp)) {
+ ia64_br_cond (code, disp);
+ }
+ else {
+ ia64_movl (code, GP_SCRATCH_REG2, tramp);
+ ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG2);
+ ia64_br_cond_reg (code, IA64_B6);
+ }
ia64_codegen_close (code);
+ g_assert (code.buf - buf <= TRAMPOLINE_SIZE);
+
mono_arch_flush_icache (buf, code.buf - buf);
ji = g_new0 (MonoJitInfo, 1);
+2005-06-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Makefile: Added quota. Removed XML files generation.
+ * quota.cs: New. Test if the restricted appdomain allows the # Kb of
+ IsolatedStorage.
+ * README: Updated informations (quota and default policies).
+ * sandbox.cs: Updated to support the "default" named permissions set
+ (now) included with Mono. Support for loading XML policy files is
+ still available (but somewhat buggy at the moment).
+
2005-05-17 Sebastien Pouliot <sebastien@ximian.com>
* Makefile: Fixed (and more useful).
CSCOMPILE = mcs -debug
PROFILE = net_1_1
-all: makepol.exe internet.xml intranet.xml \
- sandbox.exe whoami.exe
+all: sandbox.exe whoami.exe quota.exe
-aot: makepol.exe.so sandbox.exe.so whoami.exe.so
+aot: sandbox.exe.so whoami.exe.so quota.exe.so
TEST_FILES = whoami.exe sandbox.exe "sandbox.exe whoami.exe"
-TEST_POLICIES = fulltrust intranet internet execution nothing
+TEST_POLICIES = @Fulltrust @LocalIntranet @Internet @SkipVerification @Execution @Nothing @Everything
run: all
@for p in $(TEST_POLICIES); do \
for i in $(TEST_FILES); do \
- echo -e "TESTING: $(RUNTIME) sandbox.exe $$p.xml $$i"; \
- $(RUNTIME) sandbox.exe $$p.xml $$i; \
+ echo -e "TESTING: $(RUNTIME) sandbox.exe $$p $$i"; \
+ $(RUNTIME) sandbox.exe $$p $$i; \
done; \
done;
clean:
rm -f *.exe* *.dll* *.snk
-%.xml: makepol.exe
- $(RUNTIME) makepol.exe
-
%.exe: %.cs
$(CSCOMPILE) $^ /out:$@
* makepol.cs: Create some XML policy files to be used with the sandboxes.
+ DEPRECATED as Mono now creates the default sets itself.
* sandbox.cs: Create a policy-restricted appdomain to execute assemblies.
Samples
* whoami.cs: Sample code that can be executed under a sandbox.
-
-
-Generated files
-
-* Mono doesn't (at least currently) ship with XML policy files. So the
-makepol.exe tool creates policies similar (i.e. not all 100% identical) to the
-ones shipped with version 1.1 of the MS framework.
+* quota.cs: Sample code to test for a isolated storage quota permission.
More informations:
* http://blogs.msdn.com/shawnfa/archive/2004/10/25/247379.aspx
+* http://blogs.msdn.com/shawnfa/archive/2004/10/22/246549.aspx
Expected Results
--- /dev/null
+using System;
+using System.Security;
+using System.Security.Permissions;
+
+class Program {
+
+ static void Main (string[] args)
+ {
+ long quota = 0;
+ if (args.Length > 0)
+ quota = Convert.ToInt64 (args [0]);
+
+ IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
+ isfp.UserQuota = quota;
+ try {
+ isfp.Demand ();
+ Console.WriteLine ("Quota accepted for {0}.", quota);
+ }
+ catch (SecurityException se) {
+ Console.WriteLine ("Quota refused for {0}\n{1}", quota, se);
+ }
+ catch (Exception e) {
+ Console.WriteLine ("Error checking quota for {0}\n{1}", quota, e);
+ }
+ }
+}
return psa.CreatePermissionSet ();
}
+ // source: http://blogs.msdn.com/shawnfa/archive/2004/10/22/246549.aspx
+ static PermissionSet GetNamedPermissionSet (string name)
+ {
+ bool foundName = false;
+ PermissionSet pset = new PermissionSet (PermissionState.Unrestricted);
+
+ IEnumerator e = SecurityManager.PolicyHierarchy ();
+ while (e.MoveNext ()) {
+ PolicyLevel pl = e.Current as PolicyLevel;
+
+ PermissionSet levelpset = pl.GetNamedPermissionSet (name);
+ if ((levelpset != null) && (pset != null)) {
+ foundName = true;
+ pset = pset.Intersect (levelpset);
+ }
+ }
+
+ if (pset == null || !foundName)
+ return new PermissionSet (PermissionState.None);
+
+ return new NamedPermissionSet (name, pset);
+ }
+
// source: http://blogs.msdn.com/shawnfa/archive/2004/10/25/247379.aspx
static AppDomain CreateRestrictedDomain (string filename)
{
PolicyStatement emptyPolicy = new PolicyStatement (emptySet);
UnionCodeGroup root = new UnionCodeGroup (new AllMembershipCondition (), emptyPolicy);
- PermissionSet userSet = LoadFromFile (filename);
+ PermissionSet userSet = null;
+ if (filename [0] == '@')
+ userSet = GetNamedPermissionSet (filename.Substring (1));
+ else
+ userSet = LoadFromFile (filename);
+
PolicyStatement userPolicy = new PolicyStatement (userSet);
root.AddChild (new UnionCodeGroup (new AllMembershipCondition (), userPolicy));
-
+
PolicyLevel pl = PolicyLevel.CreateAppDomainLevel ();
pl.RootCodeGroup = root;
switch (args.Length) {
case 0:
Console.WriteLine ("Create a restricted sandbox to execute an assembly.");
- Console.WriteLine ("Usage: mono sandbox.exe [permissionset.xml] assembly.exe [parameters ...]");
+ Console.WriteLine ("Usage: mono sandbox.exe [@namedpermissionset | permissionset.xml] assembly.exe [parameters ...]");
return 0;
case 1:
Console.WriteLine ("Using default (current) appdomain to load '{0}'...", args [0]);
+2005-06-13 Geoff Norton <gnorton@customerdna.com>
+
+ * mono-compiler.h: Be slightly more conservative on ppc
+ as this was previously causing crashes building.
+
+2005-06-09 Duncan Mak <duncan@novell.com>
+
+ * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
+ all public headers. Fixes #74919.
+
2005-05-18 Zoltan Varga <vargaz@freemail.hu>
* mono-codeman.c: Align code on a 16 byte boundary on ia64.
typedef int (*MonoCodeManagerFunc) (void *data, int csize, int size, void *user_data);
void mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data);
-
#endif /* __MONO_CODEMAN_H__ */
#if defined(PIC) && defined(__x86_64__)
#define MONO_TLS_FAST
+#elif defined (__powerpc__)
+#define MONO_TLS_FAST
#else
#define MONO_TLS_FAST __attribute__((tls_model("local-exec")))
#endif
#include <glib.h>
+G_BEGIN_DECLS
+
typedef struct {
guint32 buf[4];
guint32 bits[2];
void mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len);
+G_END_DECLS
#endif /* __MONO_DIGEST_H__ */
#include <glib.h>
+G_BEGIN_DECLS
+
typedef enum {
MONO_TRACE_ASSEMBLY = (1<<0),
MONO_TRACE_TYPE = (1<<1),
va_end (args);
}
+G_END_DECLS
+
#endif /* !__GNUC__ */
#endif /* __MONO_LOGGER_H__ */
noinst_SCRIPTS = mono-wrapper monodis-wrapper
+etctmp = etc
symlinks = etc/mono/1.0/machine.config etc/mono/2.0/machine.config
etc/mono/1.0/machine.config: $(top_srcdir)/data/net_1_1/machine.config
clean-local:
d=`pwd`; cd $(mcs_topdir) && $(MAKE) PROFILES='$(build_profiles)' clean-profiles
- -rm -fr $(symlinks) $(tmpinst) .wapi
+ -rm -fr $(etctmp) $(tmpinst) .wapi
if INSTALL_2_0
TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm $(tmpinst)/bin/gmcs
-EXTRA_DIST = script.in script2.in mono-service.in mono-nunit.pc.in
-DISTCLEANFILES = mono-nunit.pc
+EXTRA_DIST = \
+ script.in \
+ script2.in \
+ mono-service.in \
+ mono-nunit.pc.in \
+ mono-find-provides.in \
+ mono-find-requires.in
+
+DISTCLEANFILES = $(pkgconfig_DATA) $(rpmscripts_SCRIPTS)
bin2dir = $(bindir)
servicedir = $(bindir)
+rpmscriptsdir = $(bindir)
bin_SCRIPTS = \
al \
mcs \
mjs \
mkbundle \
- mono-find-provides \
- mono-find-requires \
monop \
+ mono-shlib-cop \
permview \
prj2make \
resgen \
service_SCRIPTS = mono-service
-CLEANFILES = $(bin_SCRIPTS) $(bin2_SCRIPTS) mono-service
+rpmscripts_SCRIPTS = mono-find-provides mono-find-requires
+
+CLEANFILES = $(bin_SCRIPTS) $(bin2_SCRIPTS) $(service_SCRIPTS)
if USE_JIT
MONO_INTERP = mono
--- /dev/null
+#!/bin/sh
+#
+# mono-find-provides
+#
+# Authors:
+# Ben Maurer (bmaurer@ximian.com)
+#
+# (C) 2005 Novell (http://www.novell.com)
+#
+
+IFS=$'\n'
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+
+# Set the prefix, unless it is overriden (used when building mono rpms)
+: ${prefix=@prefix@}
+
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+bindir=@bindir@
+
+[ -x $bindir/monodis ] || exit 0;
+[ -f $libdir/libmono.so ] || exit 0;
+
+
+# set LD_LIBRARY_PATH to ensure that libmono.so is found
+export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+
+for i in "${monolist[@]}"; do
+ ($bindir/monodis --assembly $i | awk '
+ BEGIN { LIBNAME=""; VERSION=""; }
+ /^Version:/ { VERSION=$2 }
+ /^Name:/ { LIBNAME=$2 }
+ END {
+ if (VERSION && LIBNAME)
+ print "mono(" LIBNAME ") = " VERSION
+ }
+ ') 2>/dev/null
+done
--- /dev/null
+#!/bin/sh
+#
+# mono-find-requires
+#
+# Authors:
+# Ben Maurer (bmaurer@ximian.com)
+#
+# (C) 2005 Novell (http://www.novell.com)
+#
+
+IFS=$'\n'
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+
+# Set the prefix, unless it is overriden (used when building mono rpms)
+: ${prefix=@prefix@}
+
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+bindir=@bindir@
+
+[ -x $bindir/monodis ] || exit 0;
+[ -f $libdir/libmono.so ] || exit 0;
+
+
+# set LD_LIBRARY_PATH to ensure that libmono.so is found
+export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+
+REQUIRES=$(
+ for i in "${monolist[@]}"; do
+ ($bindir/monodis --assemblyref $i | awk '
+ BEGIN { START=0; LIBNAME=""; VERSION=""; }
+ (START==0) && /^[0-9]+: Version=/ {
+ START=1;
+ sub(/Version=/, "", $2);
+ VERSION=$2
+ }
+
+ (START==1) && /^\tName=/ {
+ sub(/Name=/, "", $1);
+ LIBNAME=$1
+
+ print "mono(" LIBNAME ") = " VERSION
+ START=0
+ }
+ ') 2> /dev/null
+ done
+)
+
+PROVIDES=$(
+ for i in "${monolist[@]}"; do
+ ($bindir/monodis --assembly $i | awk '
+ BEGIN { LIBNAME=""; VERSION=""; }
+ /^Version:/ { VERSION=$2 }
+ /^Name:/ { LIBNAME=$2 }
+ END {
+ if (VERSION && LIBNAME)
+ print "mono(" LIBNAME ") = " VERSION
+ }
+ ') 2>/dev/null
+ done
+)
+#
+# This is a little magic trick to get all REQUIRES that are not
+# in PROVIDES. While RPM functions correctly when such deps exist,
+# they make the metadata a bit bloated.
+#
+
+# Filter out dups from both lists
+REQUIRES=$(echo "$REQUIRES" | sort | uniq)
+PROVIDES=$(echo "$PROVIDES" | sort | uniq)
+
+#
+# Get a list of elements that exist in exactly one of PROVIDES or REQUIRES
+#
+UNIQ=$(echo "$PROVIDES
+$REQUIRES" | sort | uniq -u)
+
+#
+# Of those, only chose the ones that are in REQUIRES
+#
+echo "$UNIQ
+$REQUIRES" | sort | uniq -d
+++ /dev/null
-//
-// ByMaintainer.cs
-//
-// Author:
-// Sean MacIsaac (sean@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Xml.XPath;
-
-namespace Mono.StatusReporter {
- public class ByMaintainer {
- static int Main (string[] args) {
- XslTransform xslt = new XslTransform ();
- xslt.Load ("ByMaintainer.xsl");
- //StreamWriter sw = new StreamWriter ("bm/index");
-
- XPathDocument doc = new XPathDocument ("class.xml");
-
- XmlDocument maintainers = new XmlDocument();
-
- maintainers.Load ("maintainers.xml");
-
- XmlNodeList people = maintainers.GetElementsByTagName("person");
- foreach (XmlNode node in people) {
- string email = node.Attributes.GetNamedItem("email").Value;
- string name = node.Attributes.GetNamedItem("name").Value;
-
- //sw.WriteLine ("<li><a href=\"" + email + ".html\">" + email + "</a>");
-
- XmlWriter writer = new XmlTextWriter ("src/" + email, null);
-
- XsltArgumentList xslArg = new XsltArgumentList ();
- xslArg.AddParam ("email", "", email);
- xslArg.AddParam ("name", "", name);
-
- xslt.Transform (doc, xslArg, writer);
-
- writer.Close ();
- }
-
- //sw.Close ();
-
- return 0;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-
-<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
-
-<xsl:param name="email"/>
-<xsl:param name="name"/>
-
-<xsl:template match="/">
- <h2>Maintained by <xsl:value-of select="$name"/> (<xsl:value-of select="$email"/>)</h2>
- <table border="1">
- <tr>
- <td>Class Name</td>
- <td>Last Activity</td>
- <td>Implementation</td>
- <td>Test Suite</td>
- <td>Completion</td>
- </tr>
-
- <xsl:for-each select='classes/class'>
-
- <xsl:sort select='@name' />
- <xsl:if test="contains(maintainers/*, $email)">
- <tr>
- <td><xsl:value-of select="@name"/></td>
- <td><xsl:value-of select="last-activity"/></td>
- <td><xsl:value-of select="implementation"/></td>
- <td><xsl:value-of select="test-suite"/></td>
- <td><xsl:value-of select="completion"/></td>
- </tr>
- </xsl:if>
-
- </xsl:for-each>
-
- </table>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-//
-// ByNamespace.cs
-//
-// Author:
-// Sean MacIsaac (sean@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Xml.XPath;
-
-namespace Mono.StatusReporter {
- public class ByMaintainer {
- static int Main (string[] args) {
- XslTransform xslt = new XslTransform ();
- xslt.Load ("ByNamespace.xsl");
- //StreamWriter sw = new StreamWriter ("bn/index");
-
- XPathDocument doc = new XPathDocument ("class.xml");
-
- XmlDocument classxml = new XmlDocument ();
- classxml.Load ("class.xml");
- ArrayList nsList = new ArrayList ();
-
- XmlNodeList classes = classxml.GetElementsByTagName ("class");
- foreach (XmlNode node in classes) {
- string name = node.Attributes.GetNamedItem ("name").Value;
- string ns = name.Substring(0, name.LastIndexOf ("."));
- if (!nsList.Contains (ns)) nsList.Add (ns);
- }
-
- foreach (string str in nsList) {
- //sw.WriteLine ("<li><a href=\"" + str + ".html\">" + str + "</a>");
-
- XmlWriter writer = new XmlTextWriter ("src/" + str, null);
-
- XsltArgumentList xslArg = new XsltArgumentList ();
- xslArg.AddParam ("ns", "", str);
-
- xslt.Transform (doc, xslArg, writer);
-
- writer.Close ();
- }
-
- //sw.Close ();
-
- return 0;
- }
- }
-}
+++ /dev/null
-<?xml version="1.0"?>
-
-<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
-
-<xsl:output method="html" indent="yes"/>
-
-<xsl:param name="ns"/>
-
-<xsl:template match="/">
- <h2>Classes in <xsl:value-of select="$ns"/></h2>
- <table border="1">
- <tr>
- <td>Class Name</td>
- <td>Head Maintainer</td>
- <td>Last Activity</td>
- <td>Implementation</td>
- <td>Test Suite</td>
- <td>Completion</td>
- </tr>
-
- <xsl:for-each select='classes/class'>
- <xsl:sort select='@name' />
- <xsl:if test="starts-with(@name, $ns) and not(contains(substring-after(@name, concat($ns, '.')), '.'))">
- <tr>
- <td><xsl:value-of select="@name"/></td>
- <td><a href='mailto:{maintainers/maintainer[1]}'><xsl:value-of select="maintainers/maintainer[1]"/></a></td>
- <td><xsl:value-of select="last-activity"/></td>
- <td><xsl:value-of select="implementation"/></td>
- <td><xsl:value-of select="test-suite"/></td>
- <td><xsl:value-of select="completion"/></td>
- </tr>
- </xsl:if>
- </xsl:for-each>
-
- </table>
-
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-2002-07-13 Jonathan Pryor <jonpryor@vt.edu>
- * class.xml: Added entries for the following classes from System.Diagnostics:
- - CounterCreationData.cs: Implemented
- - CounterCreationDataCollection.cs: Implemented
- - CounterSample.cs: Stubbed Out
- - CounterSampleCalculator.cs: Stubbed Out
- - InstanceData.cs: Implemented
- - InstanceDataCollection.cs: Implemented
- - InstanceDataCollectionCollection.cs: Implemented
- - MonitoringDescriptionAttribute.cs: Implemented
- - PerformanceCounter.cs: Stubbed Out
- - PerformanceCounterCategory.cs: Stubbed Out
- - PerformanceCounterInstaller.cs: Stubbed Out
- - PerformanceCounterManager.cs: Stubbed Out
- - PerformanceCounterPermission.cs: Stubbed Out
- - PerformanceCounterPermissionAccess.cs: Implemented
- - PerformanceCounterPermissionAttribute.cs: Stubbed Out
- - PerformanceCounterPermissionEntry.cs: Stubbed Out
- - PerformanceCounterPermissionEntryCollection.cs: Implemented
- - PerformanceCounterType.cs: Implemented
-
-2002-06-09 Jonathan Pryor <jonpryor@vt.edu>
- * class.xml: Added entries for the following classes from System.Diagnostics:
- - EntryWrittenEventArgs
- - EntryWrittenEventHandler
- - EventLog
- - EventLogEntryCollection
- - EventLogEntry
- - EventLogEntryType
- - EventLogInstaller
- - EventLogPermissionAccess
- - EventLogPermissionAttribute
- - EventLogPermission
- - EventLogPermissionEntryCollection
- - EventLogPermissionEntry
- - EventLogTraceListener
-
-2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * maintainers.xml: added myself.
- * class.xml: added System.Net.Sockets.UdpClient and updated
- System.Net.IPAddress and IPEndPoint.
-
-2002-03-17 Nick Drochak <ndrochak@gol.com>
-
- * class.xml: Added class I stubbed out:
- ApplicationDirectoryMembershipCondition
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * class.xml: Added classes I implemented.
-
-2002-01-07 John Barnette <jbarn@httcb.net>
-
- * type-maintainers.xml: new format for information.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore cormissing file which is generated by
- /mcs/tools/corcompare.exe
-
-2001-11-19 Daniel Weber <daniel-weber@austin.rr.co>
- * class.xml : Added System.Xml classes
- * maintainers.xml: Added myself
-2001-10-11
-
- * ByMaintainer.xsl: support for sorting classnames
- * ByNamespace.xsl: support for sorting classnames, mailto href on
- maintainer
-
-Tue Sep 25 19:03:52 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * class.xml: updates.
-
-2001-09-14 Dick Porter <dick@ximian.com>
-
- * class.xml: Added System.Threading classes
-
- * maintainers.xml: Added myself
-
-2001-07-17 Sean MacIsaac <macisaac@ximian.com>
-
- * ByNamespace.xsl: removed bug for improper handling of namespace.
- eg System.Collections.Blah was showing up in System list.
-
-2001-07-16 Sean MacIsaac <macisaac@ximian.com>
-
- * ByNamespace.xsl: Needed by ByNamespace.cs.
-
- * ByNamespace.cs: Generates html by namespace..
-
- * ByMaintainer.xsl: Needed by ByMaintainer.cs.
-
- * ByMaintainer.cs: Generates html by maintainer.
-
- * class.xml: Class maintainers go here.
-
- * maintainers.xml: Only maintaining email/name pairs here.
-
- * compare-assembly.cs: Started refactoring to give what Migee
- wants.
+++ /dev/null
-<classes>
- <class name="System.ApplicationException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ArgumentException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ArgumentNullException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ArgumentOutOfRangeException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ArithmeticException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Array">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ArrayTypeMismatchException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Attribute">
- <last-activity>Aug-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Boolean">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dsh2120@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Byte">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>yes</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>dholden@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.CLSCompliantAttribute">
- <last-activity>Aug-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.ArrayList">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.BitArray">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dmenest@yahoo.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.CaseInsensitiveComparer">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.CaseInsensitiveHashCodeProvider">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.CollectionBase">
- <last-activity>Aug-03-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Comparer">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.DictionaryBase">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.DictionaryEntry">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Hashtable">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.ICollection">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IComparer">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IDictionary">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IDictionaryEnumerator">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IEnumerable">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IEnumerator">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IHashCodeProvider">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.IList">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>vladimir@pobox.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Queue">
- <last-activity>Jul-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>ric@users.sourceforge.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.ReadOnlyCollectionBase">
- <last-activity>Aug-03-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.SortedList">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.CollectionsUtil">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.HybridDictionary">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- <maintainer>josh@narf.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.KeysCollection">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>gleb@eurosoft.od.ua</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.ListDictionary">
- <last-activity>Aug-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- <maintainer>josh@narf.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.NameObjectCollectionBase">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>gleb@eurosoft.od.ua</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.NameValueCollection">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>gleb@eurosoft.od.ua</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.StringCollection">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.StringDictionary">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Specialized.StringEnumerator">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jbarn@httcb.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Collections.Stack">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>rooneg@electricjellyfish.net</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.BrowsableAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.CategoryAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.Component">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.ComponentCollection">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.Container">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.DescriptionAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.DesignerSerializationVisibility">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.DesignerSerializationVisibilityAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.DesignOnlyAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.IComponent">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.IContainer">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.ISite">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.LocalizableAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.MemberDescriptor">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>70</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ComponentModel.PropertyDescriptor">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>30</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Configuration.ConfigurationException">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>cpodurgiel@msn.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Configuration.ConfigurationSettings">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>cpodurgiel@msn.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Configuration.IConfigurationSectionHandler">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>cpodurgiel@msn.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Configuration.IgnoreSectionHandler">
- <last-activity>Aug-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>cpodurgiel@msn.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Configuration.NameValueSectionHandler">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>cpodurgiel@msn.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Console">
- <last-activity>Jul-0-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.ContextBoundObject">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ContextBoundObject">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ContextStaticAttribute">
- <last-activity>Aug-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Convert">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dsh2120@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.DataRow">
- <last-activity>Jan-8-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>swildermuth@adoguy.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.DataTable">
- <last-activity>Jan-8-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>swildermuth@adoguy.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DataAdapter">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DataColumnMapping">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DataColumnMappingCollection">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DataTableMapping">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DataTableMappingCollection">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DbDataAdapter">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DbDataPermission">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DbDataPermissionAttribute">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DbDataRecord">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.DbEnumerator">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.RowUpdatedEventArgs">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.Common.RowUpdatingEventArgs">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlCommand">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- <maintainer>danmorg@sc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlConnection">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- <maintainer>danmorg@sc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlDataAdapter">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlDataReader">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlError">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlErrorCollection">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlException">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlParameter">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlParameterCollection">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Data.SqlClient.SqlTransaction">
- <last-activity>Apr-12-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>rodrigo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.DateTime">
- <last-activity>Jul-23-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Decimal">
- <last-activity>Oct-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>martin.weindel@t-online.de</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.BooleanSwitch">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>angryjohn69@nc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ConditionalAttribute">
- <last-activity>Aug-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.CounterCreationData">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.CounterCreationDataCollection">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.CounterSample">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.CounterSampleCalculator">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.Debug">
- <last-activity>March-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.DebuggableAttribute">
- <last-activity>Aug-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.DefaultTraceListener">
- <last-activity>May-29-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.DiagnosticsConfigurationHandler">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>angryjohn69@nc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EntryWrittenEventArgs">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EntryWrittenEventHandler">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLog">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogEntry">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogEntryCollection">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogEntryType">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogInstaller">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogPermission">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogPermissionAccess">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogPermissionAttribute">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogPermissionEntry">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogPermissionEntryCollection">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.EventLogTraceListener">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>01</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.FileVersionInfo">
- <last-activity>Apr-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ICollectData">
- <last-activity>Jun-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.InstanceData">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.InstanceDataCollection">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.InstanceDataCollectionCollection">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.MonitoringDescriptionAttribute">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounter">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>25</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterCategory">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterInstaller">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterManager">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterPermission">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterPermissionAccess">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterPermissionAttribute">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterPermissionEntry">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterPermissionEntryCollection">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.PerformanceCounterType">
- <last-activity>Jul-13-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.Process">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessModule">
- <last-activity>Mar-31-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessModuleCollection">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessPriorityClass">
- <last-activity>Mar-31-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessStartInfo">
- <last-activity>May-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessThread">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessThreadCollection">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ProcessWindowStyle">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.StackFrame">
- <last-activity>Aug-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>klyubin@aqris.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.StackTrace">
- <last-activity>Aug-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>klyubin@aqris.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.Switch">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>angryjohn69@nc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.TextWriterTraceListener">
- <last-activity>May-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>No</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ThreadPriorityLevel">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>No</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ThreadState">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>No</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.ThreadWaitReason">
- <last-activity>Apr-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>No</test-suite>
- <completion>??</completion>
- <maintainers>
- <maintainer>??</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.Trace">
- <last-activity>April-06-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.TraceLevel">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>angryjohn69@nc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.TraceListener">
- <last-activity>May-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.TraceListenerCollection">
- <last-activity>Apr-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>jonpryor@vt.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Diagnostics.TraceSwitch">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>angryjohn69@nc.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.DivideByZeroException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Color">
- <last-activity>Aug-10-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.CombineMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.CompositingMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.CompositingQuality">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.CoordinateSpace">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.DashCap">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.DashStyle">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.FillMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.FlushIntention">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.HatchStyle">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.InterpolationMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.LinearGradientMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.LineCap">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.LineJoin">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.Matrix">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.MatrixOrder">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.PathPointType">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.PenAlignment">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.PenType">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.PixelOffsetMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.QualityMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.SmoothingMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.WarpMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Drawing2D.WrapMode">
- <last-activity>Aug-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>sm@cg.tuwien.ac.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Point">
- <last-activity>Aug-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.PointF">
- <last-activity>Aug-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Rectangle">
- <last-activity>Aug-10-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.RectangleF">
- <last-activity>Aug-10-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.Size">
- <last-activity>Aug-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Drawing.SizeF">
- <last-activity>Aug-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>mkestner@speakeasy.net</maintainer>
- </maintainers>
- </class>
- <class name="System.DuplicateWaitObjectException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Environment">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>40</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.EventArgs">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.EventHandler">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Exception">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ExecutionEngineException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.FlagsAttribute">
- <last-activity>Aug-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.FormatException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.Calendar">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.Calendar.WeekRule">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.Calendar.WeekRule">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.CultureInfo">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.GregorianCalendar">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.GregorianCalendarTypes">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.HebrewCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.HijriCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.JapaneseCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.JulianCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.JulianCalendar">
- <last-activity>Sep-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>wictor@iBizkit.se</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.KoreanCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.NumberFormatInfo">
- <last-activity>Jul-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dholden@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.TaiwanCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.ThaiBuddhistCalendar">
- <last-activity>Jul-24-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcel@narings.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.Globalization.UnicodeCateogy">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IAsyncResult">
- <last-activity>Jul-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.ICloneable">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IComparible">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IConvertible">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ICustomFormatter">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IDisposable">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IFormatProvider">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IFormattable">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IndexOutOfRangeException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IndividualCastException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Int16">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Int32">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Int64">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IntPtr">
- <last-activity>Jul-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.InvalidOperationException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.InvalidProgramException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.BinaryReader">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>czw@home.se</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.BinaryWriter">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>czw@home.se</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.Directory">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.DirectoryInfo">
- <last-activity>Sep-10-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.File">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.FileInfo">
- <last-activity>Sep-10-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.FileLoadException">
- <last-activity>Sept-13-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.FileNotFoundException">
- <last-activity>Sept-13-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.FileStream">
- <last-activity>Dec-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.FileSystemInfo">
- <last-activity>Sep-10-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>85</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.IOException">
- <last-activity>Aug-26-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.MemoryStream">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.Path">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.Stream">
- <last-activity>Dec-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.StreamReader">
- <last-activity>Dec-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.StreamWriter">
- <last-activity>Dec-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.StringReader">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.StringWriter">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>yes</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.TextReader">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.IO.TextWriter">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.IServiceProvider">
- <last-activity>Aug-2-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.LocalDataStoreSlot">
- <last-activity>Sep-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.MarshalByRefObject">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Math">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.MemberAccessException">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.MissingMemberException">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.MissingMethodException">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.MulticastNotSupportedException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.AuthenticationManager">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.Authorization">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.Dns">
- <last-activity>Feb-11-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>mpultz@get2net.dk</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.EndPoint">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.IAuthenticationModule">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.ICredentialLookup">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.IPAdress">
- <last-activity>Apr-15-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.IPEndPoint">
- <last-activity>Apr-15-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.IPHostEntry">
- <last-activity>Feb-11-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>mpultz@get2net.dk</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.SocketAddress">
- <last-activity>Apr-15-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.Sockets.TcpClient">
- <last-activity>Nov-23-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>pp@myelin.co.nz</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.Sockets.TcpListener">
- <last-activity>Nov-23-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>pp@myelin.co.nz</maintainer>
- </maintainers>
- </class>
- <class name="System.Net.Sockets.UdpClient">
- <last-activity>Apr-15-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>gonzalo@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.NotFiniteNumberException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.NotSupportedException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.NullReferenceException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Object">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.OperatingSystem">
- <last-activity>Aug-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>75</completion>
- <maintainers>
- <maintainer>develop@wtfo-guru.com</maintainer>
- </maintainers>
- </class>
- <class name="System.OutOfMemoryException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.OverflowExceptionException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Random">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>85</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.RankException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Assembly">
- <last-activity>Sept-13-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.ConstructorInfo">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.ConstructorBuilder">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.ILGenerator">
- <last-activity>Sept-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.Label">
- <last-activity>Sept-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.ModuleBuilder">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.ModuleBuilder">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.PEFileKinds">
- <last-activity>Sept-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Emit.TypeBuilder">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.MemberFilter">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.MethodBase">
- <last-activity>Sept-13-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.MethodInfo">
- <last-activity>Sept-13-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Reflection.Module">
- <last-activity>Sept-24-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>lupus@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.IResourceReader">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.IResourceWriter">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.MissingManifestResourceException">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.NeutralResourceLanguageAttribute">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResourceManager">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResourceReader">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResourceSet">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResourceWriter">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResXFileRef">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.ResXResourceReader">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Resources.SatelliteContractVersionAttribute">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duncan@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Activation.ActivatorLevel">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Activation.IActivator">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Activation.IConstructionCallMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Activation.IConstructionReturnMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.Context">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.ContextAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.IContextAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.IContextProperty">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.IDynamicMessageSink">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.IDynamicProperty">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Contexts.SynchronizationAttribute">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Messaging.IMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Messaging.IMethodMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Messaging.IMethodMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.Messaging.IMethodReturnMessage">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Remoting.ObjRef">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.Formatters.BinaryFormatter">
- <last-activity>Jan-16-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>kbottner@istation.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.Formatters.SoapFormamter">
- <last-activity>Jan-16-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>kbottner@istation.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.IDeserializationCallback">
- <last-activity>Dec-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.IFormatterConverter">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.IObjectReference">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.ISerializable">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.SerializationInfo">
- <last-activity>Oct-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.StreamingContext">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Runtime.Serialization.StreamingContextStates">
- <last-activity>Aug-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.SByte">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dholden@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.CodeAccessPermission">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.AsymmetricAlgorithm">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.AsymmetricKeyExchangeDeformatter">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.AsymmetricKeyExchangeFormatter">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.AsymmetricSignatureDeformatter">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.AsymmetricSignatureFormatter">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CipherMode">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CryptoAPITransform">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CryptograhicUnexpectedOperationException">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CryptographicException">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CryptoStream">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>20</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CryptoStreamMode">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CspParameters">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.CspProviderFlags">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DeriveBytes">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DES">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no/soft</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DESCrytpoServiceProvider">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no/soft</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DSA">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DSAParameters">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DSASignatureDeformatter">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>30</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.DSASignatureFormatter">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>30</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.FromBase64Transform">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.HashAlgorithm">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.KeySizes">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.MD5">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.MD5CryptoServiceProvider">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.PaddingMode">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.PasswordDeriveBytes">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.Rijndael">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>crichton@gimp.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.RijndaelManaged">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>crichton@gimp.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.RNGCryptoServiceProvider">
- <last-activity>Feb-21-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>70</completion>
- <maintainers>
- <maintainer>crichton@gimp.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SHA1">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SHA1CryptoServiceProvider">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SHA256">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SHA384">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SHA512">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Matthew.S.Ford@rose-hulman.edu</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SignatureDescription">
- <last-activity>Oct-6-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.SymmetricAlgorithm">
- <last-activity>Oct-11-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>95</completion>
- <maintainers>
- <maintainer>tome@sbox.tugraz.at</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.ToBase64Transform">
- <last-activity>Aug-1-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>serge@wildwestsoftware.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.TripleDES">
- <last-activity>Jan-16-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>john.giffin@xor.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Cryptography.TripleDESServiceProvider">
- <last-activity>Jan-16-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>john.giffin@xor.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.IPermission">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.ISecurityPolicyEncodable">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.IStackWalk">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Permissions.CodeAccessSecurityAttribute">
- <last-activity>Jan-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Permissions.FileIOPermission">
- <last-activity>Jan-14-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Permissions.IUnrestrictedPermission">
- <last-activity>Jan-02-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Permissions.SecurityAttribute">
- <last-activity>Jan-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Permissions.SecurityPermissionAttribute">
- <last-activity>Jan-08-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.PermissionSet">
- <last-activity>Dec-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Policy.ApplicationDirectoryMembershipCondition">
- <last-activity>Mar-17-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Policy.IIdentityPermissionFactory">
- <last-activity>Jan-03-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Policy.IMembershipCondition">
- <last-activity>Jan-03-2002</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.Policy.PolicyLevel">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.PolicyLevelType">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.SecurityElement">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.SecurityException">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.SecurityManager">
- <last-activity>Dec-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>1</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.SecurityZone">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.SuppressUnmanagedCodeSecurityAttribute">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.UnverifiableCodeAttribute">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Security.XmlSyntaxException">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>ndrochak@gol.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Single">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>dholden@draper.com</maintainer>
- </maintainers>
- </class>
- <class name="System.StackOverflowException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.String">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>fejj@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.StringBuilder">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>marcins@zipworld.com.au</maintainer>
- </maintainers>
- </class>
- <class name="System.SystemException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.ASCIIEncoding">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.Decoder">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.Encoder">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.Encoding">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.UnicodeEncoding">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.UTF7Encoding">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Text.UTF8Encoding">
- <last-activity>Jan-05-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>99</completion>
- <maintainers>
- <maintainer>dietmar@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ApartmentState">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.AutoResetEvent">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Interlocked">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.IOCompletionCallback">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.LockCookie">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ManualResetEvent">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Monitor">
- <last-activity>Oct-03-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Mutex">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.NativeOverlapped">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Overlapped">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ReaderWriterLock">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.RegisteredWaitHandle">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.SynchronizationLockException">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Thread">
- <last-activity>Sep-25-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadAbortException">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadExceptionEventArgs">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadExceptionEventHandler">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadInterruptedException">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadPool">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadPriority">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadStart">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadState">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.ThreadStateException">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Timeout">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.Timer">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.TimerCallback">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.WaitCallback">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.WaitHandle">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Threading.WaitOrTimerCallback">
- <last-activity>Sep-14-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>dick@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.TimeSpan">
- <last-activity>Jul-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>duco@lorentz.xs4all.nl</maintainer>
- </maintainers>
- </class>
- <class name="System.TypeCode">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.TypeInitializationException">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>joe@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.UInt16">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.UInt32">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.UInt64">
- <last-activity>Dec-21-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.UIntPtr">
- <last-activity>Aug-23-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>yes</completion>
- <maintainers>
- <maintainer>michaellambert@bellsouth.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Uri">
- <last-activity>Jul-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>40</completion>
- <maintainers>
- <maintainer>rooneg@electricjellyfish.net</maintainer>
- </maintainers>
- </class>
- <class name="System.UriBuilder">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>scott@stonecobra.com</maintainer>
- </maintainers>
- </class>
- <class name="System.UriFormatException">
- <last-activity>Jul-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>85</completion>
- <maintainers>
- <maintainer>scott@stonecobra.com</maintainer>
- </maintainers>
- </class>
- <class name="System.ValueType">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Version">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Void">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>miguel@ximian.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.BeginEventHandler">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Cache">
- <last-activity>Jul-20-2001</last-activity>
- <implementation>no</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>Patrik.Torstensson@labs2.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.EndEventHandler">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.AppDomainFactory">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.ApplicationHost">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.IAppDomainFactory">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.IISAPIRuntime">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.ISAPIRuntime">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.Hosting.SimpleWorkerRequest">
- <last-activity>Aug-30-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpCacheability">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpCacheRevalidation">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpCacheValidateHandler">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpCookie">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpCookieCollection">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpValidationStatus">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpWorkerRequest">
- <last-activity>Aug-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.HttpWorkerRequest.EndOfSendNotification">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.IHttpAsyncHandler">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.IHttpHandler">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.IHttpHandlerFactory">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.IHttpModule">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.ProcessShutdownReason">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.ProcessStatus">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.TraceMode">
- <last-activity>Aug-9-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.BuildMethod">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.BuildTemplateMethod">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.Control">
- <last-activity>Dec-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>0%</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlControlls.HtmlContainerControl">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlControlls.HtmlControl">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlControlls.HtmlGenericControl">
- <last-activity>Aug-22-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlTextWriterAttribute">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlTextWriterStyle">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.HtmlTextWriterTag">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IAttributeAccessor">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IDataBindingsAccessor">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.ImageClickEventHandler">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.INamingContainer">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IParserAccessor">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IPostBackDataHandler">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IPostBackEventHandler">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.ISiteManager">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.ITagNameToTypeMapper">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.ITemplate">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.IValidator">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.OutputCacheLocation">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.PersistanceMode">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.PropertyConverter">
- <last-activity>Dec-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.StateBag">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.StateItem">
- <last-activity>Aug-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100</completion>
- <maintainers>
- <maintainer>bob@thestuff.net</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.AdCreatedEventArgs">
- <last-activity>Dec-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.AdCreatedEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.AdRotator">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.BaseCompareValidator">
- <last-activity>Jan-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.BaseDataList">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.BaseValidator">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.BorderStyle">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.BoundColumn">
- <last-activity>Jan-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>60%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Button">
- <last-activity>Jan-17-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ButtonColumn">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ButtonColumnType">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Calendar">
- <last-activity>Feb-21-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>98%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CalendarDay">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CalendarSelectionMode">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CheckBox">
- <last-activity>Jan-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CheckBoxList">
- <last-activity>Jan-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CommandEventArgs">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CommandEventHandler">
- <last-activity>Dec-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CompareValidator">
- <last-activity>Jan-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.CustomValidator">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGrid">
- <last-activity>Feb-21-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridColumn">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridColumnCollection">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridCommandEventArgs">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridCommandEventHandler">
- <last-activity>Dec-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridItem">
- <last-activity>Feb-21-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridItemCollection">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridItemEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridItemEventHandler">
- <last-activity>Dec-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridPageChangedEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridPageChangedEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridPagerStyle">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridSortCommandEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataGridSortCommandEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataKeyCollection">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataList">
- <last-activity>Feb-01-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>70%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListCommandEventArgs">
- <last-activity>Dec-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListCommandEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListItem">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListItemCollection">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListItemEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DataListItemEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DayNameFormat">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DayRenderEventArgs">
- <last-activity>Dec-18-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DayRenderEventHandler">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.DropDownList">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.EditCommandColumn">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FirstDayOfWeek">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FontInfo">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FontNamesConverter">
- <last-activity>Jan-28-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FontSize">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FontUnit">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.FontUnitConverter">
- <last-activity>Jan-28-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>60%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.GridLines">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.HorizontalAlign">
- <last-activity>Dec-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.HyperLink">
- <last-activity>Dec-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.HyperLinkColumn">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.HyperLinkControlBuilder">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Image">
- <last-activity>Dec-27-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ImageAlign">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ImageButton">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.IRepeatInfoUser">
- <last-activity>Dec-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Label">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.LabelControlBuilder">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.LinkButton">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.LinkButtonControlBuilder">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListBox">
- <last-activity>Feb-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListControl">
- <last-activity>Dec-20-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListItem">
- <last-activity>Feb-02-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListItemCollection">
- <last-activity>Feb-02-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListItemControlBuilder">
- <last-activity>Jan-28-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListItemType">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ListSelectionMode">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Literal">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.LiteralControlBuilder">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.MonthChangedEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.MonthChangedEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.NextPrevFormat">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.PagedDataSource">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.PagerMode">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.PagerPosition">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Panel">
- <last-activity>Jan-25-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.PlaceHolder">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.PlaceHolderControlBuilder">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RadioButton">
- <last-activity>Jan-26-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RadioButtonList">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>95%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RangeValidator">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RegularExpressionValidator">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeatDirection">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Repeater">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterCommandEventArgs">
- <last-activity>Dec-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterCommandEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterItem">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>40%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterItemCollection">
- <last-activity>Mar-02-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterItemEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeaterItemEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeatInfo">
- <last-activity>Jan-31-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RepeatLayout">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.RequiredFieldValidator">
- <last-activity>Feb-07-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.SelectedDatesCollection">
- <last-activity>Mar-03-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ServerValidateEventArgs">
- <last-activity>Mar-04-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ServerValidateEventHandler">
- <last-activity>Dec-28-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Style">
- <last-activity>Jan-25-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Table">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableCell">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableCellCollection">
- <last-activity>Jan-18-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableCellControlBuilder">
- <last-activity>Jan-09-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableHeaderCell">
- <last-activity>Jan-18-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableItemStyle">
- <last-activity>Jan-25-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableRow">
- <last-activity>Jan-18-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableRowCollection">
- <last-activity>Jan-18-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TableStyle">
- <last-activity>Jan-31-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TargetConverter">
- <last-activity>Feb-01-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TemplateColumn">
- <last-activity>Feb-01-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TextAlign">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TextBox">
- <last-activity>Jan-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>80%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TextBoxControlBuilder">
- <last-activity>Jan-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TextBoxMode">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.TitleFormat">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Unit">
- <last-activity>Dec-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.UnitConverter">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.UnitType">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidatedControlConverter">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidationCompareOperator">
- <last-activity>Dec-17-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidationDataType">
- <last-activity>Dec-16-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidationSummary">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidationSummaryDisplayMode">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.ValidatorDisplay">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.VerticalAlign">
- <last-activity>Dec-02-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>100%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.WebColorConverter">
- <last-activity>Jan-30-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>??%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.WebControl">
- <last-activity>Feb-01-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>40%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Web.UI.WebControls.Xml">
- <last-activity>Jan-27-2002</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>75%</completion>
- <maintainers>
- <maintainer>gvaish@iitk.ac.in</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlAttribute">
- <last-activity>Jul-29-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlAttributeCollection">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlComment">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlDocument">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlDocumentFragment">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlElement">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>10</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlLinkedNode">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNamedNodeMap">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNamespaceManager">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNameTable">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNode">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>5</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNodeChangedEventArgs">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>90</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNodeList">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlNodeType">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlParserContext">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlReader">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlResolver">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlSpace">
- <last-activity>Jul-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlText">
- <last-activity>Nov-19-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>no</test-suite>
- <completion>50</completion>
- <maintainers>
- <maintainer>daniel-weber@austin.rr.com</maintainer>
- </maintainers>
- </class>
- <class name="System.Xml.XmlTextReader">
- <last-activity>Jul-15-2001</last-activity>
- <implementation>yes</implementation>
- <test-suite>yes</test-suite>
- <completion>?</completion>
- <maintainers>
- <maintainer>jason@injektilo.org</maintainer>
- </maintainers>
- </class>
-</classes>
+++ /dev/null
-0,Class Libraries,index.html,index.src
-0,Namespace,namespace.html,namespace.src
-1,System,System.html,bn/System
-1,System.Collections,System.Collections.html,bn/System.Collections
-1,System.Collections.Specialized,System.Collections.Specialized.html,bn/System.Collections.Specialized
-1,System.ComponentModel,System.ComponentModel.html,bn/System.ComponentModel
-1,System.Configuration,System.Configuration.html,bn/System.Configuration
-1,System.Configuration.Assemblies,System.Configuration.Assemblies.html,bn/System.Configuration.Assemblies
-1,System.Data,System.Data.html,bn/System.Data
-1,System.Diagnostics,System.Diagnostics.html,bn/System.Diagnostics
-1,System.Drawing,System.Drawing.html,bn/System.Drawing
-1,System.Drawing.Drawing2D,System.Drawing.Drawing2D.html,bn/System.Drawing.Drawing2D
-1,System.Globalization,System.Globalization.html,bn/System.Globalization
-1,System.Globalization.Calendar,System.Globalization.Calendar.html,bn/System.Globalization.Calendar
-1,System.IO,System.IO.html,bn/System.IO
-1,System.Net,System.Net.html,bn/System.Net
-1,System.Net.Sockets,System.Net.Sockets.html,bn/System.Net.Sockets
-1,System.Reflection,System.Reflection.html,bn/System.Reflection
-1,System.Reflection.Emit,System.Reflection.Emit.html,bn/System.Reflection.Emit
-1,System.Resources,System.Resources.html,bn/System.Resources
-1,System.Runtime.Remoting,System.Runtime.Remoting.html,bn/System.Runtime.Remoting
-1,System.Runtime.Remoting.Activation,System.Runtime.Remoting.Activation.html,bn/System.Runtime.Remoting.Activation
-1,System.Runtime.Remoting.Contexts,System.Runtime.Remoting.Contexts.html,bn/System.Runtime.Remoting.Contexts
-1,System.Runtime.Remoting.Messaging,System.Runtime.Remoting.Messaging.html,bn/System.Runtime.Remoting.Messaging
-1,System.Runtime.Serialization,System.Runtime.Serialization.html,bn/System.Runtime.Serialization
-1,System.Runtime.Serialization.Formatters,System.Runtime.Serialization.Formatters.html,bn/System.Runtime.Serialization.Formatters
-1,System.Security,System.Security.html,bn/System.Security
-1,System.Security.Cryptography,System.Security.Cryptography.html,bn/System.Security.Cryptography
-1,System.Security.Permissions,System.Security.Permissions.html,bn/System.Security.Permissions
-1,System.Security.Policy,System.Security.Policy.html,bn/System.Security.Policy
-1,System.Text,System.Text.html,bn/System.Text
-1,System.Threading,System.Threading.html,bn/System.Threading
-1,System.Web,System.Web.html,bn/System.Web
-1,System.Web.Hosting,System.Web.Hosting.html,bn/System.Web.Hosting
-1,System.Web.HttpWorkerRequest,System.Web.HttpWorkerRequest.html,bn/System.Web.HttpWorkerRequest
-1,System.Web.UI,System.Web.UI.html,bn/System.Web.UI
-1,System.Web.UI.HtmlControlls,System.Web.UI.HtmlControlls.html,bn/System.Web.UI.HtmlControlls
-1,System.Web.UI.WebControls,System.Web.UI.WebControls.html,bn/System.Web.UI.WebControls
-1,System.Xml,System.Xml.html,bn/System.Xml
-0,Maintainer,maintainer.html,maintainer.src
-1,Matthew.S.Ford@rose-hulman.edu,Matthew.S.Ford@rose-hulman.edu.html,bm/Matthew.S.Ford@rose-hulman.edu
-1,Patrik.Torstensson@labs2.com,Patrik.Torstensson@labs2.com.html,bm/Patrik.Torstensson@labs2.com
-1,angryjohn69@nc.rr.com,angryjohn69@nc.rr.com.html,bm/angryjohn69@nc.rr.com
-1,bob@thestuff.net,bob@thestuff.net.html,bm/bob@thestuff.net
-1,cpodurgiel@msn.com,cpodurgiel@msn.com.html,bm/cpodurgiel@msn.com
-1,crichton@gimp.org,crichton@gimp.org.html,bm/crichton@gimp.org
-1,czw@home.se,czw@home.se.html,bm/czw@home.se
-1,daniel-weber@austin.rr.com,daniel-weber@austin.rr.com.html,bm/daniel-weber@austin.rr.com
-1,develop@wtfo-guru.com,develop@wtfo-guru.com.html,bm/develop@wtfo-guru.com
-1,dholden@draper.com,dholden@draper.com.html,bm/dholden@draper.com
-1,dick@ximian.com,dick@ximian.com.html,bm/dick@ximian.com
-1,dietmar@ximian.com,dietmar@ximian.com.html,bm/dietmar@ximian.com
-1,dmenest@yahoo.com,dmenest@yahoo.com.html,bm/dmenest@yahoo.com
-1,dsh2120@draper.com,dsh2120@draper.com.html,bm/dsh2120@draper.com
-1,duco@lorentz.xs4all.nl,duco@lorentz.xs4all.nl.html,bm/duco@lorentz.xs4all.nl
-1,duncan@ximian.com,duncan@ximian.com.html,bm/duncan@ximian.com
-1,fejj@ximian.com,fejj@ximian.com.html,bm/fejj@ximian.com
-1,gleb@eurosoft.od.ua,gleb@eurosoft.od.ua.html,bm/gleb@eurosoft.od.ua
-1,gvaish@iitk.ac.in,gvaish@iitk.ac.in.html,bm/gvaish@iitk.ac.in
-1,hildjj@cursive.net,hildjj@cursive.net.html,bm/hildjj@cursive.net
-1,iain@ximian.com,iain@ximian.com.html,bm/iain@ximian.com
-1,jason@injektilo.org,jason@injektilo.org.html,bm/jason@injektilo.org
-1,jbarn@httcb.net,jbarn@httcb.net.html,bm/jbarn@httcb.net
-1,joe@ximian.com,joe@ximian.com.html,bm/joe@ximian.com
-1,john.giffin@xor.com,john.giffin@xor.com.html,bm/john.giffin@xor.com
-1,kbottner@istation.com,kbottner@istation.com.html,bm/kbottner@istation.com
-1,lupus@ximian.com,lupus@ximian.com.html,bm/lupus@ximian.com
-1,macisaac@ximian.com,macisaac@ximian.com.html,bm/macisaac@ximian.com
-1,marcel@narings.nl,marcel@narings.nl.html,bm/marcel@narings.nl
-1,marcins@zipworld.com.au,marcins@zipworld.com.au.html,bm/marcins@zipworld.com.au
-1,martin.weindel@t-online.de,martin.weindel@t-online.de.html,bm/martin.weindel@t-online.de
-1,michaellambert@bellsouth.net,michaellambert@bellsouth.net.html,bm/michaellambert@bellsouth.net
-1,miguel@ximian.com,miguel@ximian.com.html,bm/miguel@ximian.com
-1,mkestner@speakeasy.net,mkestner@speakeasy.net.html,bm/mkestner@speakeasy.net
-1,mpultz@get2net.dk,mpultz@get2net.dk.html,bm/mpultz@get2net.dk
-1,ndrochak@gol.com,ndrochak@gol.com.html,bm/ndrochak@gol.com
-1,rooneg@electricjellyfish.net,rooneg@electricjellyfish.net.html,bm/rooneg@electricjellyfish.net
-1,scott@stonecobra.com,scott@stonecobra.com.html,bm/scott@stonecobra.com
-1,serge@wildwestsoftware.com,serge@wildwestsoftware.com.html,bm/serge@wildwestsoftware.com
-1,sm@cg.tuwien.ac.at,sm@cg.tuwien.ac.at.html,bm/sm@cg.tuwien.ac.at
-1,swildermuth@adoguy.com,swildermuth@adoguy.com.html,bm/swildermuth@adoguy.com
-1,toelen@hotmail.com,toelen@hotmail.com.html,bm/toelen@hotmail.com
-1,tomasr@mvps.org,tomasr@mvps.org.html,bm/tomasr@mvps.org
-1,tome@sbox.tugraz.at,tome@sbox.tugraz.at.html,bm/tome@sbox.tugraz.at
-1,vladimir@pobox.com,vladimir@pobox.com.html,bm/vladimir@pobox.com
-1,wictor@iBizkit.se,wictor@iBizkit.se.html,bm/wictor@iBizkit.se
+++ /dev/null
-/*
-Tool #1:
-
- compare file1.dll file2.dll annotations.xml
-
- file1.dll: This is an assembly created by Microsoft.
-
- file2.dll: This is a Mono assembly (currently we have none
- that build).
-
- annotations.xml: contains comments about a class:
-
- <class name="System.Object">
- <maintainer>
- <email>miguel@ximian.com</email>
- <name>Miguel de Icaza</name>
- </maintainer>
- <status test-suite="no" percent="XX">
- </class>
-
- That would generate an XML file with all the classes that are
- implemented in the second library. If there is nothing for a
- given class, it should generate an emtpy group:
-
- <class name="System.Object">
- </class>
-
-Tool #2:
-
- Using a Perl script that can grok XML, generate HTML pages
- that we can put on the web site:
-
- Per assembly status.
- Per maintainer status.
- Per Percent status.
-
-*/
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Xml;
-
-namespace Mapper
-{
- public class Mapper
- {
- Assembly ms, mono;
- XmlDocument annotations, output;
-
- public Mapper(string ms_lib, string mono_lib, string annotation)
- {
- Assembly ms = Assembly.LoadFrom (ms_lib);
- Assembly mono = Assembly.LoadFrom (mono_lib);
- annotations = new XmlDocument ();
- annotations.Load (annotation);
- output = new XmlDocument ();
- }
-
- void DumpMember (MemberInfo mi)
- {
- string kind;
- string more="";
-
- switch (mi.MemberType)
- {
- case MemberTypes.Field:
- kind = "field";
- break;
- case MemberTypes.Method:
- if (((MethodInfo)mi).IsSpecialName) {
- return;
- }
- kind = "method";
- more = " signature='" + mi.ToString() +"'";
- break;
- case MemberTypes.Event:
- kind = "event";
- break;
- case MemberTypes.Property:
- kind = "property";
- break;
- default:
- kind = "***UNKOWN***";
- break;
- }
- }
-
- void DumpType (Type t)
- {
- string kind, name, attrs = "";
-
- name = t.Name;
-
- if (t.IsClass) {
- kind = "class";
- } else if (t.IsInterface) {
- kind = "interface";
- } else if (t.IsValueType) {
- kind = "valueType";
- } else if (t.IsEnum) {
- kind = "enum";
- } else return;
-
- if (t.IsAbstract) {
- attrs += "abstract='true'";
- } else if (t.IsSealed) {
- attrs += "sealed='true'";
- } else if (t.IsCOMObject) {
- attrs += "comobject='true'";
- }
-
- foreach (Type type in t.GetNestedTypes ()) {
- DumpType (type);
- }
-
- foreach (FieldInfo field in t.GetFields ()) {
- DumpMember (field);
- }
-
- foreach (MethodInfo method in t.GetMethods ()) {
- DumpMember (method);
- }
-
- }
-
- void LoadTypeList (Type [] types)
- {
- foreach (Type t in types) {
- }
- }
-
- public void Map ()
- {
- Type [] types;
- Module [] modules;
- string name;
-
- name = ms.GetName ().Name;
- types = ms.GetExportedTypes ();
- modules = ms.GetModules ();
-
- DumpTypeList (types);
- }
-
- public static int Main(string[] args)
- {
- Mapper m;
- string basedir = "c:\\WINDOWS\\Microsoft.NET\\Framework\\v1.0.2914\\";
-
- if (args.Length != 3) {
- Console.WriteLine ("usage: compare ms_lib.dll mono_lib.dll annotations.xml");
- }
- try {
- m = new Mapper (args[0], args[1], args[2]);
- m.Map ();
- } catch (Exception e) {
- Console.WriteLine("Error: " + e.ToString ());
- }
- return 0;
- }
- }
-}
-
+++ /dev/null
-You can browse the status of the class library and see who has
-registered to work on what parts of the system. You can view either
-by maintainer or by namespace.
-<p>
-The tables represent things that contributors are working on. We
-register the date when they started working on a particular class, and
-whether a contributor has sent code in (the "implementation" column).
-<p>
-If you want to contribute to Mono, you want to pick a class which is
-not listed here. Alternatively, you can contact the maintainer of a
-class if you want for example to help him improve his code, make it
-faster, better, provide documentation or make comments.
-<p>
-Sometimes contributors will get too busy with other tasks, so they
-will abandon their work on a class. That is why we keep track of the
-time when they "reserve" a class to work on. If the contributor gets
-too busy, we will know if someone else can work on it
+++ /dev/null
-These lists are by maintainer.
+++ /dev/null
-<maintainers>
- <person email="miguel@ximian.com" name="Miguel de Icaza"/>
- <person email="fejj@ximian.com" name="Jeffrey Stedfast"/>
- <person email="jbarn@httcb.net" name="John Barnette"/>
- <person email="iain@ximian.com" name="Iain"/>
- <person email="bob@thestuff.net" name="Bob Smith"/>
- <person email="joe@ximian.com" name="Joe Shaw"/>
- <person email="marcins@zipworld.com.au" name="Marcin Szczepanski"/>
- <person email="rooneg@electricjellyfish.net" name="Garrett Rooney"/>
- <person email="angryjohn69@nc.rr.com" name="John R. Hicks"/>
- <person email="czw@home.se" name="Jens Backman"/>
- <person email="jason@injektilo.org" name="Jason Diamon"/>
- <person email="macisaac@ximian.com" name="Sean MacIsaac"/>
- <person email="vladimir@pobox.com" name="Vladimir Vukicevic"/>
- <person name="Michael Lambert" email="michaellambert@bellsouth.net"/>
- <person email="serge@wildwestsoftware.com" name="Sergey Chaban"/>
- <person email="scott@stonecobra.com" name="Scott Sanders"/>
- <person name="Garrett Rooney" email="rooneg@electricjellyfish.net"/>
- <person name="David Menestrina" email="dmenest@yahoo.com"/>
- <person name="Duco Fijma" email="duco@lorentz.xs4all.nl"/>
- <person name="Patrik Torstensson" email="Patrik.Torstensson@labs2.com"/>
- <person name="Tomas Restrepo" email="tomasr@mvps.org"/>
- <person name="Derek Holden" email="dholden@draper.com"/>
- <person name="Derek Holden" email="dsh2120@draper.com"/>
- <person name="Gleb Novodran" email="gleb@eurosoft.od.ua"/>
- <person name="Matthew S. Ford" email="Matthew.S.Ford@rose-hulman.edu"/>
- <person name="Marcel Narings" email="marcel@narings.nl"/>
- <person name="Joe Hildebrand" email="hildjj@cursive.net"/>
- <person name="Nick Drochak" email="ndrochak@gol.com"/>
- <person name="Mike Kestner" email="mkestner@speakeasy.net"/>
- <person name="Jim Richardson" email="develop@wtfo-guru.com"/>
- <person name="Leen Toelen" email="toelen@hotmail.com"/>
- <person name="Chris Podurgiel" email="cpodurgiel@msn.com"/>
- <person name="Stefan Maierhofer" email="sm@cg.tuwien.ac.at"/>
- <person email="dick@ximian.com" name="Dick Porter"/>
- <person email="lupus@ximian.com" name="Paolo Molaro"/>
- <person email="dietmar@ximian.com" name="Dietmar Maurer"/>
- <person name="Gaurav Vaish" email="Gaurav.Vaish@iitk.ac.in"/>
- <person name="Mads Pultz" email="mpultz@get2net.dk"/>
- <person name="Wictor Wilen" email="wictor@iBizkit.se"/>
- <person name="Thomas Neidhart" email="tome@sbox.tugraz.at"/>
- <person name="Martin Weindel" email="martin.weindel@t-online.de"/>
- <person name="Shawn Wildermuth" email="swildermuth@adoguy.com"/>
- <person name="Daniel Weber" email="daniel-weber@austin.rr.com"/>
- <person name="John Griffin" email="john.giffin@xor.com"/>
- <person name="Duncan Mak" email="duncan@ximian.com"/>
- <person name="Keith Bottner" email="kbottner@istation.com"/>
- <person name="Mark Crichton" email="crichton@gimp.org"/>
- <person name="Daniel Morgan" email="danmorg@sc.rr.com"/>
- <person name="Rodrigo Moya" email="rodrigo@ximian.com"/>
- <person name="Jonathan Pryor" email="jonpryor@vt.edu"/>
- <person name="Gonzalo Paniagua" email="gonzalo@ximian.com"/>
-</maintainers>
-
+++ /dev/null
-#!/usr/bin/perl -w
-
-open COMMANDS, ">commands";
-
-print COMMANDS "0,Class Libraries,index.html,index.src\n";
-
-print COMMANDS "0,Namespace,namespace.html,namespace.src\n";
-$files_list = `ls bn`;
-@files = split(/\s+/, $files_list);
-foreach $file (@files) {
- print COMMANDS "1,$file,$file.html,bn/$file\n";
-}
-
-print COMMANDS "0,Maintainer,maintainer.html,maintainer.src\n";
-$files_list = `ls bm`;
-@files = split(/\s+/, $files_list);
-foreach $file (@files) {
- print COMMANDS "1,$file,$file.html,bm/$file\n";
-}
-
-close COMMANDS
+++ /dev/null
-NETDIR=c:\\winnt\\microsoft.net\\framework\\v1.0.2914
-MCSCLASSDIR=..\\..\\mcs\\class
-CSC=csc.exe /nologo
-
-all: ByMaintainer ByNamespace webfiles
-
-exec:
- $(CSC) /debug+ /debug:full /target:exe /out:compare.exe compare-assembly.cs
-
-xml:
- ./compare.exe $(NETDIR)\\mscorlib.dll $(MCSCLASSDIR)\\corlib\\corlib.dll > corlib.xml
-
-push:
- scp -P 2200 *.xml web/*html www@www.ximian.com:/web/cvsmodules/mono/class-status
-
-clean:
- -rm -f compare.exe compare.pdb corlib.xml ByMaintainer.exe ByNamespace.exe commands *~ .*~
- -rm -rf src
- -rm -rf bm
- -rm -rf web
-
-ByNamespace: ByNamespace.xsl class.xml
- $(CSC) ByNamespace.cs
- -mkdir src
- ./ByNamespace
-
-ByMaintainer: ByMaintainer.xsl class.xml
- $(CSC) ByMaintainer.cs
- -mkdir src
- ./ByMaintainer
-
-webfiles:
- -mkdir web
- ./make_web.pl
- cp *.src src
- ../doc/web/process.pl commands ../doc/web/template.html.in web
+++ /dev/null
-#!/usr/bin/perl -w
-
-use strict;
-use XML::Parser;
-#use Data::Dumper;
-
-# command line arguments: shell globs for the files containing the info
-# for the ms assemblyes and mono's
-my $msglob = shift || 'ms*.xml';
-my $monoglob = shift || 'mono*.xml';
-# maintainers file
-my $mfile = 'maintainers.xml';
-my $curfile;
-
-# positions in array refs
-use constant MNAME => 0;
-use constant MASSEMBLY => 1;
-use constant MCLASS => 2;
-
-use constant MAINTAINER => 0;
-use constant PERCENT => 1;
-use constant HASH => 2;
-# we store all the data in some global hash tables
-# $email => [$name, \%assembly, \%class]
-my %maintainer;
-
-# $name => [$maintainer, $percent, \%classes];
-my %assembly;
-
-# $name => [$maintainer, $percent, \%methods]
-my %class;
-
-# my parsing state machine
-my @status;
-# current maintainer, class and assembly pointers
-my ($curm, $curc, $cura);
-my $mono = 0;
-my $namespace = '';
-my %status_action = (
- MAINTAINERS => sub {
- my ($elem, %attrs) = @_;
- malformed ($mfile, $elem, 'maintainers', \@status);
- push @status, 'DUDE';
- },
- DUDE => sub {
- my ($elem, %attrs) = @_;
- malformed ($mfile, $elem, 'person', \@status);
- foreach(qw(email name)) {die "$_ not included in person\n" unless defined $attrs{$_}}
- $curm = $maintainer{$attrs{email}} = [$attrs{name}, {}, {}];
- push @status, 'DUDE_CONTENT';
- },
- DUDE_CONTENT => sub {
- my ($elem, %attrs) = @_;
- malformed ($mfile, $elem, 'class|assembly', \@status);
- if ($elem eq 'class') {
- $curm->[MCLASS]->{$attrs{name}} = '';
- } elsif ($elem eq 'assembly') {
- $curm->[MASSEMBLY]->{$attrs{name}} = '';
- }
- push @status, 'DUDE_CONTENT';
- },
- ASSEMBLY => sub {
- my ($elem, %attrs) = @_;
- malformed ($curfile, $elem, 'assembly', \@status);
- $namespace = '';
- $cura = $assembly{$attrs{name}} = ['', 0, {}];
- push @status, 'NAMESPACE';
- },
- NAMESPACE => sub {
- my ($elem, %attrs) = @_;
- malformed ($curfile, $elem, 'namespace', \@status);
- $namespace = $attrs{name};
- push @status, 'CLASS';
- },
- CLASS => sub {
- my ($elem, %attrs) = @_;
- malformed ($curfile, $elem, 'class|valueType|interface', \@status);
- if ($elem eq 'class') {
- my $name = $namespace ? $namespace.".".$attrs{name} : $attrs{name};
- if ($mono) {
- warn "mono implements non exisistent class $name\n"
- if (!exists $class{$name});
- $curc = $class{$name};
- } else {
- $curc = $class{$name} = ['', 0, {}];
- }
- $cura->[HASH]->{$name} = $mono;
- push @status, 'METHOD';
- } else {
- push @status, 'METHOD';
- }
- },
- METHOD => sub {
- my ($elem, %attrs) = @_;
- malformed ($curfile, $elem, 'method|field|valueType', \@status);
- if ($elem eq 'method') {
- my $name = $attrs{signature};
- if ($mono) {
- warn "mono implements non exisistent method $name\n"
- if (!exists $curc->[HASH]->{$name});
- }
- $curc->[HASH]->{$name} = $mono;
- push @status, 'METHOD';
- } else {
- push @status, 'METHOD';
- }
- },
-);
-
-
-my $parser = new XML::Parser (Handlers => {Start => \&handle_tag, End => \&end_tag});
-
-# parse the maintainers info
-if ($mfile) {
- @status = 'MAINTAINERS';
- $parser->parsefile($mfile);
- #print Dumper(\%maintainer);
-}
-
-foreach (glob($msglob)) {
- $curfile = $_;
- @status = 'ASSEMBLY';
- $mono = 0;
- $parser->parsefile($_);
-}
-
-foreach (glob($monoglob)) {
- $curfile = $_;
- @status = 'ASSEMBLY';
- $mono = 1;
- $parser->parsefile($_);
-}
-
-create_stats();
-create_html();
-#print Dumper(\%assembly);
-#print Dumper(\%class);
-exit(0);
-
-sub malformed {
- my ($file, $elem, $match, $data) = @_;
- unless ($elem =~ /^$match$/) {
- $data = Dumper($data) if defined $data;
- die "file $file malformed ($elem instead of $match) $data\n"
- }
-}
-
-sub handle_tag {
- my $parser = shift @_;
- my $status = $status[-1];
- die "status $status unknown" unless exists $status_action{$status};
- $status_action{$status}->(@_);
-}
-
-sub end_tag {
- my $last = pop @status;
- # print STDERR "done with $last\n";
-}
-
-sub assign_maintainer {
- my ($m, $from, $to, $type) = @_;
- foreach (keys %$from) {
- if (!exists $to->{$_}) {
- warn "$m maintains unknown $type $_\n";
- # fixup to avoid warnings
- $to->{$_}->[MAINTAINER] = $m;
- $to->{$_}->[PERCENT] = 0;
- $to->{$_}->[HASH] = {};
- } else {
- warn "$to->{$_}->[MAINTAINER] already maintains $_ (now $m)\n" if $to->{$_}->[MAINTAINER];
- $to->{$_}->[MAINTAINER] = $m;
- }
- }
-}
-
-sub completeness {
- my $hash = shift @_;
- my $total = keys %$hash;
- my $done = 0;
- map {$done += $_} values %$hash;
- return 0 unless $total;
- return int($done*100/$total);
-}
-
-sub create_stats {
- # set maintainer field in assembly and class hashes
- foreach my $m (sort keys %maintainer) {
- assign_maintainer ($m, $maintainer{$m}->[MASSEMBLY], \%assembly, 'assembly');
- assign_maintainer ($m, $maintainer{$m}->[MCLASS], \%class, 'class');
- }
- # assign completeness percent
- foreach my $ass (values %assembly) {
- $ass->[PERCENT] = completeness ($ass->[HASH]);
- }
- foreach my $class (values %class) {
- $class->[PERCENT] = completeness ($class->[HASH]);
- }
-}
-
-sub html_header {
- my ($title) = @_;
-return <<"EOF";
-<html><head><title>$title</title></head><body bgcolor="#ffffff">
-<h1 ALIGN=center>$title</H1>
-EOF
-
-}
-
-sub unimplemented ($) {
- my ($c) = @_;
- my $id = $c;
- $id =~ tr/./-/;
- return "<A HREF='per-unimplemented.html#$id'>$c</A>";
-}
-
-sub create_html {
-
- open(F, ">per-assembly.html") || die "Cannot open file: $!";
- print F html_header("Mono - per-assembly stats");
- print F "<TABLE BORDER=1><TR><TH>Assembly<TH>Maintainer<TH>Completion\n";
- foreach my $ass (sort keys %assembly) {
- print F "\t<TR><TD>", join('<TD>', $ass, $assembly{$ass}->[MAINTAINER], $assembly{$ass}->[PERCENT]), "\n";
- }
- print F "</TABLE>\n";
- print F "</body></html>\n";
- close(F);
-
- # per maintainer info
- open(F, ">per-maintainer.html") || die "Cannot open file: $!";
- print F html_header("Mono - per-maintainer stats");
- print F "<TABLE BORDER=1><TR><TH>Maintainer<TH>Class<TH>Completion\n";
- foreach my $m (sort keys %maintainer) {
- my @classes = sort keys %{$maintainer{$m}->[MCLASS]};
- my $count = @classes;
- foreach my $c (@classes) {
- my $start = $count?"\t<TR><TD ROWSPAN=$count>$m<TD>":"\t<TR><TD>";
- $count = 0;
- print F $start, join('<TD>', $c, $class{$c}->[PERCENT]), "\n";
- }
- }
- my @unmantained = sort grep {!$class{$_}->[MAINTAINER]} keys %class;
- my $count = @unmantained;
- foreach my $c (@unmantained) {
- my $start = $count?"\t<TR><TD ROWSPAN=$count>Unmantained<TD>":"\t<TR><TD>";
- $count = 0;
- print F $start, join('<TD>', $c, $class{$c}->[PERCENT]), "\n";
- }
- print F "</TABLE>\n";
- print F "</body></html>\n";
- close(F);
-
- # per-completion info
- open(F, ">per-completion.html") || die "Cannot open file: $!";
- print F html_header("Mono - per-completion stats");
- print F "<TABLE BORDER=1><TR><TH>Completion<TH>Class<TH>Maintainer\n";
- foreach my $c (sort {$class{$b}->[PERCENT] <=> $class{$a}->[PERCENT]} keys %class) {
- print F "\t<TR><TD>", join('<TD>', $class{$c}->[PERCENT], unimplemented($c), $class{$c}->[MAINTAINER]), "\n";
- }
- print F "</TABLE>\n";
- print F "</body></html>\n";
- close(F);
-
- # unimplemented methods
- # FIXME: this can create a very big file, split on assembly name
- # and fix also the unimplemented() sub
- open(F, ">per-unimplemented.html") || die "Cannot open file: $!";
- print F html_header("Mono - unimplemented methods stats");
- print F "<TABLE BORDER=1><TR><TH>Class<TH>Method\n";
- foreach my $c (sort grep {$class{$_}->[PERCENT] != 100} keys %class) {
- my @methods = sort grep {!$class{$c}->[HASH]->{$_}} keys %{$class{$c}->[HASH]};
- my $count = @methods;
- my $aname = '';
- if ($count) {
- my $id = $c;
- $id =~ tr/./-/;
- $aname = "<A NAME='$id'></A>";
- }
- foreach my $m (@methods) {
- my $start = $count?"\t<TR><TD ROWSPAN=$count>$aname$c<TD>":"\t<TR><TD>";
- $count = 0;
- print F $start, join('<TD>', $m), "\n";
- }
- }
- print F "</TABLE>\n";
- print F "</body></html>\n";
- close(F);
-
-}
-
+++ /dev/null
-These lists are by Namespace.
+2005-06-13 Miguel de Icaza <miguel@novell.com>
+
+ * sys-statvfs.c (copy_statfs): f_flags is the field name on BSD,
+ not f_flag.
+
+2005-06-08 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Makefile.am: Create an unversioned library. We won't make any gaurantees
+ about ABI stability until Mono 1.2 (if then).
+
+2005-06-07 Jonathan Pryor <jonpryor@vt.edu>
+
+ * sys-mman.c: Check for presence of mremap and remap_file_pages.
+
2005-06-05 Jonathan Pryor <jonpryor@vt.edu>
* map-icalls.h, map.h: Change header comment so it matches what
$(MPH_LIBS) \
$(Z_LIBS)
-libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
+# libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
+libMonoPosixHelper_la_LDFLAGS = -no-undefined -module -avoid-version
#
# Use this target to refresh the values in map.[ch]
return munlock (start, (size_t) len);
}
+#ifdef HAVE_MREMAP
void*
Mono_Posix_Syscall_mremap (void *old_address, mph_size_t old_size,
mph_size_t new_size, guint64 flags)
return mremap (old_address, (size_t) old_size, (size_t) new_size,
(unsigned long) _flags);
}
+#endif /* def HAVE_MREMAP */
int
Mono_Posix_Syscall_mincore (void *start, mph_size_t length, void *vec)
}
#endif /* def HAVE_POSIX_MADVISE */
+#ifdef HAVE_REMAP_FILE_PAGES
int
Mono_Posix_Syscall_remap_file_pages (void *start, mph_size_t size,
int prot, mph_ssize_t pgoff, int flags)
return remap_file_pages (start, (size_t) size, _prot, (ssize_t) pgoff, _flags);
}
+#endif /* def HAVE_REMAP_FILE_PAGES */
G_END_DECLS
to->f_files = from->f_files;
to->f_ffree = from->f_ffree;
to->f_favail = from->f_ffree; /* OSX doesn't have f_avail */
- Mono_Posix_ToMountFlags (from->f_flag, &to->f_flag);
+ Mono_Posix_ToMountFlags (from->f_flags, &to->f_flag);
// from->f_fsid is an int32[2], to->f_fsid is a uint64,
// so this shouldn't lose anything.
memcpy (&to->f_fsid, &from->f_fsid, sizeof(to->f_fsid));