mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
470791b186 | ||
|
|
3887d81f8e | ||
|
|
11072be5ed | ||
|
|
4291f2a73b | ||
|
|
5b8bf83ccd | ||
|
|
1fd0386f87 | ||
|
|
9de1e8b272 | ||
|
|
c02bd27e8f | ||
|
|
c146e4e4fd | ||
|
|
331427f067 | ||
|
|
37bbac467f | ||
|
|
5161c62e10 | ||
|
|
9458c03da1 | ||
|
|
6179d4a924 | ||
|
|
58216b41fb | ||
|
|
30a744498e | ||
|
|
c253f26bc3 | ||
|
|
6017bcd4ae | ||
|
|
561cb241d9 | ||
|
|
1fcf34271b | ||
|
|
f2de867101 | ||
|
|
992e22f306 | ||
|
|
0c65fe81ed | ||
|
|
6887168dc2 | ||
|
|
87b0e91eff | ||
|
|
883c60f9a9 | ||
|
|
1fc3eea4d1 | ||
|
|
ce5e64372c | ||
|
|
eb766b843d | ||
|
|
dbb88b930b | ||
|
|
701ec25f87 | ||
|
|
56157b091b | ||
|
|
91506c541c | ||
|
|
5deb2e0f97 | ||
|
|
f0bac9e0b7 | ||
|
|
6d9fa806ea | ||
|
|
2ee594eee6 | ||
|
|
fd92d87ed0 | ||
|
|
2bc209f4f4 | ||
|
|
f73e839351 | ||
|
|
f6e12de276 | ||
|
|
e5af45cdb3 | ||
|
|
2491b3dbb2 | ||
|
|
ef11247772 | ||
|
|
370bf41989 | ||
|
|
9e79a22008 | ||
|
|
da54730380 | ||
|
|
3a433af16e | ||
|
|
6fdda55b42 | ||
|
|
cdc69e8e9e | ||
|
|
d67fd7ce3a | ||
|
|
d195b62b9d | ||
|
|
3e90298aa1 | ||
|
|
8ae9f4eace | ||
|
|
08038cbf3b | ||
|
|
7e7c65d58f | ||
|
|
4bf06608d3 | ||
|
|
3aad6c2f07 | ||
|
|
26f04c283d | ||
|
|
e03981495b | ||
|
|
0f766fceaf | ||
|
|
cd51852dd8 | ||
|
|
0a5a292db4 | ||
|
|
b3c5bdfa7f | ||
|
|
fc77b903af | ||
|
|
ff74079dc1 | ||
|
|
ed3174a8b7 | ||
|
|
4485172658 | ||
|
|
7ca53d801a | ||
|
|
b34dcd83c4 | ||
|
|
07d8da1481 | ||
|
|
ae5b023940 | ||
|
|
9fa4d42782 | ||
|
|
98bcd46dd1 | ||
|
|
c373ddd111 | ||
|
|
b93c12250d | ||
|
|
67a9b038c5 | ||
|
|
dc330f3d57 | ||
|
|
9fe47f55e3 | ||
|
|
657e5df419 | ||
|
|
1511ce89c6 | ||
|
|
05e0f11430 | ||
|
|
06cddce9b0 | ||
|
|
3e3c9edc91 | ||
|
|
24d7fea4ca | ||
|
|
691a2cf225 | ||
|
|
296607e9b1 | ||
|
|
ee79b6f908 | ||
|
|
9844a237ea | ||
|
|
9a817effa9 | ||
|
|
9a2e1ccef4 | ||
|
|
fbfb1742ed | ||
|
|
547f83ca27 | ||
|
|
73bd2d2941 | ||
|
|
e6a317bc40 | ||
|
|
bfdcf61509 | ||
|
|
a1f8c0800d | ||
|
|
861c4f8f12 | ||
|
|
7af8c9351d | ||
|
|
7155c65bfd | ||
|
|
f20c4ece0c | ||
|
|
45efaf51b3 | ||
|
|
de0321f109 | ||
|
|
71864e55c4 | ||
|
|
92aa367629 | ||
|
|
a7e3109c66 | ||
|
|
0c68cd806a | ||
|
|
8098dbe758 | ||
|
|
50619fe4f4 | ||
|
|
b4c5181a77 | ||
|
|
f20b93ecf7 | ||
|
|
2023460027 | ||
|
|
d44a27c9e1 | ||
|
|
cf1ccdc254 | ||
|
|
ce427d5af1 | ||
|
|
a78027248b | ||
|
|
7d3335da20 | ||
|
|
a21f8151eb | ||
|
|
ddb21259f1 | ||
|
|
2664cc24dc | ||
|
|
f445544ba8 | ||
|
|
fe7bbc9da1 | ||
|
|
1b3d62f26e | ||
|
|
1b578615c6 | ||
|
|
54c0e1e47f | ||
|
|
cd105f51c1 | ||
|
|
af1e7f3096 | ||
|
|
544c381f9f | ||
|
|
64c2b9fea8 | ||
|
|
ad443c3edf | ||
|
|
f83478e9f0 | ||
|
|
6ff666ba9f | ||
|
|
5a4faa0dbe | ||
|
|
560afb2c8c | ||
|
|
df6dcb4bc3 | ||
|
|
ae55ffa9b3 | ||
|
|
3fd6b5713d | ||
|
|
71fbfc7a0a | ||
|
|
2d97201acc | ||
|
|
d6717fd548 | ||
|
|
4e17e21b2a | ||
|
|
3dc556e23b | ||
|
|
24b03dbeb3 | ||
|
|
ce37fb5dfb | ||
|
|
f4bb6280cd | ||
|
|
bc76b7d785 | ||
|
|
e538bc771d | ||
|
|
5334d00d47 | ||
|
|
e43c207e12 | ||
|
|
ea6508481f | ||
|
|
6ed0b0bd5d | ||
|
|
2514e975c3 | ||
|
|
882ffb10b4 | ||
|
|
a1a664dbcd | ||
|
|
9ff5304841 | ||
|
|
bac3152d94 | ||
|
|
02f76440bb | ||
|
|
bb0e7fc708 | ||
|
|
800ae747f2 | ||
|
|
6d986cfd7a | ||
|
|
88068708ab | ||
|
|
7a9e96f166 | ||
|
|
e7ec701595 | ||
|
|
eed1a21d6d | ||
|
|
7246c849af | ||
|
|
d39d766bf9 | ||
|
|
3a2bd00f10 | ||
|
|
9341400101 | ||
|
|
42b1712b66 | ||
|
|
1f16a62cf9 | ||
|
|
7f4be72fcc | ||
|
|
e521732831 | ||
|
|
fc81aabdab | ||
|
|
fcfc9108ba | ||
|
|
b462d915a2 | ||
|
|
e8d73281a2 | ||
|
|
ff0399cfbe | ||
|
|
a30aa5462d |
No files matched your search
@@ -1,3 +1,25 @@
|
||||
2009-01-05 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Disable sigaltstack on freebsd as it doesn't seem to work.
|
||||
|
||||
2008-12-15 Marek Habersack <[email protected]>
|
||||
|
||||
* data/Makefile.am (EXTRA_DIST): added
|
||||
system.web.extensions_1.0.pc.in. Also added to pkgconfig_DATA
|
||||
|
||||
* data/system.web.extensions_1.0.pc.in: added. This file serves
|
||||
the purpose of making MonoDevelop see the 1.0 version of the
|
||||
System.Web.Extensions assembly in the project references
|
||||
editor. This will also make legacy 2.0 ASP.NET apps not fail when
|
||||
they reference the 1.0 version of the assembly in their project
|
||||
files.
|
||||
|
||||
* configure.in: added data/system.web.extensions_1.0.pc to AC_OUTPUT
|
||||
|
||||
2008-12-05 Marek Habersack <[email protected]>
|
||||
|
||||
* configure.in: check whether round (3) and rint (3) are present
|
||||
in the C library.
|
||||
|
||||
Mon Nov 10 17:37:08 CET 2008 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
@@ -500,4 +500,5 @@ This is Mono.
|
||||
If the directory ../olive is present (as an
|
||||
independent checkout) from the Mono module, that
|
||||
directory is automatically configured to share the
|
||||
same prefix than this module gets.
|
||||
same prefix than this module gets
|
||||
|
||||
+8
-2
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.1)
|
||||
AM_INIT_AUTOMAKE(mono,2.2)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=1.0
|
||||
@@ -119,7 +119,8 @@ case "$host" in
|
||||
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
|
||||
libdl=
|
||||
libgc_threads=pthreads
|
||||
with_sigaltstack=yes
|
||||
# This doesn't seem to work as of 7.0 on amd64
|
||||
with_sigaltstack=no
|
||||
# TLS is only partially implemented on -CURRENT (compiler support
|
||||
# but NOT library support)
|
||||
#
|
||||
@@ -1582,6 +1583,9 @@ if test "x$ac_cv_truncl" != "xyes"; then
|
||||
AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL, 1, [Has the 'aintl' function]) LIBS="$LIBS -lsunmath"])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(round)
|
||||
AC_CHECK_FUNCS(rint)
|
||||
|
||||
dnl ****************************
|
||||
dnl *** Look for /dev/random ***
|
||||
dnl ****************************
|
||||
@@ -2325,6 +2329,8 @@ data/dotnet35.pc
|
||||
data/wcf.pc
|
||||
data/cecil.pc
|
||||
data/smcs.pc
|
||||
data/system.web.extensions_1.0.pc
|
||||
data/system.web.extensions.design_1.0.pc
|
||||
samples/Makefile
|
||||
support/Makefile
|
||||
data/config
|
||||
|
||||
+7
-4
@@ -7,21 +7,24 @@ EXTRA_DIST = \
|
||||
browscap.ini mono.supp mono.d README \
|
||||
mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
|
||||
mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
|
||||
mono-lineeditor.pc.in
|
||||
mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
if JIT_SUPPORTED
|
||||
if INTERP_SUPPORTED
|
||||
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
|
||||
pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc
|
||||
else
|
||||
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
|
||||
pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc
|
||||
endif
|
||||
else
|
||||
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
|
||||
endif
|
||||
|
||||
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
|
||||
DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
|
||||
system.web.extensions.design_1.0.pc
|
||||
|
||||
mono_DATA = config \
|
||||
browscap.ini
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2008-12-03 Marek Habersack <[email protected]>
|
||||
|
||||
* machine.config: rename serviceModelHostingEnvironment to
|
||||
serviceHostingEnvironment.
|
||||
|
||||
2008-11-14 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* DefaultWsdlHelpGenerator.aspx: use javascript instead of
|
||||
HttpWebRequest to avoid a deadlock if the web service uses Session.
|
||||
Bug #444343 fixed.
|
||||
re: miguel
|
||||
|
||||
2008-10-09 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* web.config: default values for httpRuntime are different in 2.0
|
||||
|
||||
@@ -34,6 +34,73 @@
|
||||
<%@ Page debug="true" %>
|
||||
|
||||
<html>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var req;
|
||||
function getXML (command, url, qs) {
|
||||
if (url == "" || url.substring (0, 4) != "http")
|
||||
return;
|
||||
|
||||
var post_data = null;
|
||||
req = getReq ();
|
||||
req.onreadystatechange = stateChange;
|
||||
if (command == "GET") {
|
||||
url = url + "?" + qs;
|
||||
} else {
|
||||
post_data = qs;
|
||||
}
|
||||
req.open (command, url, true);
|
||||
if (command == "POST")
|
||||
req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
|
||||
req.send (post_data);
|
||||
}
|
||||
|
||||
function stateChange () {
|
||||
if (req.readyState == 4) {
|
||||
var node = document.getElementById("testresult_div");
|
||||
var text = "";
|
||||
if (req.status == 200) {
|
||||
node.innerHTML = "<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
} else {
|
||||
var ht = "<b style='color: red'>" + formatXml (req.status + " - " + req.statusText) + "</b>";
|
||||
if (req.responseText != "")
|
||||
ht = ht + "\n<div class='code-xml'>" + formatXml (req.responseText) + "</div>";
|
||||
node.innerHTML = ht;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formatXml (text)
|
||||
{
|
||||
var re = / /g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\t/g;
|
||||
text = text.replace (re, " ");
|
||||
|
||||
re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
|
||||
text = text.replace (re,"{blue:<$1}{maroon:$2}{blue:$3>}");
|
||||
|
||||
re = /{(\w*):(.*?)}/g;
|
||||
text = text.replace (re,"<span style='color:$1'>$2</span>");
|
||||
|
||||
re = /"(.*?)"/g;
|
||||
text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
|
||||
|
||||
re = /\r\n|\r|\n/g;
|
||||
text = text.replace (re, "<br/>");
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function getReq () {
|
||||
if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest(); // Firefox, Safari, ...
|
||||
} else if (window.ActiveXObject) {
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script language="C#" runat="server">
|
||||
|
||||
ServiceDescriptionCollection descriptions;
|
||||
@@ -329,21 +396,31 @@ class NoCheckCertificatePolicy : ICertificatePolicy {
|
||||
}
|
||||
}
|
||||
|
||||
string GetTestResult ()
|
||||
{
|
||||
if (!HasFormResult) return null;
|
||||
|
||||
string GetOrPost ()
|
||||
{
|
||||
return (CurrentOperationProtocols.IndexOf ("HttpGet") >= 0) ? "GET" : "POST";
|
||||
}
|
||||
|
||||
string GetQS ()
|
||||
{
|
||||
bool fill = false;
|
||||
string qs = "";
|
||||
for (int n=0; n<Request.QueryString.Count; n++)
|
||||
{
|
||||
NameValueCollection query_string = Request.QueryString;
|
||||
for (int n = 0; n < query_string.Count; n++) {
|
||||
if (fill) {
|
||||
if (qs != "") qs += "&";
|
||||
qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
|
||||
qs += query_string.GetKey(n) + "=" + Server.UrlEncode (query_string [n]);
|
||||
}
|
||||
if (Request.QueryString.GetKey(n) == "ext") fill = true;
|
||||
if (query_string.GetKey(n) == "ext") fill = true;
|
||||
}
|
||||
|
||||
|
||||
return qs;
|
||||
}
|
||||
|
||||
string GetTestResultUrl ()
|
||||
{
|
||||
if (!HasFormResult) return "";
|
||||
|
||||
string location = null;
|
||||
ServiceDescription desc = descriptions [0];
|
||||
Service service = desc.Services[0];
|
||||
@@ -358,59 +435,7 @@ string GetTestResult ()
|
||||
if (location == null)
|
||||
return "Could not locate web service";
|
||||
|
||||
try
|
||||
{
|
||||
string url = location + "/" + CurrentOperationName;
|
||||
Uri uri = new Uri (url);
|
||||
WebRequest req;
|
||||
if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
|
||||
req = WebRequest.Create (url);
|
||||
req.Method="POST";
|
||||
if (!String.IsNullOrEmpty (qs)) {
|
||||
req.ContentType = "application/x-www-form-urlencoded";
|
||||
byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
|
||||
req.ContentLength = postBuffer.Length;
|
||||
using (Stream requestStream = req.GetRequestStream())
|
||||
requestStream.Write (postBuffer, 0, postBuffer.Length);
|
||||
}
|
||||
}
|
||||
else
|
||||
req = WebRequest.Create (url + "?" + qs);
|
||||
if (url.StartsWith ("https:"))
|
||||
ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
|
||||
HttpCookieCollection cookies = Request.Cookies;
|
||||
int last = cookies.Count;
|
||||
if (last > 0) {
|
||||
CookieContainer container = new CookieContainer ();
|
||||
for (int i = 0; i < last; i++) {
|
||||
HttpCookie hcookie = cookies [i];
|
||||
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
|
||||
container.Add (uri, cookie);
|
||||
}
|
||||
((HttpWebRequest) req).CookieContainer = container;
|
||||
}
|
||||
WebResponse resp = req.GetResponse();
|
||||
StreamReader sr = new StreamReader (resp.GetResponseStream());
|
||||
string s = sr.ReadToEnd ();
|
||||
sr.Close ();
|
||||
return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string res = "<b style='color:red'>" + ex.Message + "</b>";
|
||||
WebException wex = ex as WebException;
|
||||
if (wex != null)
|
||||
{
|
||||
WebResponse resp = wex.Response;
|
||||
if (resp != null) {
|
||||
StreamReader sr = new StreamReader (resp.GetResponseStream());
|
||||
string s = sr.ReadToEnd ();
|
||||
sr.Close ();
|
||||
res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return location + "/" + CurrentOperationName;
|
||||
}
|
||||
|
||||
string GenerateOperationMessages (string protocol, bool generateInput)
|
||||
@@ -1747,7 +1772,11 @@ This service does not contain any public web method.
|
||||
</form>
|
||||
<div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
|
||||
The web service returned the following result:<br/><br/>
|
||||
<div class="codePanel"><%=GetTestResult()%></div>
|
||||
<div class="codePanel" id="testresult_div">
|
||||
</div>
|
||||
<script language="javascript">
|
||||
getXML ("<%= GetOrPost () %>", "<%= GetTestResultUrl () %>", "<%= GetQS () %>");
|
||||
</script>
|
||||
</div>
|
||||
<% } else {%>
|
||||
The test form is not available for this operation because it has parameters with a complex structure.
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="diagnostic" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="serviceModelHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</sectionGroup>
|
||||
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Name: System.Web.Extensions.Design
|
||||
Description: System.Web.Extensions.Design ASP.NET 2.0 add-on
|
||||
Version: 1.0.61025.0
|
||||
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions.Design/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.Design.dll
|
||||
@@ -0,0 +1,4 @@
|
||||
Name: System.Web.Extensions
|
||||
Description: System.Web.Extensions ASP.NET 2.0 add-on
|
||||
Version: 1.0.61025.0
|
||||
Libs: -r:@prefix@/lib/mono/gac/System.Web.Extensions/1.0.61025.0__31bf3856ad364e35/System.Web.Extensions.dll
|
||||
@@ -1,3 +1,24 @@
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add mono-file-formats{.config,.source} and
|
||||
mono-tools{.config,.source} (fixes the build).
|
||||
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
|
||||
mono-tool{.tree,.zip} files.
|
||||
* mono-file-formats.config, mono-tools.config: Alter paths to man
|
||||
pages so that they're valid for building from mono/docs.
|
||||
* monoapi.make: Rename to docs.make.
|
||||
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs.make, Makefile.am: Build mono-file-formats{.tree,.zip},
|
||||
mono-tool{.tree,.zip} files.
|
||||
* mono-file-formats.config, mono-tools.config: Alter paths to man
|
||||
pages so that they're valid for building from mono/docs.
|
||||
* monoapi.make: Rename to docs.make.
|
||||
|
||||
2008-11-01 Raja R Harinath <[email protected]>
|
||||
|
||||
* Makefile.am: Clean up for srcdir != builddir.
|
||||
|
||||
+21
-6
@@ -5,6 +5,8 @@ sources_DATA = \
|
||||
$(ASSEMBLED_DOCS)
|
||||
|
||||
ASSEMBLED_DOCS = \
|
||||
mono-file-formats.tree mono-file-formats.zip \
|
||||
mono-tools.tree mono-tools.zip \
|
||||
monoapi.tree monoapi.zip
|
||||
|
||||
EXTRA_DIST = \
|
||||
@@ -18,6 +20,7 @@ EXTRA_DIST = \
|
||||
convert.cs \
|
||||
current-api \
|
||||
deploy \
|
||||
docs.make \
|
||||
documented \
|
||||
embedded-api \
|
||||
exception-handling.txt \
|
||||
@@ -39,8 +42,11 @@ EXTRA_DIST = \
|
||||
mini-doc.txt \
|
||||
mini-porting.txt \
|
||||
mono-api-metadata.html \
|
||||
mono-file-formats.config\
|
||||
mono-file-formats.source\
|
||||
mono_handle_d \
|
||||
monoapi.make \
|
||||
mono-tools.config \
|
||||
mono-tools.source \
|
||||
monoapi.source \
|
||||
new-regalloc \
|
||||
object-layout \
|
||||
@@ -73,9 +79,18 @@ clean-local:
|
||||
-rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe*
|
||||
-cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
|
||||
|
||||
monoapi.tree monoapi.zip: monoapi.make Makefile.am toc.xml $(srcdir)/deploy/.stamp
|
||||
cp $(srcdir)/api-style.css $(srcdir)/deploy/
|
||||
cd $(srcdir) && $(MAKE) -f monoapi.make topdir=$(mcs_topdir_from_srcdir) assemble
|
||||
monoapi.zip : monoapi.tree
|
||||
monoapi.tree: docs.make Makefile.am toc.xml deploy/.stamp
|
||||
cp api-style.css deploy
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
mono-tools.zip : mono-tools.tree
|
||||
mono-tools.tree: docs.make Makefile.am deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
mono-file-formats.zip : mono-file-formats.tree
|
||||
mono-file-formats.tree: docs.make Makefile.am deploy/.stamp
|
||||
cd $(srcdir) && $(MAKE) -f $< topdir=$(mcs_topdir_from_srcdir) $@
|
||||
|
||||
$(srcdir)/deploy/.stamp: convert.exe Makefile.am
|
||||
$(mkdir_p) $(srcdir)/html
|
||||
@@ -85,6 +100,6 @@ $(srcdir)/deploy/.stamp: convert.exe Makefile.am
|
||||
|
||||
extract: $(srcdir)/deploy/.stamp
|
||||
|
||||
convert.exe: monoapi.make convert.cs Makefile.am
|
||||
cd $(srcdir) && $(MAKE) -f monoapi.make topdir=$(mcs_topdir_from_srcdir) convert.exe
|
||||
convert.exe: docs.make convert.cs Makefile.am
|
||||
cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
thisdir = docs
|
||||
SUBDIRS =
|
||||
include $(topdir)/build/rules.make
|
||||
|
||||
ASSEMBLED_DOCS = \
|
||||
mono-file-formats.tree mono-file-formats.zip \
|
||||
mono-tools.tree mono-tools.zip \
|
||||
monoapi.tree monoapi.zip
|
||||
|
||||
convert.exe: convert.cs AgilityPack.dll
|
||||
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
|
||||
|
||||
monoapi.zip : monoapi.tree
|
||||
monoapi.tree: toc.xml docs.make
|
||||
$(MDOC) assemble -o monoapi -f hb $<
|
||||
|
||||
mono-tools.zip : mono-tools.tree
|
||||
mono-tools.tree: mono-tools.config docs.make
|
||||
$(MDOC) assemble -o mono-tools -f man $<
|
||||
|
||||
mono-file-formats.zip : mono-file-formats.tree
|
||||
mono-file-formats.tree: mono-file-formats.config docs.make
|
||||
$(MDOC) assemble -o mono-file-formats -f man $<
|
||||
|
||||
.doc-stamp:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<manpages>
|
||||
<manpage name="mdoc(5)" page="../man/mdoc.5" />
|
||||
<manpage name="mono-config(5)" page="../man/mono-config.5" />
|
||||
</manpages>
|
||||
File renamed without changes.
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0"?>
|
||||
<manpages>
|
||||
<manpage name="al(1)" page="../man/al.1" />
|
||||
<manpage name="caspol(1)" page="../man/caspol.1" />
|
||||
<manpage name="cert2spc(1)" page="../man/cert2spc.1" />
|
||||
<manpage name="certmgr(1)" page="../man/certmgr.1" />
|
||||
<manpage name="chktrust(1)" page="../man/chktrust.1" />
|
||||
<manpage name="cilc(1)" page="../man/cilc.1" />
|
||||
<manpage name="disco(1)" page="../man/disco.1" />
|
||||
<manpage name="dtd2xsd(1)" page="../man/dtd2xsd.1" />
|
||||
<manpage name="gacutil(1)" page="../man/gacutil.1" />
|
||||
<manpage name="genxs(1)" page="../man/genxs.1" />
|
||||
<manpage name="httpcfg(1)" page="../man/httpcfg.1" />
|
||||
<manpage name="ilasm(1)" page="../man/ilasm.1" />
|
||||
<manpage name="macpack(1)" page="../man/macpack.1" />
|
||||
<manpage name="makecert(1)" page="../man/makecert.1" />
|
||||
<manpage name="mconfig(1)" page="../man/mconfig.1" />
|
||||
<manpage name="mcs(1)" page="../man/mcs.1" />
|
||||
<manpage name="mdassembler(1)" page="../man/mdassembler.1" />
|
||||
<manpage name="mdcs2ecma(1)" page="../man/mdcs2ecma.1" />
|
||||
<manpage name="mdnormalizer(1)" page="../man/mdnormalizer.1" />
|
||||
<manpage name="mdoc(1)" page="../man/mdoc.1" />
|
||||
<manpage name="mdoc-assemble(1)" page="../man/mdoc-assemble.1" />
|
||||
<manpage name="mdoc-export-html(1)" page="../man/mdoc-export-html.1" />
|
||||
<manpage name="mdoc-export-msxdoc(1)" page="../man/mdoc-export-msxdoc.1" />
|
||||
<manpage name="mdoc-update(1)" page="../man/mdoc-update.1" />
|
||||
<manpage name="mdoc-validate(1)" page="../man/mdoc-validate.1" />
|
||||
<manpage name="mdvalidator(1)" page="../man/mdvalidator.1" />
|
||||
<manpage name="mkbundle(1)" page="../man/mkbundle.1" />
|
||||
<manpage name="mono(1)" page="../man/mono.1" />
|
||||
<manpage name="mono-service(1)" page="../man/mono-service.1" />
|
||||
<manpage name="mono-shlib-cop(1)" page="../man/mono-shlib-cop.1" />
|
||||
<manpage name="monodocer(1)" page="../man/monodocer.1" />
|
||||
<manpage name="monodocs2html(1)" page="../man/monodocs2html.1" />
|
||||
<manpage name="monolinker(1)" page="../man/monolinker.1" />
|
||||
<manpage name="monop(1)" page="../man/monop.1" />
|
||||
<manpage name="monostyle(1)" page="../man/monostyle.1" />
|
||||
<manpage name="mono-xmltool(1)" page="../man/mono-xmltool.1" />
|
||||
<manpage name="mozroots(1)" page="../man/mozroots.1" />
|
||||
<manpage name="oldmono(1)" page="../man/oldmono.1" />
|
||||
<manpage name="permview(1)" page="../man/permview.1" />
|
||||
<manpage name="prj2make(1)" page="../man/prj2make.1" />
|
||||
<manpage name="resgen(1)" page="../man/resgen.1" />
|
||||
<manpage name="secutil(1)" page="../man/secutil.1" />
|
||||
<manpage name="setreg(1)" page="../man/setreg.1" />
|
||||
<manpage name="sgen(1)" page="../man/sgen.1" />
|
||||
<manpage name="signcode(1)" page="../man/signcode.1" />
|
||||
<manpage name="sn(1)" page="../man/sn.1" />
|
||||
<manpage name="soapsuds(1)" page="../man/soapsuds.1" />
|
||||
<manpage name="sqlsharp(1)" page="../man/sqlsharp.1" />
|
||||
<manpage name="vbnc(1)" page="../man/vbnc.1" />
|
||||
<manpage name="wsdl(1)" page="../man/wsdl.1" />
|
||||
<manpage name="wsdl2(1)" page="../man/wsdl2.1" />
|
||||
<manpage name="xsd(1)" page="../man/xsd.1" />
|
||||
</manpages>
|
||||
File renamed without changes.
@@ -1,12 +0,0 @@
|
||||
thisdir = docs
|
||||
SUBDIRS =
|
||||
include $(topdir)/build/rules.make
|
||||
|
||||
assemble: toc.xml
|
||||
$(MDOC) assemble -o monoapi -f hb toc.xml
|
||||
|
||||
convert.exe: convert.cs AgilityPack.dll
|
||||
$(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
|
||||
|
||||
.doc-stamp:
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2008-12-31 Massimiliano Mantione <[email protected]>
|
||||
|
||||
* mono.1: Merged the profiler documentation from trunk (r122288),
|
||||
removing the "ts" option (it does not exist anymore) and explaining
|
||||
the defaults for allocation and heap profiling.
|
||||
|
||||
2008-12-12 Rolf Bjarne Kvinge <[email protected]>
|
||||
|
||||
* Makefile.am, vbnc.1: Remove vbnc.1. It's living in the
|
||||
mono-basic module now.
|
||||
|
||||
[Backport of r121406.]
|
||||
|
||||
2008-10-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Makefile.am (man_MANS): Remove unpackaged files.
|
||||
|
||||
@@ -48,7 +48,6 @@ man_MANS = \
|
||||
sn.1 \
|
||||
soapsuds.1 \
|
||||
sqlsharp.1 \
|
||||
vbnc.1 \
|
||||
wsdl.1 \
|
||||
xsd.1
|
||||
|
||||
|
||||
+60
-20
@@ -548,7 +548,7 @@ repository.
|
||||
.PP
|
||||
This profiler is activated passing the \fB--profile=logging\fR option to
|
||||
the mono runtime, and is controlled attaching further options, like
|
||||
\fB--profile=logging:stat\fR for doing statistical profiling (multiple
|
||||
\fB--profile=logging:statistical\fR for doing statistical profiling (multiple
|
||||
options are separated by commas).
|
||||
.PP
|
||||
As a quick primer, here are a few examples of the most common usage modes:
|
||||
@@ -557,32 +557,70 @@ To write the resulting data to "mydata.mprof" (defaults to statistical
|
||||
profiling):
|
||||
.nf
|
||||
|
||||
mono --profile=logging:o=mydata.mprof program.exe
|
||||
mono --profile=logging:output=mydata.mprof program.exe
|
||||
.fi
|
||||
.PP
|
||||
To perform statistical profiling, inspecting call chains up to depth 8:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:s=8 program.exe
|
||||
mono --profile=logging:statistical=8 program.exe
|
||||
.fi
|
||||
.PP
|
||||
To profile allocations with caller method attribution:
|
||||
To profile allocations (by default the call stack will be analized for
|
||||
each allocation, producing detailed caller method attribution infornation):
|
||||
.nf
|
||||
|
||||
mono --profile=logging:a,ts program.exe
|
||||
mono --profile=logging:allocations program.exe
|
||||
.fi
|
||||
.PP
|
||||
To profile garbage collection activity (collection time and objects freed
|
||||
at each collection):
|
||||
To profile garbage collection activity at a high level (collection time and objects freed
|
||||
at each collection for each class are reported, but heap snapshots are not saved to disk):
|
||||
.nf
|
||||
|
||||
mono --profile=logging:g,as program.exe
|
||||
mono --profile=logging:allocations-summary program.exe
|
||||
.fi
|
||||
.PP
|
||||
To perform heap profiling taking heap snapshots:
|
||||
.nf
|
||||
|
||||
mono --profile=logging:heap=all program.exe
|
||||
mono --profile=logging:heap=<signal> program.exe
|
||||
.fi
|
||||
|
||||
If "all" is specified, a heap snapshot is taken at each collection.
|
||||
If, instead, a signal name or number is given (one of SIGUSR1, SIGUSR2 and
|
||||
SIGPROF, remembering that SIGPROF is not compatible with the statistical
|
||||
profiler), a garbage collection is forced and a snapshot is taken every
|
||||
time the signal is received.
|
||||
Heap profiling also enables full allocation profiling (with call stacks),
|
||||
and each allocation can be related to its corresponding object in the
|
||||
snapshots, enabling investigations like "find all objects of a given class
|
||||
allocated by a given method and still live at a given collection, and then
|
||||
find all objects referencing them".
|
||||
|
||||
.PP
|
||||
Then you would need to invoke the decoder \fImprof-decoder(1)\fR
|
||||
on the output file to see the profiling results.
|
||||
on the output file to see the profiling results, or to examine heap
|
||||
snapshots and allocations in detail \fImprof-heap-viewer(1)\fR.
|
||||
|
||||
.PP
|
||||
These are all the available oprions, organized by category:
|
||||
The operating modes described above are the default ones, and are sufficient
|
||||
to use the profiler.
|
||||
.PP
|
||||
To further customize the profiler behavior there are more options, described
|
||||
below.
|
||||
These options can be individually enabled and disabled prefixing them with
|
||||
an (optional) '+' character or a '-' character.
|
||||
For instance, the "allocations" option by default records also the full call
|
||||
stack at each allocation.
|
||||
If only the caller is wanted, one should use "allocations,-save-allocation-stack",
|
||||
or to disable call tracking completely (making the profiler less intrusive)
|
||||
"allocations,-save-allocation-caller,-save-allocation-stack".
|
||||
In practice the "allocation" option by default behaves like
|
||||
"allocations,save-allocation-caller,save-allocation-stack", but the user can
|
||||
tune this to his needs.
|
||||
.PP
|
||||
These are all the available options, organized by category:
|
||||
.PP
|
||||
\fBExecution profiling modes\fR
|
||||
.RS
|
||||
@@ -618,18 +656,20 @@ will use the stack data).
|
||||
.TP
|
||||
\fIallocations\fR, \fIalloc\fR or \fIa\fR
|
||||
Collect information about each allocation (object class and size).
|
||||
If combined with the "ts" option, for each allocation the profiler will
|
||||
also show the responsible method (and also correctly dintinguish allocations
|
||||
performed during JIT time).
|
||||
These information are also available when combining the "a" and "c" options,
|
||||
but since "c" is much more intrusive "ts" should be preferred.
|
||||
By default this also implies "+save-allocation-caller" and
|
||||
"+save-allocation-stack".
|
||||
.TP
|
||||
\fIsave-allocation-caller\fR, \fIsac\fR
|
||||
Save the direct caller of each allocation. The profiler filters out wrapper
|
||||
methods, and also recognizes if the allocation has been performed by the
|
||||
runtime while jitting a method.
|
||||
.TP
|
||||
\fIsave-allocation-stack\fR, \fIsas\fR
|
||||
Save the execution stack at each allocation. While the "ts" option saves the
|
||||
direct caller, this one records the whole stack trace. Note that for technical
|
||||
reasons the decoder will correctly ignore wrapper methods only using the data
|
||||
saved by the "ts" option (the stack traces still contain all the wrappers).
|
||||
Anyway the "ts" and "sas" options can be combined, and the decoder will
|
||||
Save the full managed execution stack at each allocation.
|
||||
While the "sac" option saves the direct caller, this one records the whole
|
||||
stack trace.
|
||||
Note that in the call stack the wrapper methods are not filtered out.
|
||||
Anyway the "sac" and "sas" options can be combined, and the decoder will
|
||||
attribute the allocation to the correct method even if the wrapper is at the
|
||||
top of the stack trace.
|
||||
.TP
|
||||
|
||||
-162
@@ -1,162 +0,0 @@
|
||||
.TH vbnc 1 "21 February 2006"
|
||||
.SH NAME
|
||||
vbnc \- Mono Visual Basic Compiler.
|
||||
.SH SYNOPSIS
|
||||
.B vbnc
|
||||
[option] [source-files]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I (vbnc)
|
||||
is a CIL compiler for the VisualBasic.NET language.
|
||||
.PP
|
||||
Applications developed on Windows with vbc can execute on Mono and applications
|
||||
compiled with 'vbnc' can be executed on .NET runtime.
|
||||
.PP
|
||||
The Mono Visual Basic compiler accepts the same options as
|
||||
the Microsoft VB.NET compiler. Those options can start with a slash or a
|
||||
dash (/checked is the same as -checked).
|
||||
.PP
|
||||
Visual Basic.NET source files normally ends with a ".vb" extension.
|
||||
Compilation of VB.NET source code requires all the files that make
|
||||
up a library, module or executable to be provided on the command line.
|
||||
There is no support for partial compilation. To achieve the benefits
|
||||
of partial compilation, you should compile programs into their own
|
||||
assemblies, and later reference them with the "-r" flag.
|
||||
.PP
|
||||
The Mono Basic compiler generates images (.exe files) that contain
|
||||
CIL byte code that can be executed by any system that implements a Common
|
||||
Language Infrastructure virtual machine such as the Microsoft .NET
|
||||
runtime engine on Windows or the Mono runtime engine on Unix systems.
|
||||
Executables are not bound to a specific CPU or operating system.
|
||||
.PP
|
||||
The Mono Basic compiler by default only references these assemblies:
|
||||
mscorlib.dll, Microsoft.VisualBasic.dll, System.dll and System.Xml.dll.
|
||||
If you want to reference extra libraries you must manually specify
|
||||
them using the the -r: command line option.
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I \-addmodule:MODULE1[,MODULE2]
|
||||
Includes the specified modules in the resulting assembly.
|
||||
.TP
|
||||
.I -codepage:ID
|
||||
Specifies the code page used to process the input files from the
|
||||
point it is specified on. By default files will be processed in the
|
||||
current code page. The compiler will also automatically detect
|
||||
Unicode/UTF8 files that have an embedded byte mark at the beginning.
|
||||
.TP
|
||||
Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
|
||||
.TP
|
||||
.I \-define:SYMLIST, -d:SYMLIST
|
||||
Defines the symbol listed by the semi-colon separeted list SYMLIST
|
||||
SYMBOL. This can be tested in the source code by the pre-processor,
|
||||
or can be used by methods that have been tagged with the Conditional
|
||||
attribute.
|
||||
.TP
|
||||
.I \-debug:AMOUNT
|
||||
Specify the amount of debugging information to emit. Possible values for
|
||||
AMOUNT are "full" and "pdbonly".
|
||||
.TP
|
||||
.I \-imports:import-list
|
||||
Declare global Imports for listed namespaces.
|
||||
.TP
|
||||
.I \-ignorewarn:XXXX
|
||||
Ignores warning number XXXX.
|
||||
.TP
|
||||
.I -lib:PATHLIST, -libpath:PATHLIST
|
||||
Each path specified in the comma-separated list will direct the
|
||||
compiler to look for libraries in that specified path.
|
||||
.TP
|
||||
.I \-main:CLASS
|
||||
Tells the compiler which CLASS or MODULE contains the entry point. Useful when
|
||||
you are compiling several classes with a Main method.
|
||||
.TP
|
||||
.I \-nologo
|
||||
Suppress printing copyright information on startup.
|
||||
.TP
|
||||
.I \-nostdlib, -nostdlib+
|
||||
Use this flag if you want to compile the core library. This makes the
|
||||
compiler load its internal types from the assembly being compiled.
|
||||
.TP
|
||||
.I \-noconfig, \-noconfig+
|
||||
Disables the default compiler configuration to be loaded. The
|
||||
compiler by default has references to the system assemblies.
|
||||
.TP
|
||||
.I \-nowarn
|
||||
Makes the compiler ignore warnings.
|
||||
.TP
|
||||
.I \-optioncompare:binary, \-optioncompare:text
|
||||
Select between binary and text string comparisons. The default is binary
|
||||
string comparisons.
|
||||
.TP
|
||||
.I \-optionexplicit[+|-]
|
||||
Require explicit declaration of variables
|
||||
.TP
|
||||
.I \-optionstrict[+|-]
|
||||
Enforce strict language semantics
|
||||
.TP
|
||||
.I \-out:FNAME, -o FNAME
|
||||
Names the output file to be generated.
|
||||
.TP
|
||||
.I -q -quiet
|
||||
Commands the compiler to show only error messages for syntax-related errors
|
||||
and warnings.
|
||||
.TP
|
||||
.I -resource:RESOURCE[,ID]
|
||||
Embeds to the given resource file. The optional ID can be used to
|
||||
give a different name to the resource. If not specified, the resource
|
||||
name will be the file name.
|
||||
.TP
|
||||
.I -linkresource:RESOURCE[,ID]
|
||||
Links to the specified RESOURCE. The optional ID can be used to give
|
||||
a name to the linked resource.
|
||||
.TP
|
||||
.I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
|
||||
Reference the named assemblies. Use this to use classes from the named
|
||||
assembly in your program. The assembly will be loaded from either the
|
||||
system directory where all the assemblies live, or from the path
|
||||
explicitly given with the -L option.
|
||||
.PP
|
||||
You can also use a semicolon to separate the assemblies instead of a
|
||||
comma.
|
||||
.TP
|
||||
.I \-removeintchecks[+|-]
|
||||
Remove integer checks. Default off.
|
||||
.TP
|
||||
.I \-rootnamespace:namespace
|
||||
Specifies the root namespace for all type declarations
|
||||
.TP
|
||||
.I \-target:KIND, \-t:KIND
|
||||
Used to specify the desired target. The possible values are: exe
|
||||
(plain executable), winexe (Windows.Forms executable), library
|
||||
(component libraries) and module (partial library).
|
||||
.TP
|
||||
.I \-utf8output[+|-]
|
||||
Emit compiler output in UTF8 character encoding. Currently ignored.
|
||||
.TP
|
||||
.I \-\-version
|
||||
Shows the compiler version.
|
||||
.TP
|
||||
.I \-warnaserror, \-warnaserror+
|
||||
Treat warnings as errors.
|
||||
.SH STABILITY
|
||||
As of early 2007, the Mono Visual Basic compiler is still considered preview
|
||||
software. The compiler is almost feature-complete (targeting the Microsoft
|
||||
Visual Basic 8 compiler), only lacking support for the 'My' namespace.
|
||||
Frequent crashes are still occuring, especially with incorrect code.
|
||||
.PP
|
||||
.SH AUTHORS
|
||||
See the ChangeLog for authors
|
||||
.PP
|
||||
.SH LICENSE
|
||||
The Mono Visual Basic compiler is released under the terms of the GNU LGPL.
|
||||
Alternative licenses are available from Novell.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
mcs(1), mono(1), mint(1), sn(1)
|
||||
.PP
|
||||
.SH BUGS
|
||||
To report bugs in the compiler, you can file bug reports in our
|
||||
bug tracking system: http://bugzilla.ximian.com.
|
||||
.SH MAILING LIST
|
||||
The Mono Basic Mailing List is available at: [email protected]
|
||||
@@ -1,3 +1,10 @@
|
||||
2008-11-18 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs/Makefile: Don't build mono-file-formats.*, mono-tools.*
|
||||
* docs/mono-file-formats.config, docs/mono-file-formats.source,
|
||||
docs/mono-tools.config, docs/mono-tools.source: Removed (now located
|
||||
in mono/docs).
|
||||
|
||||
2008-11-02 Jonathan Pryor <[email protected]>
|
||||
|
||||
* docs/Makefile (MONO_DIRS): Add Mono.Simd.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
* System.Windows.Forms.dll.resources: Removed unused dialog-*.png images.
|
||||
|
||||
2008-09-18 Mike Gorse <<[email protected]>
|
||||
2008-09-18 Mike Gorse <[email protected]>
|
||||
|
||||
* System.Windows.Forms.dll.sources: Added IKeyFilter.cs.
|
||||
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
2008-11-30 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* GroupBoxRenderer.cs: Fix when VisualStyles disabled:
|
||||
- No caption text is drawn because Color.Empty is used.
|
||||
- Fix top and height off by 1.
|
||||
[Fixes bug #448764]
|
||||
|
||||
2008-11-24 Jonathan Pobst <[email protected]>
|
||||
|
||||
* Form.cs: Don't change min/max size if it is empty.
|
||||
[Fixes bug #447873]
|
||||
|
||||
2008-11-21 Jonathan Pobst <[email protected]>
|
||||
|
||||
* XPlatUI.cs: Take new Platform.MacOSX into account.
|
||||
[Fixes bug #447663]
|
||||
|
||||
2008-11-20 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ComboBox.cs: Call HideWindow instead of Hide when closing the dropdown
|
||||
through DroppedDown so the proper events get called and state gets reset.
|
||||
[Fixes bug #446805]
|
||||
|
||||
2008-11-10 Jonathan Pobst <[email protected]>
|
||||
|
||||
* TextControl.cs: Add some order of operation to our math so
|
||||
|
||||
@@ -509,7 +509,7 @@ namespace System.Windows.Forms
|
||||
if (value)
|
||||
DropDownListBox ();
|
||||
else
|
||||
listbox_ctrl.Hide ();
|
||||
listbox_ctrl.HideWindow ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2765,4 +2765,4 @@ namespace System.Windows.Forms
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -891,10 +891,12 @@ namespace System.Windows.Forms {
|
||||
maximum_size = value;
|
||||
|
||||
// If this is smaller than the min, adjust the min
|
||||
if (maximum_size.Width <= minimum_size.Width)
|
||||
minimum_size.Width = maximum_size.Width;
|
||||
if (maximum_size.Height <= minimum_size.Height)
|
||||
minimum_size.Height = maximum_size.Height;
|
||||
if (!minimum_size.IsEmpty) {
|
||||
if (maximum_size.Width <= minimum_size.Width)
|
||||
minimum_size.Width = maximum_size.Width;
|
||||
if (maximum_size.Height <= minimum_size.Height)
|
||||
minimum_size.Height = maximum_size.Height;
|
||||
}
|
||||
|
||||
OnMaximumSizeChanged(EventArgs.Empty);
|
||||
if (IsHandleCreated) {
|
||||
@@ -1077,11 +1079,13 @@ namespace System.Windows.Forms {
|
||||
minimum_size = value;
|
||||
|
||||
// If this is bigger than the max, adjust the max
|
||||
if (minimum_size.Width >= maximum_size.Width)
|
||||
maximum_size.Width = minimum_size.Width;
|
||||
if (minimum_size.Height >= maximum_size.Height)
|
||||
maximum_size.Height = minimum_size.Height;
|
||||
|
||||
if (!maximum_size.IsEmpty) {
|
||||
if (minimum_size.Width >= maximum_size.Width)
|
||||
maximum_size.Width = minimum_size.Width;
|
||||
if (minimum_size.Height >= maximum_size.Height)
|
||||
maximum_size.Height = minimum_size.Height;
|
||||
}
|
||||
|
||||
if ((Size.Width < value.Width) || (Size.Height < value.Height)) {
|
||||
Size = new Size(Math.Max(Size.Width, value.Width), Math.Max(Size.Height, value.Height));
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace System.Windows.Forms
|
||||
// part of the bounds as height, they use it as the bottom, so the boxes are drawn in completely different
|
||||
// places. Rather than emulate this bug, we do it correctly. After googling for a while, I don't think
|
||||
// anyone has ever actually used this class for anything, so it should be fine. :)
|
||||
Rectangle new_bounds = new Rectangle (bounds.Left, bounds.Top + (int)(font_size.Height / 2) - 1, bounds.Width, bounds.Height - (int)(font_size.Height / 2) + 1);
|
||||
Rectangle new_bounds = new Rectangle (bounds.Left, bounds.Top + (int)(font_size.Height / 2), bounds.Width, bounds.Height - (int)(font_size.Height / 2));
|
||||
|
||||
// Don't paint over the background where we are going to put the text
|
||||
Region old_clip = g.Clip;
|
||||
@@ -109,8 +109,11 @@ namespace System.Windows.Forms
|
||||
|
||||
g.Clip = old_clip;
|
||||
|
||||
if (groupBoxText != String.Empty)
|
||||
if (groupBoxText != String.Empty) {
|
||||
if (textColor == Color.Empty)
|
||||
textColor = SystemColors.ControlText;
|
||||
TextRenderer.DrawText (g, groupBoxText, font, new Point (bounds.Left + 8, bounds.Top), textColor, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace System.Windows.Forms {
|
||||
public static bool RunningOnUnix {
|
||||
get {
|
||||
#if NET_2_0
|
||||
return (Environment.OSVersion.Platform == PlatformID.Unix);
|
||||
return (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX);
|
||||
#else
|
||||
int platform = (int) Environment.OSVersion.Platform;
|
||||
return (platform == 128);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-11-23 Jonathan Pobst <[email protected]>
|
||||
|
||||
* FormTest.cs: Add test for bug #447873.
|
||||
|
||||
2008-11-07 Jonathan Pobst <[email protected]>
|
||||
|
||||
* DefaultLayoutTest.cs: Add some tests from Jonathan Anderson
|
||||
|
||||
@@ -2327,6 +2327,20 @@ namespace MonoTests.System.Windows.Forms
|
||||
|
||||
f.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MinSizeIssue ()
|
||||
{
|
||||
Form f = new Form ();
|
||||
|
||||
f.MinimumSize = new Size (100, 100);
|
||||
|
||||
f.Show ();
|
||||
|
||||
Assert.AreEqual (new Size (300, 300), f.Size, "A1");
|
||||
|
||||
f.Dispose ();
|
||||
}
|
||||
|
||||
[Test] // Bug #81582
|
||||
[Category ("NotWorking")]
|
||||
|
||||
@@ -116,7 +116,13 @@ namespace Cairo {
|
||||
{
|
||||
get { return NativeMethods.cairo_pattern_status (pattern); }
|
||||
}
|
||||
|
||||
|
||||
public Extend Extend
|
||||
{
|
||||
get { return NativeMethods.cairo_pattern_get_extend (pattern); }
|
||||
set { NativeMethods.cairo_pattern_set_extend (pattern, value); }
|
||||
}
|
||||
|
||||
public Matrix Matrix {
|
||||
set {
|
||||
NativeMethods.cairo_pattern_set_matrix (pattern, value);
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2008-12-08 Zoltan Varga <[email protected]>
|
||||
|
||||
Backport of r120995.
|
||||
|
||||
* SQLite3.cs: Avoid IntPtr.ToInt32 () to convert between IntPtr's and integers
|
||||
since it is not 64 bit safe. Fixes #457038.
|
||||
|
||||
2008-07-06 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* SqliteDataSourceEnumerator.cs: Replace a few Type.GetType by typeof
|
||||
|
||||
@@ -472,9 +472,11 @@ namespace Mono.Data.Sqlite
|
||||
if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart;
|
||||
if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;
|
||||
|
||||
if (nCopied > 0)
|
||||
Marshal.Copy((IntPtr)(ptr.ToInt32() + nDataOffset), bDest, nStart, nCopied);
|
||||
else nCopied = 0;
|
||||
unsafe {
|
||||
if (nCopied > 0)
|
||||
Marshal.Copy((IntPtr)((byte*)ptr + nDataOffset), bDest, nStart, nCopied);
|
||||
else nCopied = 0;
|
||||
}
|
||||
|
||||
return nCopied;
|
||||
}
|
||||
@@ -551,9 +553,11 @@ namespace Mono.Data.Sqlite
|
||||
if (nCopied + nStart > bDest.Length) nCopied = bDest.Length - nStart;
|
||||
if (nCopied + nDataOffset > nlen) nCopied = nlen - nDataOffset;
|
||||
|
||||
if (nCopied > 0)
|
||||
Marshal.Copy((IntPtr)(ptr.ToInt32() + nDataOffset), bDest, nStart, nCopied);
|
||||
else nCopied = 0;
|
||||
unsafe {
|
||||
if (nCopied > 0)
|
||||
Marshal.Copy((IntPtr)((byte*)ptr + nDataOffset), bDest, nStart, nCopied);
|
||||
else nCopied = 0;
|
||||
}
|
||||
|
||||
return nCopied;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
|
||||
2008-12-05 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Tds70.cs: support parameter names with or without a leading '@'.
|
||||
|
||||
2008-11-13 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* TdsComm.cs (ResetConnection, IsConnected): Added a property and
|
||||
method. IsConnected will check for any connection-reset occurrance
|
||||
from other end-point of the underlying socket. ResetConnection
|
||||
adds the "reset" bit in the Status flag field of packet header.
|
||||
Set socket option to keep alive, whereever supported and also, let
|
||||
the socket close along with the underlying stream.
|
||||
|
||||
* Tds70.cs (Reset): Use the new ResetConnection property instead
|
||||
of executing sp_reset_connection. Saves a round-trip.
|
||||
|
||||
2008-11-11 Gert Driesen <[email protected]>
|
||||
|
||||
* Tds70.cs: Support writing negative (small)money values. Added
|
||||
overflow check for smallmoney values. Fixes bug #428139.
|
||||
* Tds.cs: Fixed reading negative (small)money values.
|
||||
|
||||
2008-11-09 Gert Driesen <[email protected]>
|
||||
|
||||
* TdsConnectionPool.cs: Added TdsConnectionPoolManager.GetConnection
|
||||
|
||||
@@ -1139,12 +1139,23 @@ namespace Mono.Data.Tds.Protocol
|
||||
}
|
||||
|
||||
switch (len) {
|
||||
case 4:
|
||||
return new Decimal (Comm.GetTdsInt (), 0, 0, false, 4);
|
||||
case 4: {
|
||||
int val = Comm.GetTdsInt ();
|
||||
bool negative = val < 0;
|
||||
if (negative)
|
||||
val = ~(val - 1);
|
||||
return new Decimal (val, 0, 0, negative, 4);
|
||||
}
|
||||
case 8:
|
||||
int hi = Comm.GetTdsInt ();
|
||||
int lo = Comm.GetTdsInt ();
|
||||
return new Decimal (lo, hi, 0, false, 4);
|
||||
bool negative = hi < 0;
|
||||
|
||||
if (negative) {
|
||||
hi = ~hi;
|
||||
lo = ~(lo - 1);
|
||||
}
|
||||
return new Decimal (lo, hi, 0, negative, 4);
|
||||
default:
|
||||
return DBNull.Value;
|
||||
}
|
||||
|
||||
@@ -33,10 +33,12 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using Mono.Security.Protocol.Ntlm;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
using Mono.Security.Protocol.Ntlm;
|
||||
|
||||
namespace Mono.Data.Tds.Protocol
|
||||
{
|
||||
public sealed class Tds70 : Tds
|
||||
@@ -44,6 +46,8 @@ namespace Mono.Data.Tds.Protocol
|
||||
#region Fields
|
||||
|
||||
public readonly static TdsVersion Version = TdsVersion.tds70;
|
||||
static readonly decimal SMALLMONEY_MIN = -214748.3648m;
|
||||
static readonly decimal SMALLMONEY_MAX = 214748.3647m;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -79,14 +83,15 @@ namespace Mono.Data.Tds.Protocol
|
||||
|
||||
StringBuilder result = new StringBuilder ();
|
||||
foreach (TdsMetaParameter p in Parameters) {
|
||||
string includeAt = "@";
|
||||
if (p.ParameterName [0] == '@')
|
||||
includeAt = string.Empty;
|
||||
string parameterName = p.ParameterName;
|
||||
if (parameterName [0] == '@') {
|
||||
parameterName = parameterName.Substring (1);
|
||||
}
|
||||
if (p.Direction != TdsParameterDirection.ReturnValue) {
|
||||
if (result.Length > 0)
|
||||
result.Append (", ");
|
||||
if (p.Direction == TdsParameterDirection.InputOutput)
|
||||
result.Append (String.Format("{0}{1}={1} output", includeAt, p.ParameterName));
|
||||
result.AppendFormat ("@{0}={0} output", parameterName);
|
||||
else
|
||||
result.Append (FormatParameter (p));
|
||||
}
|
||||
@@ -355,21 +360,13 @@ namespace Mono.Data.Tds.Protocol
|
||||
{
|
||||
// Check validity of the connection - a false removes
|
||||
// the connection from the pool
|
||||
if (!Comm.stream.CanWrite)
|
||||
// NOTE: MS implementation will throw a connection-reset error as it will
|
||||
// try to use the same connection
|
||||
if (!Comm.IsConnected ())
|
||||
return false;
|
||||
|
||||
try {
|
||||
ExecProc ("sp_reset_connection");
|
||||
base.Reset ();
|
||||
} catch (Exception e) {
|
||||
System.Reflection.PropertyInfo pinfo = e.GetType ().GetProperty ("Class");
|
||||
if (pinfo != null && pinfo.PropertyType == typeof (byte)) {
|
||||
byte klass = (byte) pinfo.GetValue (e, null);
|
||||
// 11 to 16 indicates error that can be fixed by the user such as 'Invalid object name'
|
||||
if (klass < 11 || klass > 16)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Set "reset-connection" bit for the next message packet
|
||||
Comm.ResetConnection = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -400,8 +397,14 @@ namespace Mono.Data.Tds.Protocol
|
||||
foreach (TdsMetaParameter param in parameters) {
|
||||
if (param.Direction == TdsParameterDirection.ReturnValue)
|
||||
continue;
|
||||
Comm.Append ( (byte) param.ParameterName.Length );
|
||||
Comm.Append (param.ParameterName);
|
||||
string pname = param.ParameterName;
|
||||
if (pname != null && pname.Length > 0 && pname [0] == '@') {
|
||||
Comm.Append ( (byte) pname.Length);
|
||||
Comm.Append (pname);
|
||||
} else {
|
||||
Comm.Append ( (byte) (pname.Length + 1));
|
||||
Comm.Append ("@" + pname);
|
||||
}
|
||||
short status = 0; // unused
|
||||
if (param.Direction != TdsParameterDirection.Input)
|
||||
status |= 0x01; // output
|
||||
@@ -463,13 +466,30 @@ namespace Mono.Data.Tds.Protocol
|
||||
case "money" : {
|
||||
Decimal val = (decimal) param.Value;
|
||||
int[] arr = Decimal.GetBits (val);
|
||||
int sign = (val>0 ? 1: -1);
|
||||
Comm.Append (sign * arr[1]);
|
||||
Comm.Append (sign * arr[0]);
|
||||
|
||||
if (val >= 0) {
|
||||
Comm.Append (arr[1]);
|
||||
Comm.Append (arr[0]);
|
||||
} else {
|
||||
Comm.Append (~arr[1]);
|
||||
Comm.Append (~arr[0] + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "smallmoney": {
|
||||
Decimal val = (decimal) param.Value;
|
||||
if (val < SMALLMONEY_MIN || val > SMALLMONEY_MAX)
|
||||
throw new OverflowException (string.Format (
|
||||
CultureInfo.InvariantCulture,
|
||||
"Value '{0}' is not valid for SmallMoney."
|
||||
+ " Must be between {1:N4} and {2:N4}.",
|
||||
#if NET_2_0
|
||||
val,
|
||||
#else
|
||||
val.ToString (CultureInfo.CurrentCulture),
|
||||
#endif
|
||||
SMALLMONEY_MIN, SMALLMONEY_MAX));
|
||||
|
||||
int[] arr = Decimal.GetBits (val);
|
||||
int sign = (val>0 ? 1: -1);
|
||||
Comm.Append (sign * arr[0]);
|
||||
@@ -512,11 +532,12 @@ namespace Mono.Data.Tds.Protocol
|
||||
|
||||
private string FormatParameter (TdsMetaParameter parameter)
|
||||
{
|
||||
string includeAt = "@";
|
||||
if (parameter.ParameterName [0] == '@')
|
||||
includeAt = string.Empty;
|
||||
string parameterName = parameter.ParameterName;
|
||||
if (parameterName [0] == '@') {
|
||||
parameterName = parameterName.Substring (1);
|
||||
}
|
||||
if (parameter.Direction == TdsParameterDirection.Output)
|
||||
return String.Format ("{0}{1}={1} output", includeAt, parameter.ParameterName);
|
||||
return String.Format ("@{0}={0} output", parameterName);
|
||||
if (parameter.Value == null || parameter.Value == DBNull.Value)
|
||||
return parameter.ParameterName + "=NULL";
|
||||
|
||||
@@ -573,7 +594,7 @@ namespace Mono.Data.Tds.Protocol
|
||||
break;
|
||||
}
|
||||
|
||||
return includeAt + parameter.ParameterName + "=" + value;
|
||||
return "@" + parameterName + "=" + value;
|
||||
}
|
||||
|
||||
public override string Prepare (string commandText, TdsMetaParameterCollection parameters)
|
||||
|
||||
@@ -39,9 +39,10 @@ namespace Mono.Data.Tds.Protocol {
|
||||
{
|
||||
#region Fields
|
||||
|
||||
internal NetworkStream stream;
|
||||
NetworkStream stream;
|
||||
int packetSize;
|
||||
TdsPacketType packetType = TdsPacketType.None;
|
||||
bool connReset;
|
||||
Encoding encoder;
|
||||
|
||||
string dataSource;
|
||||
@@ -112,7 +113,16 @@ namespace Mono.Data.Tds.Protocol {
|
||||
else if (timeout > 0 && !connected.WaitOne ())
|
||||
throw Tds.CreateTimeoutException (dataSource, "Open()");
|
||||
|
||||
stream = new NetworkStream (socket);
|
||||
try {
|
||||
// MS sets these socket option
|
||||
socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
|
||||
} catch (SocketException se) {
|
||||
// Some platform may throw an exception, so
|
||||
// eat all socket exception, yeaowww!
|
||||
}
|
||||
|
||||
// Let the stream own the socket and take the pleasure of closing it
|
||||
stream = new NetworkStream (socket, true);
|
||||
} catch (SocketException e) {
|
||||
throw new TdsInternalException ("Server does not exist or connection refused.", e);
|
||||
}
|
||||
@@ -327,9 +337,15 @@ namespace Mono.Data.Tds.Protocol {
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
connReset = false;
|
||||
stream.Close ();
|
||||
}
|
||||
|
||||
public bool IsConnected ()
|
||||
{
|
||||
return !(socket.Poll (0, SelectMode.SelectRead) && socket.Available == 0);
|
||||
}
|
||||
|
||||
private void ConnectCallback (IAsyncResult ar)
|
||||
{
|
||||
Socket s = (Socket) ar.AsyncState;
|
||||
@@ -550,19 +566,32 @@ namespace Mono.Data.Tds.Protocol {
|
||||
}
|
||||
}
|
||||
|
||||
public bool ResetConnection {
|
||||
get { return connReset; }
|
||||
set { connReset = value; }
|
||||
}
|
||||
|
||||
public void SendPacket ()
|
||||
{
|
||||
// Reset connection flag is only valid for SQLBatch/RPC/DTC messages
|
||||
if (packetType != TdsPacketType.Query && packetType != TdsPacketType.RPC)
|
||||
connReset = false;
|
||||
|
||||
SendPhysicalPacket (true);
|
||||
nextOutBufferIndex = 0;
|
||||
packetType = TdsPacketType.None;
|
||||
// Reset connection-reset flag to false - as any exception would anyway close
|
||||
// the whole connection
|
||||
connReset = false;
|
||||
}
|
||||
|
||||
private void SendPhysicalPacket (bool isLastSegment)
|
||||
{
|
||||
if (nextOutBufferIndex > headerLength || packetType == TdsPacketType.Cancel) {
|
||||
byte status = (byte) ((isLastSegment ? 0x01 : 0x00) | (connReset ? 0x08 : 0x00));
|
||||
// packet type
|
||||
Store (0, (byte) packetType);
|
||||
Store (1, (byte) (isLastSegment ? 1 : 0));
|
||||
Store (1, status);
|
||||
Store (2, (short) nextOutBufferIndex );
|
||||
Store (4, (byte) 0);
|
||||
Store (5, (byte) 0);
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2009-01-07 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* Vector*.cs: Use explicit layout to avoid the runtime
|
||||
miscalculating the size of vector types.
|
||||
|
||||
Backported from trunk.
|
||||
|
||||
2008-11-17 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* Vector2l.cs (CompareGreaterThan): This method requires sse 4.2
|
||||
and 4.1.
|
||||
|
||||
Backported from trunk.
|
||||
|
||||
2008-11-04 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* Vector*.cs: Use a better name for the prefetch
|
||||
|
||||
@@ -29,10 +29,41 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
|
||||
public struct Vector16b
|
||||
{
|
||||
private byte v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
|
||||
[ FieldOffset(0) ]
|
||||
internal byte v0;
|
||||
[ FieldOffset(1) ]
|
||||
internal byte v1;
|
||||
[ FieldOffset(2) ]
|
||||
internal byte v2;
|
||||
[ FieldOffset(3) ]
|
||||
internal byte v3;
|
||||
[ FieldOffset(4) ]
|
||||
internal byte v4;
|
||||
[ FieldOffset(5) ]
|
||||
internal byte v5;
|
||||
[ FieldOffset(6) ]
|
||||
internal byte v6;
|
||||
[ FieldOffset(7) ]
|
||||
internal byte v7;
|
||||
[ FieldOffset(8) ]
|
||||
internal byte v8;
|
||||
[ FieldOffset(9) ]
|
||||
internal byte v9;
|
||||
[ FieldOffset(10) ]
|
||||
internal byte v10;
|
||||
[ FieldOffset(11) ]
|
||||
internal byte v11;
|
||||
[ FieldOffset(12) ]
|
||||
internal byte v12;
|
||||
[ FieldOffset(13) ]
|
||||
internal byte v13;
|
||||
[ FieldOffset(14) ]
|
||||
internal byte v14;
|
||||
[ FieldOffset(15) ]
|
||||
internal byte v15;
|
||||
public Vector16b (byte v0, byte v1, byte v2, byte v3, byte v4, byte v5, byte v6, byte v7, byte v8, byte v9, byte v10, byte v11, byte v12, byte v13, byte v14, byte v15)
|
||||
{
|
||||
this.v0 = v0;
|
||||
|
||||
@@ -29,11 +29,43 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
|
||||
[CLSCompliant(false)]
|
||||
public struct Vector16sb
|
||||
{
|
||||
private sbyte v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
|
||||
[ FieldOffset(0) ]
|
||||
internal sbyte v0;
|
||||
[ FieldOffset(1) ]
|
||||
internal sbyte v1;
|
||||
[ FieldOffset(2) ]
|
||||
internal sbyte v2;
|
||||
[ FieldOffset(3) ]
|
||||
internal sbyte v3;
|
||||
[ FieldOffset(4) ]
|
||||
internal sbyte v4;
|
||||
[ FieldOffset(5) ]
|
||||
internal sbyte v5;
|
||||
[ FieldOffset(6) ]
|
||||
internal sbyte v6;
|
||||
[ FieldOffset(7) ]
|
||||
internal sbyte v7;
|
||||
[ FieldOffset(8) ]
|
||||
internal sbyte v8;
|
||||
[ FieldOffset(9) ]
|
||||
internal sbyte v9;
|
||||
[ FieldOffset(10) ]
|
||||
internal sbyte v10;
|
||||
[ FieldOffset(11) ]
|
||||
internal sbyte v11;
|
||||
[ FieldOffset(12) ]
|
||||
internal sbyte v12;
|
||||
[ FieldOffset(13) ]
|
||||
internal sbyte v13;
|
||||
[ FieldOffset(14) ]
|
||||
internal sbyte v14;
|
||||
[ FieldOffset(15) ]
|
||||
internal sbyte v15;
|
||||
|
||||
public Vector16sb (sbyte v0, sbyte v1, sbyte v2, sbyte v3, sbyte v4, sbyte v5, sbyte v6, sbyte v7, sbyte v8, sbyte v9, sbyte v10, sbyte v11, sbyte v12, sbyte v13, sbyte v14, sbyte v15)
|
||||
{
|
||||
this.v0 = v0;
|
||||
|
||||
@@ -31,11 +31,13 @@ using System.Runtime.InteropServices;
|
||||
namespace Mono.Simd
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
public struct Vector2d
|
||||
{
|
||||
private double x;
|
||||
private double y;
|
||||
[ FieldOffset(0) ]
|
||||
internal double x;
|
||||
[ FieldOffset(8) ]
|
||||
internal double y;
|
||||
|
||||
public double X { get { return x; } set { x = value; } }
|
||||
public double Y { get { return y; } set { y = value; } }
|
||||
|
||||
@@ -29,11 +29,13 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
public struct Vector2l
|
||||
{
|
||||
private long x;
|
||||
private long y;
|
||||
[ FieldOffset(0) ]
|
||||
internal long x;
|
||||
[ FieldOffset(8) ]
|
||||
internal long y;
|
||||
|
||||
public long X { get { return x; } set { x = value; } }
|
||||
public long Y { get { return y; } set { y = value; } }
|
||||
@@ -113,7 +115,7 @@ namespace Mono.Simd
|
||||
return new Vector2l ((long)(v1.x == v2.x ? -1 : 0), (long)(v1.y == v2.y ? -1 : 0));
|
||||
}
|
||||
|
||||
[Acceleration (AccelMode.SSE41)]
|
||||
[Acceleration (AccelMode.SSE42)]
|
||||
public static Vector2l CompareGreaterThan (Vector2l v1, Vector2l v2)
|
||||
{
|
||||
return new Vector2l ((long)(v1.x > v2.x ? -1 : 0), (long)(v1.y > v2.y ? -1 : 0));
|
||||
|
||||
@@ -29,12 +29,14 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
[CLSCompliant(false)]
|
||||
public struct Vector2ul
|
||||
{
|
||||
private ulong x;
|
||||
private ulong y;
|
||||
[ FieldOffset(0) ]
|
||||
internal ulong x;
|
||||
[ FieldOffset(8) ]
|
||||
internal ulong y;
|
||||
|
||||
public ulong X { get { return x; } set { x = value; } }
|
||||
public ulong Y { get { return y; } set { y = value; } }
|
||||
|
||||
@@ -86,13 +86,17 @@ namespace Mono.Simd
|
||||
Replace Shuffle with less bug prone methods
|
||||
*/
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
public struct Vector4f
|
||||
{
|
||||
private float x;
|
||||
private float y;
|
||||
private float z;
|
||||
private float w;
|
||||
[ FieldOffset(0) ]
|
||||
internal float x;
|
||||
[ FieldOffset(4) ]
|
||||
internal float y;
|
||||
[ FieldOffset(8) ]
|
||||
internal float z;
|
||||
[ FieldOffset(12) ]
|
||||
internal float w;
|
||||
|
||||
public float X { get { return x; } set { x = value; } }
|
||||
public float Y { get { return y; } set { y = value; } }
|
||||
|
||||
@@ -29,13 +29,17 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
public struct Vector4i
|
||||
{
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int w;
|
||||
[ FieldOffset(0) ]
|
||||
internal int x;
|
||||
[ FieldOffset(4) ]
|
||||
internal int y;
|
||||
[ FieldOffset(8) ]
|
||||
internal int z;
|
||||
[ FieldOffset(12) ]
|
||||
internal int w;
|
||||
|
||||
public int X { get { return x; } set { x = value; } }
|
||||
public int Y { get { return y; } set { y = value; } }
|
||||
|
||||
@@ -29,14 +29,18 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
[CLSCompliant(false)]
|
||||
public struct Vector4ui
|
||||
{
|
||||
private uint x;
|
||||
private uint y;
|
||||
private uint z;
|
||||
private uint w;
|
||||
[ FieldOffset(0) ]
|
||||
internal uint x;
|
||||
[ FieldOffset(4) ]
|
||||
internal uint y;
|
||||
[ FieldOffset(8) ]
|
||||
internal uint z;
|
||||
[ FieldOffset(12) ]
|
||||
internal uint w;
|
||||
|
||||
public uint X { get { return x; } set { x = value; } }
|
||||
public uint Y { get { return y; } set { y = value; } }
|
||||
|
||||
@@ -29,10 +29,26 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
public struct Vector8s
|
||||
{
|
||||
private short v0, v1, v2, v3, v4, v5, v6, v7;
|
||||
[ FieldOffset(0) ]
|
||||
internal short v0;
|
||||
[ FieldOffset(2) ]
|
||||
internal short v1;
|
||||
[ FieldOffset(4) ]
|
||||
internal short v2;
|
||||
[ FieldOffset(6) ]
|
||||
internal short v3;
|
||||
[ FieldOffset(8) ]
|
||||
internal short v4;
|
||||
[ FieldOffset(10) ]
|
||||
internal short v5;
|
||||
[ FieldOffset(12) ]
|
||||
internal short v6;
|
||||
[ FieldOffset(14) ]
|
||||
internal short v7;
|
||||
|
||||
public Vector8s (short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7)
|
||||
{
|
||||
this.v0 = v0;
|
||||
|
||||
@@ -29,11 +29,27 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Simd
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 0, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
|
||||
[CLSCompliant(false)]
|
||||
public struct Vector8us
|
||||
{
|
||||
private ushort v0, v1, v2, v3, v4, v5, v6, v7;
|
||||
[ FieldOffset(0) ]
|
||||
internal ushort v0;
|
||||
[ FieldOffset(2) ]
|
||||
internal ushort v1;
|
||||
[ FieldOffset(4) ]
|
||||
internal ushort v2;
|
||||
[ FieldOffset(6) ]
|
||||
internal ushort v3;
|
||||
[ FieldOffset(8) ]
|
||||
internal ushort v4;
|
||||
[ FieldOffset(10) ]
|
||||
internal ushort v5;
|
||||
[ FieldOffset(12) ]
|
||||
internal ushort v6;
|
||||
[ FieldOffset(14) ]
|
||||
internal ushort v7;
|
||||
|
||||
public Vector8us (ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7)
|
||||
{
|
||||
this.v0 = v0;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-12-19 Marek Habersack <[email protected]>
|
||||
|
||||
* SettingsMappingManager.cs: make sure _runningOnWindows is set
|
||||
correctly on MacOS/X.
|
||||
|
||||
2008-09-18 Marek Habersack <[email protected]>
|
||||
|
||||
* SettingsMappingManager.cs: take care of a small race condition
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Mono.Web.Util
|
||||
{
|
||||
_mappingFile = Path.Combine (Path.GetDirectoryName (RuntimeEnvironment.SystemConfigurationFile), settingsMapFileName);
|
||||
PlatformID pid = Environment.OSVersion.Platform;
|
||||
_runningOnWindows = ((int) pid != 128 && (int) pid != 4);
|
||||
_runningOnWindows = ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2008-11-21 Andreia Gaita <[email protected]>
|
||||
|
||||
* Mono.Mozilla/DOM/ContentListener.cs: Added (oops)
|
||||
|
||||
2008-11-20 Andreia Gaita <[email protected]>
|
||||
|
||||
* Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: Support script
|
||||
execution directly in the browser object
|
||||
[Backported, r118685]
|
||||
|
||||
2008-11-20 Andreia Gaita <[email protected]>
|
||||
|
||||
* Mono.Mozilla/DOM/Node.cs, Mono.Mozilla/DOM/Window.cs: Fix equality
|
||||
operators
|
||||
[Backported, r118684, r119336]
|
||||
|
||||
2008-11-20 Andreia Gaita <[email protected]>
|
||||
|
||||
* Mono.WebBrowser.dll.sources, Mono.WebBrowser2K5.csproj,
|
||||
Mono.Mozilla/interfaces/nsIURIContentListener.cs,
|
||||
Mono.Mozilla/DOM/ContentListener.cs: New class added to listen for load
|
||||
requests and handle content types
|
||||
* Mono.WebBrowser/IWebBrowser.cs, Mono.Mozilla/WebBrowser.cs: New
|
||||
NavigationRequested event to catch load requests
|
||||
[Backported, r118617]
|
||||
|
||||
2008-11-08 Andreia Gaita <[email protected]>
|
||||
|
||||
* Mono.WebBrowser/Manager.cs: Use new webkit backend if requested. If it
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
//Permission is hereby granted, free of charge, to any person obtaining
|
||||
//a copy of this software and associated documentation files (the
|
||||
//"Software"), to deal in the Software without restriction, including
|
||||
//without limitation the rights to use, copy, modify, merge, publish,
|
||||
//distribute, sublicense, and/or sell copies of the Software, and to
|
||||
//permit persons to whom the Software is furnished to do so, subject to
|
||||
//the following conditions:
|
||||
//
|
||||
//The above copyright notice and this permission notice shall be
|
||||
//included in all copies or substantial portions of the Software.
|
||||
//
|
||||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
//EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
//MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
//NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
//LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
//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) 2008 Novell, Inc.
|
||||
//
|
||||
//Authors:
|
||||
// Andreia Gaita ([email protected])
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using Mono.WebBrowser;
|
||||
|
||||
namespace Mono.Mozilla.DOM
|
||||
{
|
||||
internal class ContentListener : nsIURIContentListener
|
||||
{
|
||||
WebBrowser owner;
|
||||
|
||||
public ContentListener (WebBrowser instance) {
|
||||
owner = instance;
|
||||
|
||||
}
|
||||
|
||||
EventHandlerList events;
|
||||
public EventHandlerList Events {
|
||||
get {
|
||||
if (events == null)
|
||||
events = new EventHandlerList ();
|
||||
return events;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddHandler (NavigationRequestedEventHandler value) {
|
||||
if (Events[WebBrowser.NavigationRequestedEvent] == null) {
|
||||
if (owner.Navigation != null) {
|
||||
nsIWebBrowser browser = (nsIWebBrowser) owner.navigation.navigation;
|
||||
browser.setParentURIContentListener (this);
|
||||
}
|
||||
}
|
||||
Events.AddHandler (WebBrowser.NavigationRequestedEvent, value);
|
||||
}
|
||||
|
||||
public void RemoveHandler (NavigationRequestedEventHandler value) {
|
||||
Events.RemoveHandler (WebBrowser.NavigationRequestedEvent, value);
|
||||
}
|
||||
|
||||
bool nsIURIContentListener.onStartURIOpen (nsIURI aURI)
|
||||
{
|
||||
NavigationRequestedEventHandler eh = (NavigationRequestedEventHandler) (Events[WebBrowser.NavigationRequestedEvent]);
|
||||
if (eh != null) {
|
||||
AsciiString uri = new Mono.Mozilla.AsciiString ("");
|
||||
aURI.getSpec (uri.Handle);
|
||||
NavigationRequestedEventArgs args = new NavigationRequestedEventArgs (uri.ToString ());
|
||||
eh (this, args);
|
||||
return args.Cancel;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool nsIURIContentListener.doContent (string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
nsIRequest aRequest,
|
||||
out nsIStreamListener aContentHandler)
|
||||
{
|
||||
aContentHandler = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool nsIURIContentListener.isPreferred (string aContentType,
|
||||
ref string aDesiredContentType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool nsIURIContentListener.canHandleContent (string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
ref string aDesiredContentType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
[return: MarshalAs (UnmanagedType.Interface)] IntPtr nsIURIContentListener.getLoadCookie ()
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
void nsIURIContentListener.setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
nsIURIContentListener nsIURIContentListener.getParentContentListener ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
void nsIURIContentListener.setParentContentListener (nsIURIContentListener value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,8 +382,12 @@ namespace Mono.Mozilla.DOM
|
||||
|
||||
public static bool operator == (Node left, Node right)
|
||||
{
|
||||
if (left == null || right == null)
|
||||
if ((object)left == (object)right)
|
||||
return true;
|
||||
|
||||
if ((object)left == null || (object)right == null)
|
||||
return false;
|
||||
|
||||
return left.hashcode == right.hashcode;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,8 +182,12 @@ namespace Mono.Mozilla.DOM
|
||||
|
||||
public static bool operator == (Window left, Window right)
|
||||
{
|
||||
if (left == null || right == null)
|
||||
if ((object)left == (object)right)
|
||||
return true;
|
||||
|
||||
if ((object)left == null || (object)right == null)
|
||||
return false;
|
||||
|
||||
return left.hashcode == right.hashcode;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,15 @@ namespace Mono.Mozilla
|
||||
return events;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Mono.Mozilla.DOM.ContentListener contentListener;
|
||||
Mono.Mozilla.DOM.ContentListener ContentListener {
|
||||
get {
|
||||
if (contentListener == null)
|
||||
contentListener = new Mono.Mozilla.DOM.ContentListener (this);
|
||||
return contentListener;
|
||||
}
|
||||
}
|
||||
|
||||
nsIServiceManager servMan;
|
||||
internal nsIServiceManager ServiceManager {
|
||||
@@ -294,7 +302,10 @@ namespace Mono.Mozilla
|
||||
stream.closeStream ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void ExecuteScript (string script) {
|
||||
Base.EvalScript (this, script);
|
||||
}
|
||||
|
||||
internal void AttachEvent (INode node, string eve, EventHandler handler) {
|
||||
string key = String.Intern (node.GetHashCode() + ":" + eve);
|
||||
@@ -342,6 +353,7 @@ namespace Mono.Mozilla
|
||||
internal static object ProgressEvent = new object ();
|
||||
internal static object ContextMenuEvent = new object ();
|
||||
|
||||
internal static object NavigationRequestedEvent = new object ();
|
||||
|
||||
public event NodeEventHandler KeyDown
|
||||
{
|
||||
@@ -467,6 +479,12 @@ namespace Mono.Mozilla
|
||||
remove { Events.RemoveHandler (ContextMenuEvent, value); }
|
||||
}
|
||||
|
||||
public event NavigationRequestedEventHandler NavigationRequested
|
||||
{
|
||||
add { ContentListener.AddHandler (value); }
|
||||
remove { ContentListener.RemoveHandler (value); }
|
||||
}
|
||||
|
||||
internal static object GenericEvent = new object ();
|
||||
internal event EventHandler Generic
|
||||
{
|
||||
@@ -475,7 +493,5 @@ namespace Mono.Mozilla
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,47 +38,35 @@ namespace Mono.Mozilla {
|
||||
internal interface nsIURIContentListener {
|
||||
|
||||
#region nsIURIContentListener
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int onStartURIOpen (
|
||||
[MarshalAs (UnmanagedType.Interface)] nsIURI aURI, out bool ret);
|
||||
bool onStartURIOpen ([MarshalAs (UnmanagedType.Interface)] nsIURI aURI);
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int doContent (
|
||||
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
|
||||
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler, out bool ret);
|
||||
bool doContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
|
||||
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler);
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int isPreferred (
|
||||
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType, out bool ret);
|
||||
bool isPreferred ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType);
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int canHandleContent (
|
||||
[MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType, out bool ret);
|
||||
bool canHandleContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType);
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int getLoadCookie ( out IntPtr ret);
|
||||
[return: MarshalAs (UnmanagedType.Interface)] IntPtr getLoadCookie ();
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int setLoadCookie ( IntPtr value);
|
||||
void setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value);
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int getParentContentListener ([MarshalAs (UnmanagedType.Interface)] out nsIURIContentListener ret);
|
||||
[return: MarshalAs (UnmanagedType.Interface)] nsIURIContentListener getParentContentListener ();
|
||||
|
||||
[PreserveSigAttribute]
|
||||
[MethodImpl (MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
int setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value);
|
||||
void setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -92,3 +80,76 @@ namespace Mono.Mozilla {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if example
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
internal class URIContentListener : nsIURIContentListener {
|
||||
|
||||
#region nsIURIContentListener
|
||||
bool nsIURIContentListener.onStartURIOpen ([MarshalAs (UnmanagedType.Interface)] nsIURI aURI)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool nsIURIContentListener.doContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.Interface)] nsIRequest aRequest,
|
||||
[MarshalAs (UnmanagedType.Interface)] out nsIStreamListener aContentHandler)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool nsIURIContentListener.isPreferred ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool nsIURIContentListener.canHandleContent ([MarshalAs (UnmanagedType.LPStr)] string aContentType,
|
||||
bool aIsContentPreferred,
|
||||
[MarshalAs (UnmanagedType.LPStr)] ref string aDesiredContentType)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[return: MarshalAs (UnmanagedType.Interface)] IntPtr nsIURIContentListener.getLoadCookie ()
|
||||
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
void nsIURIContentListener.setLoadCookie ([MarshalAs (UnmanagedType.Interface)] IntPtr value)
|
||||
|
||||
|
||||
{
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
||||
[return: MarshalAs (UnmanagedType.Interface)] nsIURIContentListener nsIURIContentListener.getParentContentListener ()
|
||||
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
void nsIURIContentListener.setParentContentListener ([MarshalAs (UnmanagedType.Interface)] nsIURIContentListener value)
|
||||
|
||||
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
@@ -3,6 +3,7 @@ Assembly/AssemblyInfo.cs
|
||||
Mono.Mozilla/AsciiString.cs
|
||||
Mono.Mozilla/Base.cs
|
||||
Mono.Mozilla/Callback.cs
|
||||
Mono.Mozilla/DOM/ContentListener.cs
|
||||
Mono.Mozilla/DOM/DocumentEncoder.cs
|
||||
Mono.Mozilla/DOM/DocumentType.cs
|
||||
Mono.Mozilla/DOM/DOMImplementation.cs
|
||||
|
||||
@@ -61,6 +61,8 @@ namespace Mono.WebBrowser
|
||||
void Render (byte[] data);
|
||||
void Render (string html);
|
||||
void Render (string html, string uri, string contentType);
|
||||
|
||||
void ExecuteScript (string script);
|
||||
|
||||
bool Initialized { get; }
|
||||
IWindow Window { get; }
|
||||
@@ -96,6 +98,8 @@ namespace Mono.WebBrowser
|
||||
event SecurityChangedEventHandler SecurityChanged;
|
||||
|
||||
event ContextMenuEventHandler ContextMenuShown;
|
||||
|
||||
event NavigationRequestedEventHandler NavigationRequested;
|
||||
}
|
||||
|
||||
public enum ReloadOption : uint
|
||||
@@ -409,6 +413,17 @@ namespace Mono.WebBrowser
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void NavigationRequestedEventHandler (object sender, NavigationRequestedEventArgs e);
|
||||
public class NavigationRequestedEventArgs : System.ComponentModel.CancelEventArgs {
|
||||
private string uri;
|
||||
public string Uri {
|
||||
get {return uri;}
|
||||
}
|
||||
public NavigationRequestedEventArgs (string uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -82,6 +82,7 @@
|
||||
<Compile Include="Mono.Mozilla\AsciiString.cs" />
|
||||
<Compile Include="Mono.Mozilla\Base.cs" />
|
||||
<Compile Include="Mono.Mozilla\Callback.cs" />
|
||||
<Compile Include="Mono.Mozilla\DOM\ContentListener.cs" />
|
||||
<Compile Include="Mono.Mozilla\DOM\DocumentEncoder.cs" />
|
||||
<Compile Include="Mono.Mozilla\DOM\DocumentType.cs" />
|
||||
<Compile Include="Mono.Mozilla\DOM\DOMImplementation.cs" />
|
||||
|
||||
@@ -21,8 +21,6 @@ LIB_MCS_FLAGS = \
|
||||
$(RESX_RES:%=/res:%)
|
||||
endif
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
RESULTCODE_MESSAGES = Novell.Directory.Ldap.Utilclass/ResultCodeMessages.resources
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-12-20 Jeroen Asselman <[email protected]>
|
||||
|
||||
* Connection.cs: Apply patch from #436775, there is no need to
|
||||
free the semaphores both in the catch clauses as well as the
|
||||
finally clause.
|
||||
|
||||
2006-12-28 Jon Larimer <[email protected]>
|
||||
|
||||
* Connection.cs: Add a try/finally section to release the
|
||||
|
||||
@@ -813,7 +813,6 @@ namespace Novell.Directory.Ldap
|
||||
catch (System.Net.Sockets.SocketException se)
|
||||
{
|
||||
// Unable to connect to server host:port
|
||||
freeWriteSemaphore(semId);
|
||||
sock = null;
|
||||
socket = null;
|
||||
throw new LdapException(ExceptionMessages.CONNECTION_ERROR, new System.Object[] { host, port }, LdapException.CONNECT_ERROR, null, se);
|
||||
@@ -821,7 +820,6 @@ namespace Novell.Directory.Ldap
|
||||
catch (System.IO.IOException ioe)
|
||||
{
|
||||
// Unable to connect to server host:port
|
||||
freeWriteSemaphore(semId);
|
||||
sock = null;
|
||||
socket = null;
|
||||
throw new LdapException(ExceptionMessages.CONNECTION_ERROR, new System.Object[]{host, port}, LdapException.CONNECT_ERROR, null, ioe);
|
||||
|
||||
@@ -81,4 +81,5 @@ System.Security.Cryptography/SHA512Cng.cs
|
||||
System.Security.Cryptography/SHA512CryptoServiceProvider.cs
|
||||
System.Threading/LockRecursionException.cs
|
||||
System.Threading/LockRecursionPolicy.cs
|
||||
System.Threading/ReaderWriterLockSlim.cs
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
//
|
||||
// System.Threading.ReaderWriterLockSlim.cs
|
||||
//
|
||||
// Authors:
|
||||
// Miguel de Icaza ([email protected])
|
||||
// Dick Porter ([email protected])
|
||||
// Jackson Harper ([email protected])
|
||||
// Lluis Sanchez Gual ([email protected])
|
||||
// Marek Safar ([email protected])
|
||||
//
|
||||
// Copyright 2004-2008 Novell, Inc (http://www.novell.com)
|
||||
// Copyright 2003, Ximian, Inc.
|
||||
//
|
||||
// NoRecursion code based on the blog post from Vance Morrison:
|
||||
// http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx
|
||||
//
|
||||
// Recursion code based on Mono's implementation of ReaderWriterLock.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Permissions;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Threading {
|
||||
|
||||
//
|
||||
// This implementation is based on the light-weight
|
||||
// Reader/Writer lock sample from Vance Morrison's blog:
|
||||
//
|
||||
// http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx
|
||||
//
|
||||
// And in Mono's ReaderWriterLock
|
||||
//
|
||||
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
|
||||
[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)]
|
||||
public class ReaderWriterLockSlim : IDisposable {
|
||||
// Are we on a multiprocessor?
|
||||
static readonly bool smp;
|
||||
|
||||
// Lock specifiation for myLock: This lock protects exactly the local fields associted
|
||||
// instance of MyReaderWriterLock. It does NOT protect the memory associted with the
|
||||
// the events that hang off this lock (eg writeEvent, readEvent upgradeEvent).
|
||||
int myLock;
|
||||
|
||||
// Who owns the lock owners > 0 => readers
|
||||
// owners = -1 means there is one writer, Owners must be >= -1.
|
||||
int owners;
|
||||
Thread upgradable_thread;
|
||||
|
||||
// These variables allow use to avoid Setting events (which is expensive) if we don't have to.
|
||||
uint numWriteWaiters; // maximum number of threads that can be doing a WaitOne on the writeEvent
|
||||
uint numReadWaiters; // maximum number of threads that can be doing a WaitOne on the readEvent
|
||||
uint numUpgradeWaiters; // maximum number of threads that can be doing a WaitOne on the upgradeEvent (at most 1).
|
||||
|
||||
// conditions we wait on.
|
||||
EventWaitHandle writeEvent; // threads waiting to aquire a write lock go here.
|
||||
EventWaitHandle readEvent; // threads waiting to aquire a read lock go here (will be released in bulk)
|
||||
EventWaitHandle upgradeEvent; // thread waiting to upgrade a read lock to a write lock go here (at most one)
|
||||
|
||||
//int lock_owner;
|
||||
|
||||
// Only set if we are a recursive lock
|
||||
//Dictionary<int,int> reader_locks;
|
||||
|
||||
readonly LockRecursionPolicy recursionPolicy;
|
||||
bool is_disposed;
|
||||
|
||||
static ReaderWriterLockSlim ()
|
||||
{
|
||||
smp = Environment.ProcessorCount > 1;
|
||||
}
|
||||
|
||||
public ReaderWriterLockSlim ()
|
||||
{
|
||||
// NoRecursion (0) is the default value
|
||||
}
|
||||
|
||||
public ReaderWriterLockSlim (LockRecursionPolicy recursionPolicy)
|
||||
{
|
||||
this.recursionPolicy = recursionPolicy;
|
||||
|
||||
if (recursionPolicy != LockRecursionPolicy.NoRecursion){
|
||||
//reader_locks = new Dictionary<int,int> ();
|
||||
throw new NotImplementedException ("recursionPolicy != NoRecursion not currently implemented");
|
||||
}
|
||||
}
|
||||
|
||||
public void EnterReadLock ()
|
||||
{
|
||||
TryEnterReadLock (-1);
|
||||
}
|
||||
|
||||
public bool TryEnterReadLock (int millisecondsTimeout)
|
||||
{
|
||||
if (millisecondsTimeout < Timeout.Infinite)
|
||||
throw new ArgumentOutOfRangeException ("millisecondsTimeout");
|
||||
|
||||
if (is_disposed)
|
||||
throw new ObjectDisposedException (null);
|
||||
|
||||
EnterMyLock ();
|
||||
|
||||
while (true){
|
||||
// Easy case, no contention
|
||||
// owners >= 0 means there might be readers (but no writer)
|
||||
if (owners >= 0 && numWriteWaiters == 0){
|
||||
owners++;
|
||||
break;
|
||||
}
|
||||
|
||||
// If the request is to probe.
|
||||
if (millisecondsTimeout == 0){
|
||||
ExitMyLock ();
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to wait. Mark that we have waiters and wait.
|
||||
if (readEvent == null) {
|
||||
LazyCreateEvent (ref readEvent, false);
|
||||
// since we left the lock, start over.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!WaitOnEvent (readEvent, ref numReadWaiters, millisecondsTimeout))
|
||||
return false;
|
||||
}
|
||||
ExitMyLock ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryEnterReadLock (TimeSpan timeout)
|
||||
{
|
||||
int ms = CheckTimeout (timeout);
|
||||
return TryEnterReadLock (ms);
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: What to do if we are releasing a ReadLock and we do not own it?
|
||||
//
|
||||
public void ExitReadLock ()
|
||||
{
|
||||
EnterMyLock ();
|
||||
Debug.Assert(owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken");
|
||||
--owners;
|
||||
ExitAndWakeUpAppropriateWaiters ();
|
||||
}
|
||||
|
||||
public void EnterWriteLock ()
|
||||
{
|
||||
TryEnterWriteLock (-1);
|
||||
}
|
||||
|
||||
public bool TryEnterWriteLock (int millisecondsTimeout)
|
||||
{
|
||||
EnterMyLock ();
|
||||
|
||||
while (true){
|
||||
// There is no contention, we are done
|
||||
if (owners == 0){
|
||||
// Indicate that we have a writer
|
||||
owners = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
// If we are the thread that took the Upgradable read lock
|
||||
if (owners == 1 && upgradable_thread == Thread.CurrentThread){
|
||||
owners = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
// If the request is to probe.
|
||||
if (millisecondsTimeout == 0){
|
||||
ExitMyLock ();
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to wait, figure out what kind of waiting.
|
||||
|
||||
if (upgradable_thread == Thread.CurrentThread){
|
||||
// We are the upgradable thread, register our interest.
|
||||
|
||||
if (upgradeEvent == null){
|
||||
LazyCreateEvent (ref upgradeEvent, false);
|
||||
|
||||
// since we left the lock, start over.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (numUpgradeWaiters > 0){
|
||||
ExitMyLock ();
|
||||
throw new ApplicationException ("Upgrading lock to writer lock already in process, deadlock");
|
||||
}
|
||||
|
||||
if (!WaitOnEvent (upgradeEvent, ref numUpgradeWaiters, millisecondsTimeout))
|
||||
return false;
|
||||
} else {
|
||||
if (writeEvent == null){
|
||||
LazyCreateEvent (ref writeEvent, true);
|
||||
|
||||
// since we left the lock, retry
|
||||
continue;
|
||||
}
|
||||
if (!WaitOnEvent (writeEvent, ref numWriteWaiters, millisecondsTimeout))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Assert (owners == -1, "Owners is not -1");
|
||||
ExitMyLock ();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryEnterWriteLock (TimeSpan timeout)
|
||||
{
|
||||
return TryEnterWriteLock (CheckTimeout (timeout));
|
||||
}
|
||||
|
||||
public void ExitWriteLock ()
|
||||
{
|
||||
EnterMyLock ();
|
||||
Debug.Assert (owners == -1, "Calling ReleaseWriterLock when no write lock is held");
|
||||
Debug.Assert (numUpgradeWaiters > 0);
|
||||
upgradable_thread = null;
|
||||
owners = 0;
|
||||
ExitAndWakeUpAppropriateWaiters ();
|
||||
}
|
||||
|
||||
public void EnterUpgradeableReadLock ()
|
||||
{
|
||||
TryEnterUpgradeableReadLock (-1);
|
||||
}
|
||||
|
||||
//
|
||||
// Taking the Upgradable read lock is like taking a read lock
|
||||
// but we limit it to a single upgradable at a time.
|
||||
//
|
||||
public bool TryEnterUpgradeableReadLock (int millisecondsTimeout)
|
||||
{
|
||||
EnterMyLock ();
|
||||
while (true){
|
||||
if (owners == 0 && numWriteWaiters == 0 && upgradable_thread == null){
|
||||
owners++;
|
||||
upgradable_thread = Thread.CurrentThread;
|
||||
break;
|
||||
}
|
||||
|
||||
// If the request is to probe
|
||||
if (millisecondsTimeout == 0){
|
||||
ExitMyLock ();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (readEvent == null){
|
||||
LazyCreateEvent (ref readEvent, false);
|
||||
// since we left the lock, start over.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!WaitOnEvent (readEvent, ref numReadWaiters, millisecondsTimeout))
|
||||
return false;
|
||||
}
|
||||
|
||||
ExitMyLock ();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryEnterUpgradeableReadLock (TimeSpan timeout)
|
||||
{
|
||||
return TryEnterUpgradeableReadLock (CheckTimeout (timeout));
|
||||
}
|
||||
|
||||
public void ExitUpgradeableReadLock ()
|
||||
{
|
||||
EnterMyLock ();
|
||||
Debug.Assert (owners > 0, "Releasing an upgradable lock, but there was no reader!");
|
||||
--owners;
|
||||
upgradable_thread = null;
|
||||
ExitAndWakeUpAppropriateWaiters ();
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
is_disposed = true;
|
||||
}
|
||||
|
||||
public bool IsReadLockHeld {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public bool IsWriteLockHeld {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public bool IsUpgradeableReadLockHeld {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int CurrentReadCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int RecursiveReadCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int RecursiveUpgradeCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int RecursiveWriteCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int WaitingReadCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int WaitingUpgradeCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public int WaitingWriteCount {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
public LockRecursionPolicy RecursionPolicy {
|
||||
get { return recursionPolicy; }
|
||||
}
|
||||
|
||||
#region Private methods
|
||||
void EnterMyLock ()
|
||||
{
|
||||
if (Interlocked.CompareExchange(ref myLock, 1, 0) != 0)
|
||||
EnterMyLockSpin ();
|
||||
}
|
||||
|
||||
void EnterMyLockSpin ()
|
||||
{
|
||||
|
||||
for (int i = 0; ;i++) {
|
||||
if (i < 3 && smp)
|
||||
Thread.SpinWait (20); // Wait a few dozen instructions to let another processor release lock.
|
||||
else
|
||||
Thread.Sleep (0); // Give up my quantum.
|
||||
|
||||
if (Interlocked.CompareExchange(ref myLock, 1, 0) == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ExitMyLock()
|
||||
{
|
||||
Debug.Assert (myLock != 0, "Exiting spin lock that is not held");
|
||||
myLock = 0;
|
||||
}
|
||||
|
||||
bool MyLockHeld { get { return myLock != 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determines the appropriate events to set, leaves the locks, and sets the events.
|
||||
/// </summary>
|
||||
private void ExitAndWakeUpAppropriateWaiters()
|
||||
{
|
||||
Debug.Assert (MyLockHeld);
|
||||
|
||||
// First a writing thread waiting on being upgraded
|
||||
if (owners == 1 && numUpgradeWaiters != 0){
|
||||
// Exit before signaling to improve efficiency (wakee will need the lock)
|
||||
ExitMyLock ();
|
||||
// release all upgraders (however there can be at most one).
|
||||
upgradeEvent.Set ();
|
||||
//
|
||||
// TODO: What does the following comment mean?
|
||||
// two threads upgrading is a guarenteed deadlock, so we throw in that case.
|
||||
} else if (owners == 0 && numWriteWaiters > 0) {
|
||||
// Exit before signaling to improve efficiency (wakee will need the lock)
|
||||
ExitMyLock ();
|
||||
// release one writer.
|
||||
writeEvent.Set ();
|
||||
}
|
||||
else if (owners >= 0 && numReadWaiters != 0) {
|
||||
// Exit before signaling to improve efficiency (wakee will need the lock)
|
||||
ExitMyLock ();
|
||||
// release all readers.
|
||||
readEvent.Set();
|
||||
} else
|
||||
ExitMyLock();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A routine for lazily creating a event outside the lock (so if errors
|
||||
/// happen they are outside the lock and that we don't do much work
|
||||
/// while holding a spin lock). If all goes well, reenter the lock and
|
||||
/// set 'waitEvent'
|
||||
/// </summary>
|
||||
void LazyCreateEvent(ref EventWaitHandle waitEvent, bool makeAutoResetEvent)
|
||||
{
|
||||
Debug.Assert (MyLockHeld);
|
||||
Debug.Assert (waitEvent == null);
|
||||
|
||||
ExitMyLock ();
|
||||
EventWaitHandle newEvent;
|
||||
if (makeAutoResetEvent)
|
||||
newEvent = new AutoResetEvent (false);
|
||||
else
|
||||
newEvent = new ManualResetEvent (false);
|
||||
|
||||
EnterMyLock ();
|
||||
|
||||
// maybe someone snuck in.
|
||||
if (waitEvent == null)
|
||||
waitEvent = newEvent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Waits on 'waitEvent' with a timeout of 'millisceondsTimeout.
|
||||
/// Before the wait 'numWaiters' is incremented and is restored before leaving this routine.
|
||||
/// </summary>
|
||||
bool WaitOnEvent (EventWaitHandle waitEvent, ref uint numWaiters, int millisecondsTimeout)
|
||||
{
|
||||
Debug.Assert (MyLockHeld);
|
||||
|
||||
waitEvent.Reset ();
|
||||
numWaiters++;
|
||||
|
||||
bool waitSuccessful = false;
|
||||
|
||||
// Do the wait outside of any lock
|
||||
ExitMyLock();
|
||||
try {
|
||||
waitSuccessful = waitEvent.WaitOne (millisecondsTimeout, false);
|
||||
} finally {
|
||||
EnterMyLock ();
|
||||
--numWaiters;
|
||||
if (!waitSuccessful)
|
||||
ExitMyLock ();
|
||||
}
|
||||
return waitSuccessful;
|
||||
}
|
||||
|
||||
static int CheckTimeout (TimeSpan timeout)
|
||||
{
|
||||
try {
|
||||
return checked((int) timeout.TotalMilliseconds);
|
||||
} catch (System.OverflowException) {
|
||||
throw new ArgumentOutOfRangeException ("timeout");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-12-02 Marek Habersack <[email protected]>
|
||||
|
||||
* System.Data.DataSetExtensions_test.dll.sources: added
|
||||
System.Data/DataRowExtensionsTest.cs
|
||||
|
||||
2008-10-17 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Test/Makefile: Add doc-update target support.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
System.Data/DataRowComparerTest.cs
|
||||
System.Data/DataRowExtensionsTest.cs
|
||||
System.Data/DataTableExtensionsTest.cs
|
||||
System.Data/EnumerableRowCollectionTest.cs
|
||||
@@ -1,3 +1,10 @@
|
||||
2008-12-02 Marek Habersack <[email protected]>
|
||||
|
||||
* DataRowExtensions.cs: when Field <T> is specialized on a
|
||||
nullable type (either a reference or an instance of Nullable <T>)
|
||||
do not throw exception for column value being DBNull but return
|
||||
null instead.
|
||||
|
||||
2008-05-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DataTableExtensions.cs :
|
||||
|
||||
@@ -43,8 +43,15 @@ namespace System.Data
|
||||
public static T Field<T> (this DataRow row, int columnIndex, DataRowVersion version)
|
||||
{
|
||||
object ret = row [columnIndex, version];
|
||||
if (ret == DBNull.Value)
|
||||
throw new StrongTypingException ("Cannot get strong typed value since it is DB null.", null);
|
||||
if (ret == DBNull.Value) {
|
||||
Type type = typeof (T);
|
||||
Type genericTypeDef = type.IsGenericType ? type.GetGenericTypeDefinition () : null;
|
||||
if (!type.IsValueType || genericTypeDef != null && genericTypeDef == typeof (Nullable <>))
|
||||
return default (T);
|
||||
|
||||
throw new StrongTypingException ("Cannot get strong typed value since it is DB null. Please use a nullable type.", null);
|
||||
}
|
||||
|
||||
return (T) ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-12-02 Marek Habersack <[email protected]>
|
||||
|
||||
* DataRowExtensionsTest.cs: added
|
||||
|
||||
2008-05-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DataTableExtensionsTest.cs : new test.
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// DataRowExtensionsTest.cs
|
||||
//
|
||||
// Author:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc. http://www.novell.com
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Data
|
||||
{
|
||||
[TestFixture]
|
||||
public class DataRowExtensionsTest
|
||||
{
|
||||
DataRow SetupRow ()
|
||||
{
|
||||
DataTable dt = new DataTable ("TestTable");
|
||||
DataColumn dc = new DataColumn ("Column1", typeof (string));
|
||||
dc.AllowDBNull = true;
|
||||
dt.Columns.Add (dc);
|
||||
|
||||
dc = new DataColumn ("Column2", typeof (int));
|
||||
dc.AllowDBNull = true;
|
||||
dt.Columns.Add (dc);
|
||||
|
||||
DataRow row = dt.NewRow ();
|
||||
dt.Rows.Add (row);
|
||||
return row;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Field_T_DBNullFieldValue ()
|
||||
{
|
||||
DataRow row = SetupRow ();
|
||||
row ["Column1"] = null;
|
||||
row ["Column2"] = DBNull.Value;
|
||||
|
||||
string s = row.Field <string> ("Column1");
|
||||
Assert.AreEqual (null, s, "#A1");
|
||||
|
||||
int? i = row.Field <int?> ("Column2");
|
||||
Assert.AreEqual (null, i, "#A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (StrongTypingException))]
|
||||
public void Field_T_DBNullFieldValue_ValueType ()
|
||||
{
|
||||
DataRow row = SetupRow ();
|
||||
row ["Column1"] = null;
|
||||
row ["Column2"] = DBNull.Value;
|
||||
|
||||
int i = row.Field <int> ("Column2");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,7 +458,7 @@ namespace System.Data.OracleClient.Oci
|
||||
return Decimal.Parse (String.Copy ((string) tmp), formatProvider);
|
||||
break;
|
||||
case OciDataType.TimeStamp:
|
||||
return dateTimeDesc.GetDateTime (Parent.Parent, dateTimeDesc.ErrorHandle);
|
||||
return dateTimeDesc.GetDateTime (conn.Environment, dateTimeDesc.ErrorHandle);
|
||||
case OciDataType.Date:
|
||||
return UnpackDate ();
|
||||
case OciDataType.Raw:
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-12-21 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* System.Data_test.dll.sources: Add the new SqlXmlTest.cs
|
||||
|
||||
2008-08-27 Daniel Morgan <[email protected]>
|
||||
|
||||
* System.Data.SqlClient/SqlConnectionStringBuilder.cs: modified -
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-11-13 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* SqlCommand.cs: Reset connection when timeout occurs.
|
||||
|
||||
2008-11-09 Gert Driesen <[email protected]>
|
||||
|
||||
* SqlConnection.cs (ClearPool): Added null check.
|
||||
|
||||
@@ -453,6 +453,7 @@ namespace System.Data.SqlClient {
|
||||
try {
|
||||
Connection.Tds.ExecProc (sql, localParameters.MetaParameters, 0, true);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
@@ -514,6 +515,7 @@ namespace System.Data.SqlClient {
|
||||
// 2) Somebody has an exclusive lock on Table/DB
|
||||
// In any of these cases, don't close the connection. Let the user do it
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
Connection.Tds.Reset ();
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
@@ -529,6 +531,7 @@ namespace System.Data.SqlClient {
|
||||
try {
|
||||
Connection.Tds.Execute (sql, parms, CommandTimeout, wantResults);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
@@ -541,7 +544,8 @@ namespace System.Data.SqlClient {
|
||||
try {
|
||||
Connection.Tds.ExecPrepared (preparedStatement, parms, CommandTimeout, wantResults);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
@@ -563,6 +567,7 @@ namespace System.Data.SqlClient {
|
||||
Execute (false);
|
||||
result = Connection.Tds.RecordsAffected;
|
||||
} catch (TdsTimeoutException e) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) e);
|
||||
}
|
||||
|
||||
@@ -614,6 +619,7 @@ namespace System.Data.SqlClient {
|
||||
GetOutputParameters ();
|
||||
}
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
@@ -633,6 +639,7 @@ namespace System.Data.SqlClient {
|
||||
try {
|
||||
Execute (true);
|
||||
} catch (TdsTimeoutException e) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) e);
|
||||
}
|
||||
|
||||
@@ -836,6 +843,7 @@ namespace System.Data.SqlClient {
|
||||
callback,
|
||||
state);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
@@ -850,6 +858,7 @@ namespace System.Data.SqlClient {
|
||||
else
|
||||
ar = Connection.Tds.BeginExecuteNonQuery (sql, parms, callback, state);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
@@ -862,6 +871,7 @@ namespace System.Data.SqlClient {
|
||||
try {
|
||||
Connection.Tds.ExecPrepared (preparedStatement, parms, CommandTimeout, wantResults);
|
||||
} catch (TdsTimeoutException ex) {
|
||||
Connection.Tds.Reset ();
|
||||
throw SqlException.FromTdsInternalException ((TdsInternalException) ex);
|
||||
} catch (TdsInternalException ex) {
|
||||
Connection.Close ();
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2008-12-21 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* SqlXml.cs (CreateReader): Better use
|
||||
ConformanceLevel.Fragment while creating the reader as column
|
||||
values are not really Xml documents. Also, throw
|
||||
SqlNullValueException when data is null.
|
||||
(.ctor): Take good care of empty XmlReaders.
|
||||
|
||||
2008-09-24 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* SqlXml.cs (.ctor): Use unicode encoding instead of ASCII.
|
||||
|
||||
@@ -97,8 +97,11 @@ namespace System.Data.SqlTypes
|
||||
notNull = false;
|
||||
xmlValue = null;
|
||||
} else {
|
||||
value.MoveToContent ();
|
||||
xmlValue = value.ReadOuterXml();
|
||||
if (value.Read ()) {
|
||||
value.MoveToContent ();
|
||||
xmlValue = value.ReadOuterXml();
|
||||
} else
|
||||
xmlValue = String.Empty;
|
||||
notNull = true;
|
||||
}
|
||||
}
|
||||
@@ -129,10 +132,12 @@ namespace System.Data.SqlTypes
|
||||
|
||||
public XmlReader CreateReader ()
|
||||
{
|
||||
if (notNull)
|
||||
return XmlTextReader.Create (new StringReader (xmlValue));
|
||||
else
|
||||
return null;
|
||||
if (notNull) {
|
||||
XmlReaderSettings xs = new XmlReaderSettings ();
|
||||
xs.ConformanceLevel = ConformanceLevel.Fragment;
|
||||
return XmlTextReader.Create (new StringReader (xmlValue), xs);
|
||||
} else
|
||||
throw new SqlNullValueException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -14,6 +14,7 @@ System.Data.SqlTypes/SqlDateTimeTest.cs
|
||||
System.Data.SqlTypes/SqlGuidTest.cs
|
||||
System.Data.SqlTypes/SqlDecimalTest.cs
|
||||
System.Data.SqlTypes/SqlStringTest.cs
|
||||
System.Data.SqlTypes/SqlXmlTest.cs
|
||||
System.Xml/XmlDataDocumentTest.cs
|
||||
System.Xml/XmlDataDocumentTest2.cs
|
||||
System.Data/BinarySerializationTest.cs
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2008-11-11 Gert Driesen <[email protected]>
|
||||
|
||||
* SqlCommandTest.cs: Added (SMALL)MONEY rounding tests.
|
||||
|
||||
2008-11-11 Gert Driesen <[email protected]>
|
||||
|
||||
* SqlCommandTest.cs: Added tests for bug #428139. Added test for
|
||||
SMALLMONEY overflows. Added workaround for Assert.AreEqual bug in
|
||||
NUnit v2.2.0.
|
||||
|
||||
2008-11-09 Gert Driesen <[email protected]>
|
||||
|
||||
* SqlConnectionTest.cs: Added tests for ClearPool and ClearAllPools.
|
||||
|
||||
@@ -35,6 +35,9 @@ using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
#if NET_2_0
|
||||
using System.Data.Sql;
|
||||
#endif
|
||||
using System.Globalization;
|
||||
#if NET_2_0
|
||||
using System.Xml;
|
||||
#endif
|
||||
|
||||
@@ -50,6 +53,9 @@ namespace MonoTests.System.Data.SqlClient
|
||||
SqlCommand cmd;
|
||||
string connectionString = ConnectionManager.Singleton.ConnectionString;
|
||||
|
||||
static readonly decimal SMALLMONEY_MAX = 214748.3647m;
|
||||
static readonly decimal SMALLMONEY_MIN = -214748.3648m;
|
||||
|
||||
[TearDown]
|
||||
public void TearDown ()
|
||||
{
|
||||
@@ -1392,7 +1398,9 @@ namespace MonoTests.System.Data.SqlClient
|
||||
cmd.Parameters ["@fname"].Value = TestPar;
|
||||
Assert.AreEqual(1,cmd.ExecuteNonQuery());
|
||||
} finally {
|
||||
DBHelper.ExecuteNonQuery (conn, DROP_TMP_SP_TEMP_INSERT_PERSON);
|
||||
DBHelper.ExecuteNonQuery (conn, string.Format (
|
||||
CultureInfo.InvariantCulture,
|
||||
DROP_STORED_PROCEDURE, "#sp_temp_insert_employee"));
|
||||
DBHelper.ExecuteSimpleSP (conn, "sp_clean_person_table");
|
||||
ConnectionManager.Singleton.CloseConnection ();
|
||||
}
|
||||
@@ -1576,7 +1584,8 @@ namespace MonoTests.System.Data.SqlClient
|
||||
public void StoredProc_ParameterTest ()
|
||||
{
|
||||
string create_query = CREATE_TMP_SP_PARAM_TEST;
|
||||
string drop_query = DROP_TMP_SP_PARAM_TEST;
|
||||
string drop_query = string.Format (CultureInfo.InvariantCulture,
|
||||
DROP_STORED_PROCEDURE, "#tmp_sp_param_test");
|
||||
|
||||
SqlConnection conn = new SqlConnection (connectionString);
|
||||
|
||||
@@ -1669,14 +1678,11 @@ namespace MonoTests.System.Data.SqlClient
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format (create_query, "decimal(10,2)"));
|
||||
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
|
||||
10.665, 10.67, 11);
|
||||
// FIXME: NUnit 2.2.0 bug
|
||||
/*
|
||||
10.665, 10.67m, 11m);
|
||||
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
|
||||
0m, 0m, 0m);
|
||||
*/
|
||||
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
|
||||
-5.657, -5.66m, -6);
|
||||
-5.657, -5.66m, -6m);
|
||||
rpc_helper_function (cmd, SqlDbType.Decimal, 0,
|
||||
DBNull.Value, DBNull.Value,
|
||||
DBNull.Value);
|
||||
@@ -1690,7 +1696,7 @@ namespace MonoTests.System.Data.SqlClient
|
||||
rpc_helper_function (cmd, SqlDbType.Float, 0,
|
||||
10.54, 10.54, 10.54);
|
||||
rpc_helper_function (cmd, SqlDbType.Float, 0,
|
||||
0, 0, 0);
|
||||
0, 0d, 0d);
|
||||
rpc_helper_function (cmd, SqlDbType.Float, 0,
|
||||
-5.34, -5.34, -5.34);
|
||||
rpc_helper_function (cmd, SqlDbType.Float, 0,
|
||||
@@ -1731,22 +1737,68 @@ namespace MonoTests.System.Data.SqlClient
|
||||
// Test Money Param
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format (create_query, "money"));
|
||||
// FIXME: NUnit 2.2.0 bug
|
||||
/*
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
10m, 10m, 10m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
10.54, 10.54m, 10.54m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
0, 0m, 0m);
|
||||
*/
|
||||
/*
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-5.34, -5.34m, -5.34m);
|
||||
*/
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
5.34, 5.34m, 5.34m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-10.1234m, -10.1234m, -10.1234m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
10.1234m, 10.1234m, 10.1234m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-2000000000m, -2000000000m, -2000000000m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
2000000000m, 2000000000m, 2000000000m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.2345m, -200000000.2345m, -200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.2345m, 200000000.2345m, 200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
DBNull.Value, DBNull.Value,
|
||||
DBNull.Value);
|
||||
|
||||
// rounding tests
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234561m, -200000000.2346m, -200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234551m, -200000000.2346m, -200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234541m, -200000000.2345m, -200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234561m, 200000000.2346m, 200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234551m, 200000000.2346m, 200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234541m, 200000000.2345m, 200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234461m, -200000000.2345m, -200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234451m, -200000000.2345m, -200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234441m, -200000000.2344m, -200000000.2344m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234461m, 200000000.2345m, 200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234451m, 200000000.2345m, 200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234441m, 200000000.2344m, 200000000.2344m);
|
||||
// FIXME: we round toward even in SqlParameter.ConvertToFrameworkType
|
||||
/*
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234550m, -200000000.2346m, -200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234550m, 200000000.2346m, 200000000.2346m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
-200000000.234450m, -200000000.2345m, -200000000.2345m);
|
||||
rpc_helper_function (cmd, SqlDbType.Money, 0,
|
||||
200000000.234450m, 200000000.2345m, 200000000.2345m);
|
||||
*/
|
||||
break;
|
||||
case 23 :
|
||||
// Test NChar Param
|
||||
@@ -1797,23 +1849,23 @@ namespace MonoTests.System.Data.SqlClient
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format (create_query, "real"));
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
10m, 10m, 10m);
|
||||
10m, 10f, 10f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
10d, 10m, 10m);
|
||||
10d, 10f, 10f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
0, 0m, 0m);
|
||||
0, 0f, 0f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
3.54d, 3.54m, 3.54m);
|
||||
3.54d, 3.54f, 3.54f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
10, 10m, 10m);
|
||||
10, 10f, 10f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
10.5f, 10.5m, 10.5m);
|
||||
10.5f, 10.5f, 10.5f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
3.5d, 3.5m, 3.5m);
|
||||
3.5d, 3.5f, 3.5f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
4.54m, 4.54m, 4.54m);
|
||||
4.54m, 4.54f, 4.54f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
-4.54m, -4.54m, -4.54m);
|
||||
-4.54m, -4.54f, -4.54f);
|
||||
rpc_helper_function (cmd, SqlDbType.Real, 0,
|
||||
DBNull.Value, DBNull.Value, DBNull.Value);
|
||||
break;
|
||||
@@ -1834,9 +1886,9 @@ namespace MonoTests.System.Data.SqlClient
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format (create_query, "smallint"));
|
||||
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
|
||||
10, 10, 10);
|
||||
10, (short) 10, (short) 10);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
|
||||
-10, -10, -10);
|
||||
-10, (short) -10, (short) -10);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallInt, 0,
|
||||
short.MaxValue, short.MaxValue,
|
||||
short.MaxValue);
|
||||
@@ -1851,8 +1903,6 @@ namespace MonoTests.System.Data.SqlClient
|
||||
// Test SmallMoney Param
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format (create_query, "smallmoney"));
|
||||
// FIXME: NUnit 2.2.0 bug
|
||||
/*
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
10.0d, 10m, 10m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
@@ -1869,9 +1919,49 @@ namespace MonoTests.System.Data.SqlClient
|
||||
4.54m, 4.54m, 4.54m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.54m, -4.54m, -4.54m);
|
||||
*/
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-214748.3648m, -214748.3648m, -214748.3648m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
214748.3647m, 214748.3647m, 214748.3647m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
DBNull.Value, DBNull.Value, DBNull.Value);
|
||||
|
||||
// rounding tests
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543361m, -4.5434m, -4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543351m, -4.5434m, -4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543341m, -4.5433m, -4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543361m, 4.5434m, 4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543351m, 4.5434m, 4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543341m, 4.5433m, 4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543261m, -4.5433m, -4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543251m, -4.5433m, -4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543241m, -4.5432m, -4.5432m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543261m, 4.5433m, 4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543251m, 4.5433m, 4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543241m, 4.5432m, 4.5432m);
|
||||
// FIXME: we round toward even in SqlParameter.ConvertToFrameworkType
|
||||
/*
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543350m, -4.5434m, -4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543350m, 4.5434m, 4.5434m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
-4.543250m, -4.5433m, -4.5433m);
|
||||
rpc_helper_function (cmd, SqlDbType.SmallMoney, 0,
|
||||
4.543250m, 4.5433m, 4.5433m);
|
||||
*/
|
||||
break;
|
||||
case 16 :
|
||||
// Test Text Param
|
||||
@@ -1898,9 +1988,9 @@ namespace MonoTests.System.Data.SqlClient
|
||||
DBHelper.ExecuteNonQuery (conn,
|
||||
String.Format(create_query,"tinyint"));
|
||||
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
|
||||
10.0d, 10m, 10m);
|
||||
10.0d, (byte) 10, (byte) 10);
|
||||
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
|
||||
0, 0, 0);
|
||||
0, (byte) 0, (byte) 0);
|
||||
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
|
||||
byte.MaxValue, byte.MaxValue, byte.MaxValue);
|
||||
rpc_helper_function (cmd, SqlDbType.TinyInt, 0,
|
||||
@@ -1957,9 +2047,9 @@ namespace MonoTests.System.Data.SqlClient
|
||||
label = -2;
|
||||
break;
|
||||
}
|
||||
}catch (AssertionException ex) {
|
||||
} catch (AssertionException ex) {
|
||||
error += String.Format (" Case {0} INCORRECT VALUE : {1}\n", label, ex.ToString ());
|
||||
}catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
error += String.Format (" Case {0} NOT WORKING : {1}\n", label, ex.ToString ());
|
||||
}
|
||||
|
||||
@@ -1997,11 +2087,11 @@ namespace MonoTests.System.Data.SqlClient
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
using (SqlDataReader reader = cmd.ExecuteReader ()) {
|
||||
Assert.IsTrue (reader.Read (), "#1");
|
||||
Assert.AreEqual (expectedRead, reader.GetValue (0), "#2");
|
||||
AreEqual (expectedRead, reader.GetValue (0), "#2");
|
||||
Assert.IsFalse (reader.Read (), "#3");
|
||||
}
|
||||
Assert.AreEqual (expectedOut, param2.Value, "#4");
|
||||
Assert.AreEqual (5, retval.Value, "#5");
|
||||
AreEqual (expectedOut, param2.Value, "#4");
|
||||
AreEqual (5, retval.Value, "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -2140,6 +2230,108 @@ namespace MonoTests.System.Data.SqlClient
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SmallMoney_Overflow_Max ()
|
||||
{
|
||||
conn = new SqlConnection (connectionString);
|
||||
conn.Open ();
|
||||
|
||||
DBHelper.ExecuteNonQuery (conn, string.Format (
|
||||
CultureInfo.InvariantCulture, CREATE_TMP_SP_TYPE_TEST,
|
||||
"SMALLMONEY"));
|
||||
//decimal overflow = 214748.36471m;
|
||||
decimal overflow = 214748.3648m;
|
||||
|
||||
cmd = conn.CreateCommand ();
|
||||
cmd.CommandText = "#tmp_sp_type_test";
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
SqlParameter param = cmd.Parameters.Add ("@param",
|
||||
SqlDbType.SmallMoney);
|
||||
param.Value = overflow;
|
||||
|
||||
try {
|
||||
cmd.ExecuteScalar ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (OverflowException ex) {
|
||||
// SqlDbType.SmallMoney overflow. Value '214748.36471'
|
||||
// is out of range. Must be between -214,748.3648 and 214,748.3647
|
||||
Assert.AreEqual (typeof (OverflowException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
#if NET_2_0
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "'{0}'",
|
||||
overflow)) != -1, "#5:" + ex.Message);
|
||||
#else
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.CurrentCulture, "'{0}'",
|
||||
overflow)) != -1, "#5:" + ex.Message);
|
||||
#endif
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "{0:N4}",
|
||||
SMALLMONEY_MIN)) != -1, "#6:" + ex.Message);
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "{0:N4}",
|
||||
SMALLMONEY_MAX)) != -1, "#7:" + ex.Message);
|
||||
} finally {
|
||||
DBHelper.ExecuteNonQuery (conn, string.Format (
|
||||
CultureInfo.InvariantCulture,
|
||||
DROP_STORED_PROCEDURE, "#tmp_sp_type_test"));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SmallMoney_Overflow_Min ()
|
||||
{
|
||||
conn = new SqlConnection (connectionString);
|
||||
conn.Open ();
|
||||
|
||||
DBHelper.ExecuteNonQuery (conn, string.Format (
|
||||
CultureInfo.InvariantCulture, CREATE_TMP_SP_TYPE_TEST,
|
||||
"SMALLMONEY"));
|
||||
//decimal overflow = -214748.36481m;
|
||||
decimal overflow = -214748.3649m;
|
||||
|
||||
cmd = conn.CreateCommand ();
|
||||
cmd.CommandText = "#tmp_sp_type_test";
|
||||
cmd.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
SqlParameter param = cmd.Parameters.Add ("@param",
|
||||
SqlDbType.SmallMoney);
|
||||
param.Value = overflow;
|
||||
|
||||
try {
|
||||
cmd.ExecuteScalar ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (OverflowException ex) {
|
||||
// SqlDbType.SmallMoney overflow. Value '-214748,36481'
|
||||
// is out of range. Must be between -214,748.3648 and 214,748.3647
|
||||
Assert.AreEqual (typeof (OverflowException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
#if NET_2_0
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "'{0}'",
|
||||
overflow)) != -1, "#5:" + ex.Message);
|
||||
#else
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.CurrentCulture, "'{0}'",
|
||||
overflow)) != -1, "#5:" + ex.Message);
|
||||
#endif
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "{0:N4}",
|
||||
SMALLMONEY_MIN)) != -1, "#6:" + ex.Message);
|
||||
Assert.IsTrue (ex.Message.IndexOf (string.Format (
|
||||
CultureInfo.InvariantCulture, "{0:N4}",
|
||||
SMALLMONEY_MAX)) != -1, "#7:" + ex.Message);
|
||||
} finally {
|
||||
DBHelper.ExecuteNonQuery (conn, string.Format (
|
||||
CultureInfo.InvariantCulture,
|
||||
DROP_STORED_PROCEDURE, "#tmp_sp_type_test"));
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
public void NotificationTest ()
|
||||
@@ -2365,15 +2557,50 @@ namespace MonoTests.System.Data.SqlClient
|
||||
Assert.AreEqual (100, param0Val);
|
||||
}
|
||||
|
||||
// used as workaround for bugs in NUnit 2.2.0
|
||||
static void AreEqual (object x, object y, string msg)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
return;
|
||||
if ((x == null || y == null))
|
||||
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
|
||||
"Expected: {0}, but was: {1}. {2}",
|
||||
x == null ? "<null>" : x, y == null ? "<null>" : y, msg));
|
||||
|
||||
bool isArrayX = x.GetType ().IsArray;
|
||||
bool isArrayY = y.GetType ().IsArray;
|
||||
|
||||
if (isArrayX && isArrayY) {
|
||||
Array arrayX = (Array) x;
|
||||
Array arrayY = (Array) y;
|
||||
|
||||
if (arrayX.Length != arrayY.Length)
|
||||
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
|
||||
"Length of arrays differs. Expected: {0}, but was: {1}. {2}",
|
||||
arrayX.Length, arrayY.Length, msg));
|
||||
|
||||
for (int i = 0; i < arrayX.Length; i++) {
|
||||
object itemX = arrayX.GetValue (i);
|
||||
object itemY = arrayY.GetValue (i);
|
||||
if (!itemX.Equals (itemY))
|
||||
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
|
||||
"Arrays differ at position {0}. Expected: {1}, but was: {2}. {3}",
|
||||
i, itemX, itemY, msg));
|
||||
}
|
||||
} else if (!x.Equals (y)) {
|
||||
throw new AssertionException (string.Format (CultureInfo.InvariantCulture,
|
||||
"Expected: {0} ({1}), but was: {2} ({3}). {4}",
|
||||
x, x.GetType (), y, y.GetType (), msg));
|
||||
}
|
||||
}
|
||||
|
||||
private enum Status
|
||||
{
|
||||
OK = 0,
|
||||
Error = 3
|
||||
}
|
||||
|
||||
private readonly string CREATE_TMP_SP_PARAM_TEST = "create procedure #tmp_sp_param_test (@param1 {0}, @param2 {0} output) as begin select @param1 set @param2=@param1 return 5 end";
|
||||
private readonly string DROP_TMP_SP_PARAM_TEST = "drop procedure #tmp_sp_param_test";
|
||||
|
||||
private static readonly string CREATE_TMP_SP_PARAM_TEST = "create procedure #tmp_sp_param_test (@param1 {0}, @param2 {0} output) as begin select @param1 set @param2=@param1 return 5 end";
|
||||
private readonly string CREATE_TMP_SP_TEMP_INSERT_PERSON = ("create procedure #sp_temp_insert_employee ( " + Environment.NewLine +
|
||||
"@fname varchar (20)) " + Environment.NewLine +
|
||||
"as " + Environment.NewLine +
|
||||
@@ -2384,10 +2611,12 @@ namespace MonoTests.System.Data.SqlClient
|
||||
"insert into employee (id, fname, dob, doj) values (@id, @fname, '1980-02-11', getdate ());" + Environment.NewLine +
|
||||
"return @id;" + Environment.NewLine +
|
||||
"end");
|
||||
|
||||
private readonly string DROP_TMP_SP_TEMP_INSERT_PERSON = ("if exists (select name from sysobjects where " + Environment.NewLine +
|
||||
"name = '#sp_temp_insert_employee' and type = 'P') " + Environment.NewLine +
|
||||
"drop procedure #sp_temp_insert_employee; ");
|
||||
private static readonly string CREATE_TMP_SP_TYPE_TEST =
|
||||
"CREATE PROCEDURE #tmp_sp_type_test " +
|
||||
"(" +
|
||||
" @param {0}" +
|
||||
") AS SELECT @param";
|
||||
private static readonly string DROP_STORED_PROCEDURE =
|
||||
"DROP PROCEDURE {0}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2008-12-22 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* SqlXmlTest.cs: Available only in 2.0 and above
|
||||
|
||||
2008-12-21 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* SqlXmlTest.cs: Tests for SqlXml type. New addition.
|
||||
|
||||
2008-06-12 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SqlBooleanTest.cs : oops, was running wrong test harness. Fixed it.
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
//
|
||||
// SqlXmlTest.cs - NUnit Test Cases for System.Data.SqlTypes.SqlXml
|
||||
//
|
||||
// Authors:
|
||||
// Veerapuram Varadhan ([email protected])
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://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 NUnit.Framework;
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Threading;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.System.Data.SqlTypes
|
||||
{
|
||||
[TestFixture]
|
||||
public class SqlXmlTest
|
||||
{
|
||||
|
||||
[SetUp]
|
||||
public void SetUp ()
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
|
||||
}
|
||||
// Test constructor
|
||||
[Test]
|
||||
public void SqlXml_ctor_StreamTest()
|
||||
{
|
||||
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
|
||||
MemoryStream stream = new MemoryStream (Encoding.Unicode.GetBytes (xmlStr));
|
||||
SqlXml xmlSql = new SqlXml (stream);
|
||||
|
||||
Assert.AreEqual (xmlStr, xmlSql.Value, "#A01");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_ctor_XmlReaderTest()
|
||||
{
|
||||
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
|
||||
XmlReader xrdr = new XmlTextReader (new StringReader (xmlStr));
|
||||
SqlXml xmlSql = new SqlXml (xrdr);
|
||||
|
||||
Assert.AreEqual (xmlStr, xmlSql.Value, "#A02");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_ctor_ZeroLengthStreamTest()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
SqlXml xmlSql = new SqlXml (ms);
|
||||
|
||||
Assert.AreEqual (false, xmlSql.IsNull, "#A03");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_ctor_ZeroLengthXmlReaderTest()
|
||||
{
|
||||
XmlReaderSettings xs = new XmlReaderSettings ();
|
||||
xs.ConformanceLevel = ConformanceLevel.Fragment;
|
||||
XmlReader xrdr = XmlReader.Create (new StringReader (String.Empty), xs);
|
||||
SqlXml xmlSql = new SqlXml (xrdr);
|
||||
|
||||
Assert.AreEqual (false, xmlSql.IsNull, "#A04");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (SqlNullValueException))]
|
||||
public void SqlXml_getValue_ZeroLengthStreamTest()
|
||||
{
|
||||
MemoryStream ms = null;
|
||||
SqlXml xmlSql = new SqlXml (ms);
|
||||
|
||||
string str = xmlSql.Value;
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (SqlNullValueException))]
|
||||
public void SqlXml_getValue_ZeroLengthXmlReaderTest()
|
||||
{
|
||||
XmlReader xrdr = null;
|
||||
SqlXml xmlSql = new SqlXml (xrdr);
|
||||
|
||||
string str = xmlSql.Value;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_fromStream_CreateReaderTest()
|
||||
{
|
||||
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
|
||||
MemoryStream stream = new MemoryStream (Encoding.Unicode.GetBytes (xmlStr));
|
||||
SqlXml xmlSql = new SqlXml (stream);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
xrdr.MoveToContent ();
|
||||
|
||||
Assert.AreEqual (xmlStr, xrdr.ReadOuterXml(), "#A05");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_fromXmlReader_CreateReaderTest()
|
||||
{
|
||||
string xmlStr = "<Employee><FirstName>Varadhan</FirstName><LastName>Veerapuram</LastName></Employee>";
|
||||
XmlReader rdr = new XmlTextReader (new StringReader (xmlStr));
|
||||
SqlXml xmlSql = new SqlXml (rdr);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
xrdr.MoveToContent ();
|
||||
|
||||
Assert.AreEqual (xmlStr, xrdr.ReadOuterXml(), "#A06");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_fromZeroLengthStream_CreateReaderTest()
|
||||
{
|
||||
MemoryStream stream = new MemoryStream ();
|
||||
SqlXml xmlSql = new SqlXml (stream);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
|
||||
Assert.AreEqual (false, xrdr.Read(), "#A07");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SqlXml_fromZeroLengthXmlReader_CreateReaderTest_withFragment()
|
||||
{
|
||||
XmlReaderSettings xs = new XmlReaderSettings ();
|
||||
xs.ConformanceLevel = ConformanceLevel.Fragment;
|
||||
|
||||
XmlReader rdr = XmlReader.Create (new StringReader (String.Empty), xs);
|
||||
SqlXml xmlSql = new SqlXml (rdr);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
|
||||
Assert.AreEqual (false, xrdr.Read(), "#A07");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (XmlException))]
|
||||
public void SqlXml_fromZeroLengthXmlReader_CreateReaderTest()
|
||||
{
|
||||
XmlReader rdr = new XmlTextReader (new StringReader (String.Empty));
|
||||
SqlXml xmlSql = new SqlXml (rdr);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
|
||||
Assert.AreEqual (false, xrdr.Read(), "#A07");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (SqlNullValueException))]
|
||||
public void SqlXml_fromNullStream_CreateReaderTest()
|
||||
{
|
||||
MemoryStream stream = null;
|
||||
SqlXml xmlSql = new SqlXml (stream);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (SqlNullValueException))]
|
||||
public void SqlXml_fromNullXmlReader_CreateReaderTest()
|
||||
{
|
||||
XmlReader rdr = null;
|
||||
SqlXml xmlSql = new SqlXml (rdr);
|
||||
|
||||
XmlReader xrdr = xmlSql.CreateReader ();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-11-21 Andreia Gaita <[email protected]>
|
||||
|
||||
* Metafile.cs: Save the underlying stream when creating from a
|
||||
clone under win32 (fixes #438886)
|
||||
|
||||
2008-10-12 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* ColorPalette.cs, ImageFormat.cs: Remove unneeded field
|
||||
|
||||
@@ -51,6 +51,17 @@ namespace System.Drawing.Imaging {
|
||||
nativeObject = ptr;
|
||||
}
|
||||
|
||||
// Usually called when cloning images that need to have
|
||||
// not only the handle saved, but also the underlying stream
|
||||
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
|
||||
internal Metafile (IntPtr ptr, Stream stream)
|
||||
{
|
||||
// under Win32 stream is owned by SD/GDI+ code
|
||||
if (GDIPlus.RunningOnWindows ())
|
||||
this.stream = stream;
|
||||
nativeObject = ptr;
|
||||
}
|
||||
|
||||
public Metafile (Stream stream)
|
||||
{
|
||||
if (stream == null)
|
||||
|
||||
@@ -64,6 +64,17 @@ namespace System.Drawing
|
||||
nativeObject = ptr;
|
||||
}
|
||||
|
||||
// Usually called when cloning images that need to have
|
||||
// not only the handle saved, but also the underlying stream
|
||||
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
|
||||
internal Bitmap(IntPtr ptr, Stream stream)
|
||||
{
|
||||
// under Win32 stream is owned by SD/GDI+ code
|
||||
if (GDIPlus.RunningOnWindows ())
|
||||
this.stream = stream;
|
||||
nativeObject = ptr;
|
||||
}
|
||||
|
||||
public Bitmap (int width, int height) : this (width, height, PixelFormat.Format32bppArgb)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
2008-11-24 Geoff Norton <[email protected]>
|
||||
|
||||
* gdipFunctions.cs: Ensure that System.Drawing works on the mac as
|
||||
well as unix.
|
||||
|
||||
2008-11-21 Andreia Gaita <[email protected]>
|
||||
|
||||
* Image.cs: On win32, when cloning images initialized from
|
||||
resources, also clone the underlying stream, since it needs to stay
|
||||
around for the life of the image (gdi doesn't clone the underlying
|
||||
stream when cloning images, so when the gc disposes the original, it
|
||||
will also dispose the stream, which invalidates the clone).
|
||||
|
||||
* Bitmap.cs: Save the underlying stream when creating bitmaps from a
|
||||
clone under win32
|
||||
[fixes #438886]
|
||||
|
||||
2008-11-01 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* Font.cs: Add comment on .ctor(Font,FontStyle) about the lack of
|
||||
|
||||
@@ -811,15 +811,43 @@ public abstract class Image : MarshalByRefObject, IDisposable , ICloneable, ISer
|
||||
|
||||
public object Clone ()
|
||||
{
|
||||
if (GDIPlus.RunningOnWindows () && stream != null)
|
||||
return CloneFromStream ();
|
||||
|
||||
IntPtr newimage = IntPtr.Zero;
|
||||
Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);
|
||||
GDIPlus.CheckStatus (status);
|
||||
Status status = GDIPlus.GdipCloneImage (NativeObject, out newimage);
|
||||
GDIPlus.CheckStatus (status);
|
||||
|
||||
if (this is Bitmap)
|
||||
return new Bitmap (newimage);
|
||||
else
|
||||
return new Metafile (newimage);
|
||||
}
|
||||
|
||||
// On win32, when cloning images that were originally created from a stream, we need to
|
||||
// clone both the image and the stream to make sure the gc doesn't kill it
|
||||
// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
|
||||
object CloneFromStream ()
|
||||
{
|
||||
byte[] bytes = new byte [stream.Length];
|
||||
MemoryStream ms = new MemoryStream (bytes);
|
||||
int count = (stream.Length < 4096 ? (int) stream.Length : 4096);
|
||||
byte[] buffer = new byte[count];
|
||||
stream.Position = 0;
|
||||
do {
|
||||
count = stream.Read (buffer, 0, count);
|
||||
ms.Write (buffer, 0, count);
|
||||
} while (count == 4096);
|
||||
|
||||
IntPtr newimage = IntPtr.Zero;
|
||||
newimage = InitFromStream (ms);
|
||||
|
||||
if (this is Bitmap)
|
||||
return new Bitmap (newimage, ms);
|
||||
else
|
||||
return new Metafile (newimage, ms);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,7 +99,7 @@ namespace System.Drawing
|
||||
static GDIPlus ()
|
||||
{
|
||||
int platform = (int) Environment.OSVersion.Platform;
|
||||
if ((platform == 4) || (platform == 128)) {
|
||||
if ((platform == 4) || (platform == 6) || (platform == 128)) {
|
||||
if (Environment.GetEnvironmentVariable ("not_supported_MONO_MWF_USE_NEW_X11_BACKEND") != null || Environment.GetEnvironmentVariable ("MONO_MWF_MAC_FORCE_X11") != null) {
|
||||
UseX11Drawable = true;
|
||||
} else {
|
||||
|
||||
@@ -15,6 +15,8 @@ using System.Threading;
|
||||
namespace MonoTests.System.Transactions {
|
||||
|
||||
[TestFixture]
|
||||
// https://bugzilla.novell.com/show_bug.cgi?id=463999
|
||||
[Category ("NotWorking")]
|
||||
public class AsyncTest {
|
||||
|
||||
[SetUp]
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2009-01-07 Zoltan Varga <[email protected]>
|
||||
|
||||
* AsyncTest.cs: Disable these tests, they fail randomly (bug #463999).
|
||||
|
||||
2007-08-14 Ankit Jain <[email protected]>
|
||||
|
||||
* EnlistTest.cs: Add tests for bug #82423.
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2008-12-05 Marek Habersack <[email protected]>
|
||||
|
||||
* JsonSerializer.cs: StringBuilder extension methods aren't used
|
||||
anymore, changed to calls to static methods in
|
||||
StringBuilderExtensions.
|
||||
|
||||
* StringBuilderExtensions.cs: cannot use extension methods here
|
||||
because this file is also used in the version 1.0 build which
|
||||
doesn't reference System.Core
|
||||
|
||||
2008-10-22 Marek Habersack <[email protected]>
|
||||
|
||||
* JsonDeserializer.cs: object can contain more than one unquoted
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace System.Web.Script.Serialization
|
||||
throw new ArgumentException ("Recursion limit has been exceeded while serializing object of type '{0}'", obj != null ? obj.GetType ().ToString () : "[null]");
|
||||
|
||||
if (obj == null || DBNull.Value.Equals (obj)) {
|
||||
output.AppendCount (maxJsonLength, "null");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace System.Web.Script.Serialization
|
||||
IDictionary <string, object> result = jsc.Serialize (obj, serializer);
|
||||
|
||||
if (result == null) {
|
||||
output.AppendCount (maxJsonLength, "null");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ namespace System.Web.Script.Serialization
|
||||
|
||||
void SerializeArbitraryObject (StringBuilder output, object obj, Type type)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, "{");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
|
||||
|
||||
bool first = true;
|
||||
if (typeResolver != null) {
|
||||
@@ -322,27 +322,27 @@ namespace System.Web.Script.Serialization
|
||||
first = false;
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "}");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
|
||||
}
|
||||
|
||||
void SerializeEnumerable (StringBuilder output, IEnumerable enumerable)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, "[");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "[");
|
||||
bool first = true;
|
||||
foreach (object value in enumerable) {
|
||||
if (!first)
|
||||
output.AppendCount (maxJsonLength, ',');
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, ',');
|
||||
SerializeValue (value, output);
|
||||
if (first)
|
||||
first = false;
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "]");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "]");
|
||||
}
|
||||
|
||||
void SerializeDictionary (StringBuilder output, IDictionary dict)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, "{");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
|
||||
bool first = true;
|
||||
string key;
|
||||
|
||||
@@ -352,12 +352,12 @@ namespace System.Web.Script.Serialization
|
||||
first = false;
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "}");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
|
||||
}
|
||||
|
||||
void SerializeGenericDictionary <TKey, TValue> (StringBuilder output, IDictionary <TKey, TValue> dict)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, "{");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "{");
|
||||
bool first = true;
|
||||
string key;
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace System.Web.Script.Serialization
|
||||
first = false;
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "}");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
|
||||
}
|
||||
|
||||
void WriteDictionaryEntry (StringBuilder output, bool skipComma, string key, object value)
|
||||
@@ -376,10 +376,10 @@ namespace System.Web.Script.Serialization
|
||||
throw new InvalidOperationException ("Only dictionaries with keys convertible to string are supported.");
|
||||
|
||||
if (!skipComma)
|
||||
output.AppendCount (maxJsonLength, ',');
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, ',');
|
||||
|
||||
WriteValue (output, key);
|
||||
output.AppendCount (maxJsonLength, ':');
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, ':');
|
||||
SerializeValue (value, output);
|
||||
}
|
||||
|
||||
@@ -387,35 +387,35 @@ namespace System.Web.Script.Serialization
|
||||
{
|
||||
switch (typeCode) {
|
||||
case TypeCode.SByte:
|
||||
output.AppendCount (maxJsonLength, (sbyte)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (sbyte)value);
|
||||
return;
|
||||
|
||||
case TypeCode.Int16:
|
||||
output.AppendCount (maxJsonLength, (short)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (short)value);
|
||||
return;
|
||||
|
||||
case TypeCode.UInt16:
|
||||
output.AppendCount (maxJsonLength, (ushort)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (ushort)value);
|
||||
return;
|
||||
|
||||
case TypeCode.Int32:
|
||||
output.AppendCount (maxJsonLength, (int)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (int)value);
|
||||
return;
|
||||
|
||||
case TypeCode.Byte:
|
||||
output.AppendCount (maxJsonLength, (byte)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (byte)value);
|
||||
return;
|
||||
|
||||
case TypeCode.UInt32:
|
||||
output.AppendCount (maxJsonLength, (uint)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (uint)value);
|
||||
return;
|
||||
|
||||
case TypeCode.Int64:
|
||||
output.AppendCount (maxJsonLength, (long)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (long)value);
|
||||
return;
|
||||
|
||||
case TypeCode.UInt64:
|
||||
output.AppendCount (maxJsonLength, (ulong)value);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (ulong)value);
|
||||
return;
|
||||
|
||||
default:
|
||||
@@ -425,12 +425,12 @@ namespace System.Web.Script.Serialization
|
||||
|
||||
void WriteValue (StringBuilder output, float value)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, value.ToString ("r"));
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
|
||||
}
|
||||
|
||||
void WriteValue (StringBuilder output, double value)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, value.ToString ("r"));
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString ("r"));
|
||||
}
|
||||
|
||||
void WriteValue (StringBuilder output, Guid value)
|
||||
@@ -451,23 +451,23 @@ namespace System.Web.Script.Serialization
|
||||
value = MinimumJavaScriptDate;
|
||||
|
||||
long ticks = (value.Ticks - InitialJavaScriptDateTicks) / (long)10000;
|
||||
output.AppendCount (maxJsonLength, "\"\\/Date(" + ticks + ")\\/\"");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"\\/Date(" + ticks + ")\\/\"");
|
||||
}
|
||||
|
||||
void WriteValue (StringBuilder output, IConvertible value)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, value.ToString (CultureInfo.InvariantCulture));
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, value.ToString (CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
void WriteValue (StringBuilder output, bool value)
|
||||
{
|
||||
output.AppendCount (maxJsonLength, value ? "true" : "false");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, value ? "true" : "false");
|
||||
}
|
||||
|
||||
void WriteValue (StringBuilder output, char value)
|
||||
{
|
||||
if (value == '\0') {
|
||||
output.AppendCount (maxJsonLength, "null");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -477,11 +477,11 @@ namespace System.Web.Script.Serialization
|
||||
void WriteValue (StringBuilder output, string value)
|
||||
{
|
||||
if (String.IsNullOrEmpty (value)) {
|
||||
output.AppendCount (maxJsonLength, "\"\"");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"\"");
|
||||
return;
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "\"");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"");
|
||||
|
||||
char c;
|
||||
for (int i = 0; i < value.Length; i++) {
|
||||
@@ -489,50 +489,50 @@ namespace System.Web.Script.Serialization
|
||||
|
||||
switch (c) {
|
||||
case '\t':
|
||||
output.AppendCount (maxJsonLength, @"\t");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\t");
|
||||
break;
|
||||
case '\n':
|
||||
output.AppendCount (maxJsonLength, @"\n");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\n");
|
||||
break;
|
||||
case '\r':
|
||||
output.AppendCount (maxJsonLength, @"\r");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\r");
|
||||
break;
|
||||
case '\f':
|
||||
output.AppendCount (maxJsonLength, @"\f");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\f");
|
||||
break;
|
||||
case '\b':
|
||||
output.AppendCount (maxJsonLength, @"\b");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\b");
|
||||
break;
|
||||
case '<':
|
||||
output.AppendCount (maxJsonLength, @"\u003c");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u003c");
|
||||
break;
|
||||
case '>':
|
||||
output.AppendCount (maxJsonLength, @"\u003e");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u003e");
|
||||
break;
|
||||
case '"':
|
||||
output.AppendCount (maxJsonLength, "\\\"");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\\\"");
|
||||
break;
|
||||
case '\'':
|
||||
output.AppendCount (maxJsonLength, @"\u0027");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\u0027");
|
||||
break;
|
||||
case '\\':
|
||||
output.AppendCount (maxJsonLength, @"\\");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, @"\\");
|
||||
break;
|
||||
default:
|
||||
if (c > '\u001f')
|
||||
output.AppendCount (maxJsonLength, c);
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, c);
|
||||
else {
|
||||
output.Append("\\u00");
|
||||
int intVal = (int) c;
|
||||
output.AppendCount (maxJsonLength, (char) ('0' + (intVal >> 4)));
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (char) ('0' + (intVal >> 4)));
|
||||
intVal &= 0xf;
|
||||
output.AppendCount (maxJsonLength, (char) (intVal < 10 ? '0' + intVal : 'a' + (intVal - 10)));
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, (char) (intVal < 10 ? '0' + intVal : 'a' + (intVal - 10)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
output.AppendCount (maxJsonLength, "\"");
|
||||
StringBuilderExtensions.AppendCount (output, maxJsonLength, "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-19
@@ -39,133 +39,133 @@ namespace System.Web.Script.Serialization
|
||||
throw new InvalidOperationException ("Maximum length exceeded.");
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char[] value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char[] value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, string value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, string value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, bool value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, bool value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, byte value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, byte value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, decimal value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, decimal value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, double value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, double value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, short value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, short value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, int value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, int value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, long value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, long value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, object value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, object value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, sbyte value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, sbyte value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, float value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, float value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, ushort value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, ushort value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, uint value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, uint value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, ulong value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, ulong value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char value)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char value)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char value, int repeatCount)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char value, int repeatCount)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value, repeatCount);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, char[] value, int startIndex, int charCount )
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, char[] value, int startIndex, int charCount )
|
||||
{
|
||||
StringBuilder ret = sb.Append (value, startIndex, charCount);
|
||||
CheckCount (sb, maxCount);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static StringBuilder AppendCount (this StringBuilder sb, int maxCount, string value, int startIndex, int count)
|
||||
public static StringBuilder AppendCount (StringBuilder sb, int maxCount, string value, int startIndex, int count)
|
||||
{
|
||||
StringBuilder ret = sb.Append (value, startIndex, count);
|
||||
CheckCount (sb, maxCount);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-12-05 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (LIB_MCS_FLAGS): do not reference System.Core
|
||||
|
||||
2008-09-30 Marek Habersack <[email protected]>
|
||||
|
||||
* System.Web.Extensions_1.0.dll.sources: added
|
||||
|
||||
@@ -34,7 +34,6 @@ LIB_MCS_FLAGS = \
|
||||
-define:SYSTEM_WEB_EXTENSIONS \
|
||||
-r:$(corlib) \
|
||||
-r:System.dll \
|
||||
-r:System.Core.dll \
|
||||
-r:System.Drawing.dll \
|
||||
-r:System.Data.dll \
|
||||
-r:System.Xml.dll \
|
||||
|
||||
@@ -1,3 +1,52 @@
|
||||
2008-12-11 Dean Brettle <[email protected]>
|
||||
|
||||
* System.Web.dll.sources: deleted
|
||||
System.Web.Configuration_2.0/CapabilitiesChecksum.cs
|
||||
|
||||
* Makefile (RESOURCE_FILES_2): deleted
|
||||
System.Web.Configuration_2.0/RandomRoboBotKeywords.txt
|
||||
|
||||
2008-12-03 Marek Habersack <[email protected]>
|
||||
|
||||
* System.Web_test.dll.sources: added System.Web.UI/DataBinderTest.cs
|
||||
|
||||
2008-12-02 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (TEST_RESOURCE_FILES): added
|
||||
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config.1.1
|
||||
|
||||
2008-12-01 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (TEST_RESOURCE_FILES): added
|
||||
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx
|
||||
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master
|
||||
(TEST_MCS_FLAGS): added reference to System.Web.Extensions
|
||||
|
||||
2008-11-25 Marek Habersack <[email protected]>
|
||||
|
||||
* System.Web.dll.sources: added
|
||||
System.Web.Compilation/AspComponent.cs
|
||||
|
||||
2008-11-21 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (TEST_RESOURCE_FILES): added
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind1.aspx
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind2.aspx
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind3.aspx
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind4.aspx
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind1.aspx
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind2.aspx
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind3.aspx
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind4.aspx
|
||||
Test/mainsoft/NunitWebResources/ReadWritePropertyControl.ascx
|
||||
|
||||
* Test/tools/web.config: disabled batch compilation and enabled
|
||||
debugging.
|
||||
|
||||
2008-11-15 Marek Habersack <[email protected]>
|
||||
|
||||
* System.Web.dll.sources: added System.Web.UI/INonBindingContainer.cs
|
||||
|
||||
2008-10-17 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Test/Makefile: Add doc-update target support.
|
||||
|
||||
@@ -64,7 +64,6 @@ RESOURCE_FILES_2 = \
|
||||
resources/transparent.gif \
|
||||
resources/webform.js \
|
||||
resources/WebUIValidation_2.0.js \
|
||||
System.Web.Configuration_2.0/RandomRoboBotKeywords.txt \
|
||||
System.Web.UI.WebControls/GridView.js \
|
||||
System.Web.UI.WebControls/DetailsView.js \
|
||||
System.Web.UI.WebControls/TreeView.js \
|
||||
@@ -80,6 +79,7 @@ TEST_RESOURCE_FILES = \
|
||||
Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx.cs \
|
||||
Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMaster.aspx \
|
||||
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config \
|
||||
Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config.1.1 \
|
||||
Test/mainsoft/NunitWebResources/menuclass.aspx \
|
||||
Test/mainsoft/NunitWebResources/FormView.aspx \
|
||||
Test/mainsoft/NunitWebResources/PostBackMenuTest.aspx \
|
||||
@@ -143,8 +143,20 @@ TEST_RESOURCE_FILES = \
|
||||
Test/mainsoft/NunitWebResources/RedirectOnError.aspx \
|
||||
Test/mainsoft/NunitWebResources/TestCapability.browser \
|
||||
Test/mainsoft/NunitWebResources/PageWithAdapter.aspx \
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind1.aspx \
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind2.aspx \
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind3.aspx \
|
||||
Test/mainsoft/NunitWebResources/InvalidPropertyBind4.aspx \
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind1.aspx \
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind2.aspx \
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind3.aspx \
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind4.aspx \
|
||||
Test/mainsoft/NunitWebResources/ValidPropertyBind5.aspx \
|
||||
Test/mainsoft/NunitWebResources/ReadWritePropertyControl.ascx \
|
||||
Test/mainsoft/MainsoftWebTest/nunitweb_config.xml \
|
||||
Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx
|
||||
Test/mainsoft/NunitWebResources/TemplateControlParsingTest.aspx \
|
||||
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.aspx \
|
||||
Test/mainsoft/NunitWebResources/ContentPlaceHolderInTemplate.master
|
||||
|
||||
RESX_DIST = resources/TranslationResources.resx
|
||||
ifeq (net_2_0, $(PROFILE))
|
||||
@@ -183,6 +195,9 @@ endif
|
||||
endif
|
||||
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,1591 $(NUNIT_RESOURCE_FILES:%=/resource:%)
|
||||
ifeq (net_2_0, $(PROFILE))
|
||||
TEST_MCS_FLAGS += -r:System.Web.Extensions.dll
|
||||
endif
|
||||
|
||||
EXTRA_DISTFILES = $(RESOURCE_FILES_2) $(RESOURCE_FILES_1) $(TEST_RESOURCE_FILES) UplevelHelperDefinitions.xml $(RESX_DIST) \
|
||||
SQLiteProviders_DatabaseSchema.sql
|
||||
|
||||
@@ -107,7 +107,9 @@ namespace System.Web.Caching
|
||||
|
||||
if (it.SlidingExpiration != NoSlidingExpiration) {
|
||||
it.AbsoluteExpiration = DateTime.Now + it.SlidingExpiration;
|
||||
it.Timer.Change ((int)it.SlidingExpiration.TotalMilliseconds, Timeout.Infinite);
|
||||
// Cast to long is ok since we know that sliding expiration
|
||||
// is less than 365 days (31536000000ms)
|
||||
it.Timer.Change ((long)it.SlidingExpiration.TotalMilliseconds, Timeout.Infinite);
|
||||
} else if (DateTime.Now >= it.AbsoluteExpiration) {
|
||||
Remove (key, CacheItemRemovedReason.Expired, false);
|
||||
return null;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2009-01-09 Marek Habersack <[email protected]>
|
||||
|
||||
* Cache.cs: System.Threading.Timer.Change takes a long, not an
|
||||
int. The maximum value of sliding expiration is 365 days
|
||||
(31536000000ms) which fits within the value range of long. The
|
||||
previous cast to int might yield negative values in certain
|
||||
situations which was the reason for bug #464221. Fixes bug #464221
|
||||
|
||||
2008-10-21 Marek Habersack <[email protected]>
|
||||
|
||||
* OutputCacheModule.cs: seal the class.
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// System.Web.Compilation.AspComponentFoundry
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2008 Novell, Inc (http://novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
namespace System.Web.Compilation
|
||||
{
|
||||
internal sealed class AspComponent
|
||||
{
|
||||
public readonly Type Type;
|
||||
public readonly string Prefix;
|
||||
public readonly string Source;
|
||||
public readonly bool FromConfig;
|
||||
public readonly string Namespace;
|
||||
|
||||
public AspComponent (Type type, string ns, string prefix, string source, bool fromConfig)
|
||||
{
|
||||
Type = type;
|
||||
Namespace = ns;
|
||||
Prefix = prefix;
|
||||
Source = source;
|
||||
FromConfig = fromConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,30 @@ namespace System.Web.Compilation
|
||||
internal class AspComponentFoundry
|
||||
{
|
||||
Hashtable foundries;
|
||||
#if NET_2_0
|
||||
Dictionary <string, AspComponent> components;
|
||||
#else
|
||||
Hashtable components;
|
||||
#endif
|
||||
|
||||
#if NET_2_0
|
||||
Dictionary <string, AspComponent> Components {
|
||||
get {
|
||||
if (components == null)
|
||||
components = new Dictionary <string, AspComponent> (StringComparer.OrdinalIgnoreCase);
|
||||
return components;
|
||||
}
|
||||
}
|
||||
#else
|
||||
Hashtable Components {
|
||||
get {
|
||||
if (components == null)
|
||||
components = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant);
|
||||
return components;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public AspComponentFoundry ()
|
||||
{
|
||||
#if NET_2_0
|
||||
@@ -63,42 +86,55 @@ namespace System.Web.Compilation
|
||||
#endif
|
||||
}
|
||||
|
||||
public Type GetComponentType (string foundryName, string tag)
|
||||
public AspComponent GetComponent (string tagName)
|
||||
{
|
||||
string source;
|
||||
bool fromConfig;
|
||||
|
||||
return GetComponentType (foundryName, tag, out source, out fromConfig);
|
||||
}
|
||||
|
||||
public Type GetComponentType (string foundryName, string tag, out string source, out bool fromConfig)
|
||||
{
|
||||
source = null;
|
||||
fromConfig = false;
|
||||
object o = foundries [foundryName];
|
||||
if (tagName == null || tagName.Length == 0)
|
||||
return null;
|
||||
|
||||
if (components != null) {
|
||||
#if NET_2_0
|
||||
AspComponent ret;
|
||||
if (components.TryGetValue (tagName, out ret))
|
||||
return ret;
|
||||
#else
|
||||
if (components.Contains (tagName))
|
||||
return components [tagName] as AspComponent;
|
||||
#endif
|
||||
}
|
||||
|
||||
string foundryName, tag;
|
||||
int colon = tagName.IndexOf (':');
|
||||
if (colon > -1) {
|
||||
if (colon == 0)
|
||||
throw new Exception ("Empty TagPrefix is not valid.");
|
||||
if (colon + 1 == tagName.Length)
|
||||
return null;
|
||||
foundryName = tagName.Substring (0, colon);
|
||||
tag = tagName.Substring (colon + 1);
|
||||
} else {
|
||||
foundryName = String.Empty;
|
||||
tag = tagName;
|
||||
}
|
||||
|
||||
object o = foundries [foundryName];
|
||||
if (o == null)
|
||||
return null;
|
||||
|
||||
Foundry foundry = o as Foundry;
|
||||
if (foundry != null) {
|
||||
fromConfig = foundry.FromConfig;
|
||||
return foundry.GetType (tag, out source);
|
||||
}
|
||||
if (foundry != null)
|
||||
return CreateComponent (foundry, tagName, foundryName, tag);
|
||||
|
||||
ArrayList af = o as ArrayList;
|
||||
if (af == null)
|
||||
return null;
|
||||
|
||||
Type t = null;
|
||||
AspComponent component = null;
|
||||
Exception e = null;
|
||||
foreach (Foundry f in af) {
|
||||
try {
|
||||
t = f.GetType (tag, out source);
|
||||
if (t != null) {
|
||||
fromConfig = f.FromConfig;
|
||||
return t;
|
||||
}
|
||||
component = CreateComponent (f, tagName, foundryName, tag);
|
||||
if (component != null)
|
||||
return component;
|
||||
} catch (Exception ex) {
|
||||
e = ex;
|
||||
}
|
||||
@@ -110,6 +146,25 @@ namespace System.Web.Compilation
|
||||
return null;
|
||||
}
|
||||
|
||||
AspComponent CreateComponent (Foundry foundry, string tagName, string prefix, string tag)
|
||||
{
|
||||
string source, ns;
|
||||
Type type;
|
||||
|
||||
type = foundry.GetType (tag, out source, out ns);
|
||||
if (type == null)
|
||||
return null;
|
||||
|
||||
AspComponent ret = new AspComponent (type, ns, prefix, source, foundry.FromConfig);
|
||||
#if NET_2_0
|
||||
Dictionary <string, AspComponent> components = Components;
|
||||
#else
|
||||
Hashtable components = Components;
|
||||
#endif
|
||||
components.Add (tagName, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void RegisterFoundry (string foundryName, Assembly assembly, string nameSpace)
|
||||
{
|
||||
RegisterFoundry (foundryName, assembly, nameSpace, false);
|
||||
@@ -261,7 +316,7 @@ namespace System.Web.Compilation
|
||||
set { _fromConfig = value; }
|
||||
}
|
||||
|
||||
public abstract Type GetType (string componentName, out string source);
|
||||
public abstract Type GetType (string componentName, out string source, out string ns);
|
||||
}
|
||||
|
||||
|
||||
@@ -290,9 +345,10 @@ namespace System.Web.Compilation
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public override Type GetType (string componentName, out string source)
|
||||
public override Type GetType (string componentName, out string source, out string ns)
|
||||
{
|
||||
source = null;
|
||||
ns = null;
|
||||
if (0 != String.Compare (componentName, tagName, true))
|
||||
return null;
|
||||
|
||||
@@ -370,9 +426,11 @@ namespace System.Web.Compilation
|
||||
}
|
||||
#endif
|
||||
|
||||
public override Type GetType (string componentName, out string source)
|
||||
public override Type GetType (string componentName, out string source, out string ns)
|
||||
{
|
||||
source = null;
|
||||
ns = nameSpace;
|
||||
|
||||
#if NET_2_0
|
||||
if (assembly == null && assemblyName != null)
|
||||
assembly = GetAssemblyByName (assemblyName, true);
|
||||
@@ -469,23 +527,23 @@ namespace System.Web.Compilation
|
||||
tagnames.Add (tagName, foundry);
|
||||
}
|
||||
|
||||
public override Type GetType (string componentName, out string source)
|
||||
public override Type GetType (string componentName, out string source, out string ns)
|
||||
{
|
||||
source = null;
|
||||
ns = null;
|
||||
Type type = null;
|
||||
Foundry foundry = tagnames [componentName] as Foundry;
|
||||
if (foundry != null)
|
||||
return foundry.GetType (componentName, out source);
|
||||
return foundry.GetType (componentName, out source, out ns);
|
||||
|
||||
if (assemblyFoundry != null) {
|
||||
try {
|
||||
type = assemblyFoundry.GetType (componentName, out source);
|
||||
type = assemblyFoundry.GetType (componentName, out source, out ns);
|
||||
return type;
|
||||
} catch { }
|
||||
}
|
||||
|
||||
string msg = String.Format ("Type {0} not registered for prefix {1}",
|
||||
componentName, tagPrefix);
|
||||
string msg = String.Format ("Type {0} not registered for prefix {1}", componentName, tagPrefix);
|
||||
throw new ApplicationException (msg);
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 302 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user