mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
169
Commits
xcode8
...
mono-1-0-6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1eb581e8a | ||
|
|
fd0db3b590 | ||
|
|
5ae7f99470 | ||
|
|
287faa9e56 | ||
|
|
292676010f | ||
|
|
fef2b6723e | ||
|
|
a28363adf9 | ||
|
|
9c7cea69f6 | ||
|
|
c46b58028a | ||
|
|
edaaf203c5 | ||
|
|
b3649da6d8 | ||
|
|
706593bbd2 | ||
|
|
4878c6a2fc | ||
|
|
ff3d755b8b | ||
|
|
96057a1306 | ||
|
|
240f80d6c1 | ||
|
|
bf4c5178a3 | ||
|
|
d430dcb109 | ||
|
|
de3d462b56 | ||
|
|
4b4d4e3294 | ||
|
|
d4f579ab0b | ||
|
|
389b183bc7 | ||
|
|
531e7cd91f | ||
|
|
d3b0c4bd31 | ||
|
|
0998ee74e2 | ||
|
|
8c41b83d93 | ||
|
|
57a42d6d0d | ||
|
|
514ac424f5 | ||
|
|
4f0ea07f3d | ||
|
|
631bb74c09 | ||
|
|
2c20e28f89 | ||
|
|
974b4b8959 | ||
|
|
76f82a15ca | ||
|
|
09e00de01e | ||
|
|
b363a4da0f | ||
|
|
70191fac33 | ||
|
|
331fb64c5a | ||
|
|
8494cbf446 | ||
|
|
e6f5c6fafa | ||
|
|
b7ffe85112 | ||
|
|
5073c9eac4 | ||
|
|
8149ddc0dc | ||
|
|
bef9afa7e0 | ||
|
|
501bff4b28 | ||
|
|
9441155d29 | ||
|
|
388ab08ce7 | ||
|
|
ffdb6bc1b3 | ||
|
|
b9a06db813 | ||
|
|
97007fdaab | ||
|
|
2df4f9497c | ||
|
|
9886f44127 | ||
|
|
6a0c7b72ae | ||
|
|
fa037f5592 | ||
|
|
c632c4a99e | ||
|
|
a17df477d7 | ||
|
|
4e997ec5a9 | ||
|
|
b483058ea3 | ||
|
|
c96297b587 | ||
|
|
d9b6dc6151 | ||
|
|
3f95f8a3ba | ||
|
|
1cede3cba3 | ||
|
|
32a701dc4c | ||
|
|
57b3fe75e0 | ||
|
|
d6400d10a7 | ||
|
|
1a741c2b80 | ||
|
|
15b02a6f60 | ||
|
|
3461853696 | ||
|
|
ef6b6383f2 | ||
|
|
2c8cddad17 | ||
|
|
a4ff149320 | ||
|
|
9a2632e1ef | ||
|
|
b491f84400 | ||
|
|
84b9050333 | ||
|
|
e982daf3c5 | ||
|
|
e1645332ae | ||
|
|
7c30a22d95 | ||
|
|
fdd5c8f1ef | ||
|
|
914a6c7591 | ||
|
|
58ec72cc8e | ||
|
|
16c85760eb | ||
|
|
3257e26217 | ||
|
|
b0d5e6580b | ||
|
|
d1518010c1 | ||
|
|
ecd4a4a91b | ||
|
|
9af5b74c89 | ||
|
|
eb6c6eeb2c | ||
|
|
ebdbaa1a6b | ||
|
|
b80fb16653 | ||
|
|
f11407839d | ||
|
|
fbe08afa0a | ||
|
|
f4741866e0 | ||
|
|
90fb34509f | ||
|
|
3944dabece | ||
|
|
0252a4b423 | ||
|
|
caf2a1cdab | ||
|
|
f8aca10bb8 | ||
|
|
41b5ad6a5e | ||
|
|
6ccf1cf6f7 | ||
|
|
1e4a215c2d | ||
|
|
9d08ee3eb4 | ||
|
|
a0698673af | ||
|
|
a1af0eb692 | ||
|
|
3f13a7d7fa | ||
|
|
9515522172 | ||
|
|
110fdf3ba2 | ||
|
|
e259703198 | ||
|
|
226ae644f9 | ||
|
|
4bc298c411 | ||
|
|
575598549b | ||
|
|
8f2b0ac63e | ||
|
|
fc43c289a7 | ||
|
|
917cfd14e8 | ||
|
|
3f313cb9ec | ||
|
|
8848992453 | ||
|
|
039469b073 | ||
|
|
f5f0faa021 | ||
|
|
b8a27ac9db | ||
|
|
ebbae7a275 | ||
|
|
e614a203bf | ||
|
|
46575c2cbd | ||
|
|
28af3a955e | ||
|
|
f3447d3f0b | ||
|
|
3ce5fb0901 | ||
|
|
59d0d973b7 | ||
|
|
67986dc51c | ||
|
|
fde8977cf8 | ||
|
|
f5f748e56d | ||
|
|
28509a9519 | ||
|
|
93602830a2 | ||
|
|
33f67ca6a1 | ||
|
|
50640010d6 | ||
|
|
60939e21e9 | ||
|
|
7a891c80d7 | ||
|
|
2c3f55598b | ||
|
|
cef8cc61f1 | ||
|
|
61c7c6b281 | ||
|
|
4021c4970d | ||
|
|
cbb2e9d974 | ||
|
|
6917176796 | ||
|
|
72ffc50a2e | ||
|
|
318d4accb4 | ||
|
|
6c44824926 | ||
|
|
1d3031d872 | ||
|
|
eeb4b2e824 | ||
|
|
241d79e8a6 | ||
|
|
a0b22bb06c | ||
|
|
ffbda13a58 | ||
|
|
87305aaf57 | ||
|
|
e83ddf7ab6 | ||
|
|
4e82fecb76 | ||
|
|
6fba96d33d | ||
|
|
306c82c3c5 | ||
|
|
5e884040ce | ||
|
|
4cf437e20d | ||
|
|
34ad30d1f8 | ||
|
|
80c6aad05d | ||
|
|
67f7345766 | ||
|
|
3769fa3bf6 | ||
|
|
57cb4f1a11 | ||
|
|
5b2cd03616 | ||
|
|
a27026dfbc | ||
|
|
e93e7cbf52 | ||
|
|
dccf891071 | ||
|
|
6578727d5c | ||
|
|
32f56b9dc1 | ||
|
|
ffe2445a8e | ||
|
|
f6b9f3f2b6 | ||
|
|
e897489500 | ||
|
|
caf867582f |
No files matched your search
@@ -1,3 +1,10 @@
|
||||
2005-01-25 Jonathan Pryor <[email protected]>
|
||||
|
||||
* support/Makefile.am: Add GLIB_CFLAGS to INCLUDE so that <glib.h> can be
|
||||
found by support/macros.c.
|
||||
* support/macros.c: Use gint64, not long, to match C# declaration.
|
||||
Fixes 71152.
|
||||
|
||||
2004-10-14 Joe Shaw <[email protected]>
|
||||
|
||||
* man/mono.1: Fix the syntax of the M: trace syntax
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,1.0.4)
|
||||
AM_INIT_AUTOMAKE(mono,1.0.6)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_PROG_LN_S
|
||||
|
||||
+371
-68
@@ -1,9 +1,9 @@
|
||||
;;; Provided courtesy of http://www.GaryKeith.com
|
||||
;;; Created on October 24, 2004 at 7:22:55 PM GMT
|
||||
;;; Created on November 14, 2004 at 7:33:06 PM GMT
|
||||
|
||||
[GJK_Browscap_Version]
|
||||
browser=Browscap Version
|
||||
version=2004-10-24 19:22:55 GMT
|
||||
version=2004-11-14 19:33:06 GMT
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Alta Vista
|
||||
|
||||
@@ -118,6 +118,35 @@ browser=Exalead
|
||||
parent=Exalead
|
||||
browser=NG
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exava
|
||||
|
||||
[Exava]
|
||||
browser=Exava
|
||||
frames=True
|
||||
iframes=False
|
||||
tables=True
|
||||
cookies=False
|
||||
backgroundsounds=False
|
||||
vbscript=False
|
||||
javascript=False
|
||||
javaapplets=False
|
||||
activexcontrols=False
|
||||
cdf=False
|
||||
aol=False
|
||||
beta=False
|
||||
win16=False
|
||||
crawler=True
|
||||
stripper=False
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[Mozilla/4.7 *([email protected])]
|
||||
parent=Exava
|
||||
browser=Exava
|
||||
|
||||
[Mozilla/5.0 (compatible; Exabot/2.0; [email protected])]
|
||||
parent=Exava
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Excite
|
||||
|
||||
[Excite]
|
||||
@@ -660,10 +689,6 @@ stripper=True
|
||||
parent=Search Engines
|
||||
browser=WhizBang
|
||||
|
||||
[Mozilla/4.7 *([email protected])]
|
||||
parent=Search Engines
|
||||
browser=Exava
|
||||
|
||||
[Mozilla/5.0 (compatible; CXL-FatAssANT (El Robeiro); http://www.conexcol.com/FatAssANT/; ANTid:alfa; v. 0.5.1)]
|
||||
parent=Search Engines
|
||||
browser=Conexcol.com
|
||||
@@ -716,6 +741,10 @@ browser=Seekbot
|
||||
parent=Search Engines
|
||||
browser=Sensis
|
||||
|
||||
[SiteSpider (http://www.SiteSpider.com/)]
|
||||
parent=Search Engines
|
||||
browser=SiteSpider
|
||||
|
||||
[Speedy?Spider (http://www.entireweb.com)]
|
||||
parent=Search Engines
|
||||
browser=entireweb.com
|
||||
@@ -763,6 +792,10 @@ browser=Wotbox
|
||||
parent=Search Engines
|
||||
browser=Yandex
|
||||
|
||||
[ZipppBot/0.11 (ZipppBot; http://www.zippp.net; [email protected])]
|
||||
parent=Search Engines
|
||||
browser=ZipppBot
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Singing Fish
|
||||
|
||||
[Singing Fish]
|
||||
@@ -944,6 +977,32 @@ browser=AvantGo
|
||||
[Mozilla/4.0 (fuck off; compatible; not MSIE 6.0; not Windows NT 5.1)]
|
||||
parent=Banned
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Blogs
|
||||
|
||||
[Blogs]
|
||||
browser=Blogs
|
||||
frames=False
|
||||
iframes=False
|
||||
tables=False
|
||||
cookies=False
|
||||
backgroundsounds=False
|
||||
vbscript=False
|
||||
javascript=False
|
||||
javaapplets=False
|
||||
activexcontrols=False
|
||||
cdf=False
|
||||
aol=False
|
||||
beta=False
|
||||
win16=False
|
||||
crawler=True
|
||||
stripper=True
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[.Text Version 0.958.2004.2001 - http://scottwater.com/blog (Microsoft Windows NT 5.2.3790.0; .NET CLR 1.1.4322.2032)]
|
||||
parent=Blogs
|
||||
browser=Scott Watermasysk
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap.ini Version Checkers
|
||||
|
||||
[Browscap.ini Version Checkers]
|
||||
@@ -979,11 +1038,25 @@ browser=Automated Browscap.ini Updater
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=TKC AutoDownloader
|
||||
|
||||
[ecsbot/0.1 (?http://www.e-commerce-services.com/gen/ecsbot.html)]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=ecsbot
|
||||
frames=True
|
||||
iframes=True
|
||||
tables=True
|
||||
beta=True
|
||||
stripper=True
|
||||
|
||||
[Mono Browser Capabilities Updater*]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=Mono Browser Capabilities Updater
|
||||
stripper=True
|
||||
|
||||
[SpiderMan]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=SpiderMan
|
||||
stripper=True
|
||||
|
||||
[UpdateBrowscap*]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=UpdateBrowscap
|
||||
@@ -993,6 +1066,10 @@ parent=Browscap.ini Version Checkers
|
||||
browser=Woko robot
|
||||
stripper=True
|
||||
|
||||
[www.garykeith.com browscap.ini bot*]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=clarkson.edu
|
||||
|
||||
[www.substancia.com AutoHTTPAgent (ver 1.0)]
|
||||
parent=Browscap.ini Version Checkers
|
||||
browser=Substncia
|
||||
@@ -1000,10 +1077,10 @@ version=1.0
|
||||
majorver=1
|
||||
minorver=0
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright & Plagiarism
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright/Plagiarism
|
||||
|
||||
[Copyright & Plagiarism]
|
||||
browser=Copyright & Plagiarism
|
||||
[Copyright/Plagiarism]
|
||||
browser=Copyright/Plagiarism
|
||||
frames=False
|
||||
iframes=False
|
||||
tables=False
|
||||
@@ -1023,27 +1100,27 @@ wap=False
|
||||
netclr=False
|
||||
|
||||
[CopyRightCheck*]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=CopyRightCheck
|
||||
|
||||
[FairAd Client*]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=FairAd Client
|
||||
|
||||
[IPiumBot laurion(dot)com]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=IPiumBot
|
||||
|
||||
[oBot]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=oBot
|
||||
|
||||
[SlySearch/*]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=SlySearch
|
||||
|
||||
[TurnitinBot/*]
|
||||
parent=Copyright & Plagiarism
|
||||
parent=Copyright/Plagiarism
|
||||
browser=TurnitinBot
|
||||
|
||||
[Butch__*]
|
||||
@@ -1373,6 +1450,10 @@ browser=AaronCarter
|
||||
parent=General Crawlers
|
||||
browser=Aport
|
||||
|
||||
[Argus/1.1 (Nutch; http://www.simpy.com/bot.html; feedback at simpy dot com)]
|
||||
parent=General Crawlers
|
||||
browser=Simpy
|
||||
|
||||
[Art-Online.com*]
|
||||
parent=General Crawlers
|
||||
browser=Art-Online.com
|
||||
@@ -1557,6 +1638,15 @@ browser=Oracle Ultra Search
|
||||
parent=General Crawlers
|
||||
browser=Wayback Machine
|
||||
|
||||
[Pajaczek/*]
|
||||
parent=General Crawlers
|
||||
browser=Pajaczek
|
||||
stripper=True
|
||||
|
||||
[Patwebbot (http://www.herz-power.de/technik.html)]
|
||||
parent=General Crawlers
|
||||
browser=Patwebbot
|
||||
|
||||
[Radiation Retriever*]
|
||||
parent=General Crawlers
|
||||
browser=Radiation Retriever
|
||||
@@ -1615,6 +1705,11 @@ stripper=True
|
||||
parent=General Crawlers
|
||||
browser=SyncMgr
|
||||
|
||||
[Talkro Web-Shot/1.0 (E-mail: [email protected], Home: http://222.122.15.190/webshot)]
|
||||
parent=General Crawlers
|
||||
browser=Talkro Web-Shot
|
||||
stripper=True
|
||||
|
||||
[TheInformant*]
|
||||
parent=General Crawlers
|
||||
browser=TheInformant
|
||||
@@ -2980,6 +3075,10 @@ stripper=True
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[e-SocietyRobot(http://www.yama.info.waseda.ac.jp/~yamana/es/)]
|
||||
parent=Research Projects
|
||||
browser=e-SocietyRobot
|
||||
|
||||
[inetbot/* (?http://www.inetbot.com/bot.html)]
|
||||
parent=Research Projects
|
||||
browser=inetbot
|
||||
@@ -3125,7 +3224,7 @@ parent=Site Monitors
|
||||
browser=Netcraft Webserver Survey
|
||||
stripper=True
|
||||
|
||||
[*WebMon 1.*;]
|
||||
[*WebMon 1.*]
|
||||
parent=Site Monitors
|
||||
browser=WebMon
|
||||
|
||||
@@ -3237,6 +3336,10 @@ browser=DeepIndexer
|
||||
parent=Site Rippers
|
||||
browser=DISCo Pump
|
||||
|
||||
[eStyleSearch 4 (compatible; MSIE 6.0; Windows NT 5.0)]
|
||||
parent=Site Rippers
|
||||
browser=eStyleSearch
|
||||
|
||||
[fetch libfetch/*]
|
||||
parent=Site Rippers
|
||||
|
||||
@@ -3709,6 +3812,10 @@ browser=Expired Domain Sleuth
|
||||
parent=Unknown
|
||||
browser=falcon
|
||||
|
||||
[httptalker/0.10 (HTTP client sample)]
|
||||
parent=Unknown
|
||||
browser=httptalker
|
||||
|
||||
[Iria/1.07*]
|
||||
parent=Unknown
|
||||
browser=Iria
|
||||
@@ -3732,10 +3839,23 @@ browser=Plucker/Py
|
||||
parent=Unknown
|
||||
browser=ProPowerBot
|
||||
|
||||
[Schmozilla/v9.14 Platinum]
|
||||
parent=Unknown
|
||||
|
||||
[sna-0.0.1 ([email protected])]
|
||||
parent=Unknown
|
||||
|
||||
[sna-0.0.1 [email protected]]
|
||||
parent=Unknown
|
||||
|
||||
[SURF]
|
||||
parent=Unknown
|
||||
browser=SURF
|
||||
|
||||
[Ultraseek]
|
||||
parent=Unknown
|
||||
browser=Ultraseek
|
||||
|
||||
[VCIKJZDDLS*]
|
||||
parent=Unknown
|
||||
|
||||
@@ -4196,71 +4316,27 @@ stripper=False
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[*(Spoofed by Amiga-AWeb/*)]
|
||||
[Amiga-AWeb/3.*]
|
||||
parent=AWeb
|
||||
|
||||
[Amiga-AWeb/3.0*]
|
||||
parent=AWeb
|
||||
version=3.0
|
||||
version=3
|
||||
majorver=3
|
||||
minorver=0
|
||||
|
||||
[Amiga-AWeb/3.1*]
|
||||
[AmigaVoyager/1.*]
|
||||
parent=AWeb
|
||||
version=3.1
|
||||
majorver=3
|
||||
minorver=1
|
||||
|
||||
[Amiga-AWeb/3.2*]
|
||||
parent=AWeb
|
||||
version=3.2
|
||||
majorver=3
|
||||
minorver=2
|
||||
|
||||
[Amiga-AWeb/3.3*]
|
||||
parent=AWeb
|
||||
version=3.3
|
||||
majorver=3
|
||||
minorver=3
|
||||
|
||||
[Amiga-AWeb/3.4*]
|
||||
parent=AWeb
|
||||
version=3.4
|
||||
majorver=3
|
||||
minorver=4
|
||||
|
||||
[Amiga-AWeb/3.9*]
|
||||
parent=AWeb
|
||||
version=3.9
|
||||
majorver=3
|
||||
minorver=9
|
||||
javascript=True
|
||||
|
||||
[AmigaVoyager/1.0]
|
||||
parent=AWeb
|
||||
version=1.0
|
||||
version=1
|
||||
majorver=1
|
||||
minorver=0
|
||||
|
||||
[AmigaVoyager/2.95 (AmigaOS/MC680x0)]
|
||||
[AmigaVoyager/2.*]
|
||||
parent=AWeb
|
||||
browser=Amiga Voyager
|
||||
version=2.95
|
||||
version=2
|
||||
majorver=2
|
||||
minorver=95
|
||||
|
||||
[AmigaVoyager/3.* (AmigaOS/MC680x0)]
|
||||
[AmigaVoyager/3.*]
|
||||
parent=AWeb
|
||||
browser=Amiga Voyager
|
||||
version=3.0
|
||||
version=3
|
||||
majorver=3
|
||||
minorver=0
|
||||
|
||||
[Mozilla/4.0 (compatible; MSIE 5.5; Amiga-AWeb/3.4APL)]
|
||||
parent=AWeb
|
||||
version=3.4
|
||||
majorver=3
|
||||
minorver=4
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cyberdog
|
||||
|
||||
@@ -7168,6 +7244,156 @@ platform=FreeBSD
|
||||
parent=Opera 7.5
|
||||
platform=Linux
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.6
|
||||
|
||||
[Opera 7.6]
|
||||
browser=Opera
|
||||
version=7.6
|
||||
majorver=7
|
||||
minorver=6
|
||||
css=2
|
||||
frames=True
|
||||
iframes=True
|
||||
tables=True
|
||||
cookies=True
|
||||
backgroundsounds=True
|
||||
vbscript=False
|
||||
javascript=True
|
||||
javaapplets=True
|
||||
activexcontrols=False
|
||||
cdf=False
|
||||
aol=False
|
||||
beta=True
|
||||
win16=False
|
||||
crawler=False
|
||||
stripper=False
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Linux*) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Linux
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows 2000) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win2000
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows 95) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win95
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows 98) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win98
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows ME) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinME
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 4.0) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNT
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.0) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win2000
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.1) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinXP
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.2) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNET
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; Windows XP) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinXP
|
||||
|
||||
[Mozilla/?.* (compatible; MSIE ?.*; X11; Linux*) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Linux
|
||||
|
||||
[Mozilla/?.* (Windows 2000; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win2000
|
||||
|
||||
[Mozilla/?.* (Windows 95; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win95
|
||||
|
||||
[Mozilla/?.* (Windows 98; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win98
|
||||
|
||||
[Mozilla/?.* (Windows ME; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinME
|
||||
|
||||
[Mozilla/?.* (Windows NT 4.0; U) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNT
|
||||
|
||||
[Mozilla/?.* (Windows NT 5.0; U) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=Win2000
|
||||
|
||||
[Mozilla/?.* (Windows NT 5.1; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinXP
|
||||
|
||||
[Mozilla/?.* (Windows NT 5.2; ?) Opera 7.6*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNET
|
||||
|
||||
[Opera/7.6* (Linux*; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=Linux
|
||||
|
||||
[Opera/7.6* (Macintosh; PPC Mac OS X; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=MacPPC
|
||||
|
||||
[Opera/7.6* (Windows 95; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=Win95
|
||||
|
||||
[Opera/7.6* (Windows 98; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=Win98
|
||||
|
||||
[Opera/7.6* (Windows ME; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=WinME
|
||||
|
||||
[Opera/7.6* (Windows NT 4.0; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNT
|
||||
|
||||
[Opera/7.6* (Windows NT 5.0; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=Win2000
|
||||
|
||||
[Opera/7.6* (Windows NT 5.1; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=WinXP
|
||||
|
||||
[Opera/7.6* (Windows NT 5.2; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=WinNET
|
||||
|
||||
[Opera/7.6* (Windows XP; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=WinXP
|
||||
|
||||
[Opera/7.6* (X11; FreeBSD*; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=FreeBSD
|
||||
|
||||
[Opera/7.6* (X11; Linux*; ?)*]
|
||||
parent=Opera 7.6
|
||||
platform=Linux
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 2.0
|
||||
|
||||
[Netscape 2.0]
|
||||
@@ -9493,6 +9719,83 @@ platform=SunOS
|
||||
[Mozilla/5.0 Gecko/* Firefox/0.9*]
|
||||
parent=Firefox 0.9
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 1.0
|
||||
|
||||
[Firefox 1.0]
|
||||
browser=Firefox
|
||||
version=1.0
|
||||
majorver=1
|
||||
minorver=0
|
||||
css=2
|
||||
frames=True
|
||||
iframes=True
|
||||
tables=True
|
||||
cookies=True
|
||||
backgroundsounds=False
|
||||
vbscript=False
|
||||
javascript=True
|
||||
javaapplets=True
|
||||
activexcontrols=False
|
||||
cdf=False
|
||||
aol=False
|
||||
beta=False
|
||||
win16=False
|
||||
crawler=False
|
||||
stripper=False
|
||||
wap=False
|
||||
netclr=False
|
||||
|
||||
[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=MacOSX
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=WinME
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Win95; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=Win95
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Win98; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=Win98
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=Win2000
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=WinXP
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=WinNET
|
||||
|
||||
[Mozilla/5.0 (Windows; ?; WinNT4.0; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=WinNT
|
||||
|
||||
[Mozilla/5.0 (X11; ?; FreeBSD*; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=FreeBSD
|
||||
|
||||
[Mozilla/5.0 (X11; ?; Linux*; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=Linux
|
||||
|
||||
[Mozilla/5.0 (X11; ?; Linux*rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=Linux
|
||||
|
||||
[Mozilla/5.0 (X11; ?; SunOS sun4u; *rv:*) Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
platform=SunOS
|
||||
|
||||
[Mozilla/5.0 Gecko/* Firefox/1.0*]
|
||||
parent=Firefox 1.0
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Galeon 0.1
|
||||
|
||||
[Galeon 0.1]
|
||||
|
||||
+7
-7
@@ -41,14 +41,14 @@ prefix/lib/mono with the name NAME, and a symlink is created from
|
||||
NAME/assembly_name to the assembly on the GAC. This is used so
|
||||
developers can reference a set of libraries at once.
|
||||
.Sp
|
||||
The -root option is used by developers integrating this with automake
|
||||
tools or packaging tools that require a prefix directory to be
|
||||
specified. The root represents the "libdir" component of a prefix
|
||||
(typically prefix/lib).
|
||||
The -root option is used to specify the "libdir" value of an installation
|
||||
prefix which differs from the prefix of the system GAC.
|
||||
Typical automake usage is "-root $(DESTDIR)$(libdir)".
|
||||
To access assemblies installed to a prefix other than the mono prefix,
|
||||
it is necessary to set the MONO_GAC_PREFIX environment variable.
|
||||
.Sp
|
||||
The -gacdir option is used to specify the GACs base directory. Once an
|
||||
assembly has been installed to a non standard gacdir the MONO_GAC_PATH
|
||||
environment variable must be used to access the assembly.
|
||||
The -gacdir option is included for backward compatibility but is not
|
||||
recommended for new code. Use the -root option instead.
|
||||
.Sp
|
||||
The -check_refs option is used to ensure that the assembly being
|
||||
installed into the GAC does not reference any non strong named
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
2004-11-19 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data/.cvsignore
|
||||
* Mono.Data/AssemblyInfo.cs
|
||||
* Mono.Data/Makefile
|
||||
* Mono.Data/Mono.Data.dll.sources: added files
|
||||
for build of Mono.Data.dll
|
||||
This assembly includes the ProviderFactory
|
||||
|
||||
* Makefile: added Mono.Data.dll to the build
|
||||
* Mono.Data/app.config: added providers and
|
||||
removed obsolete providers to app settings xml file
|
||||
|
||||
* Mono.Data/test/Mono.Data.dll
|
||||
* Mono.Data/test/test.exe: remove binaries
|
||||
|
||||
2004-06-24 Raja R Harinath <[email protected]>
|
||||
|
||||
* IBM.Data.DB2/Makefile: Disable for 'net_2_0'.
|
||||
|
||||
@@ -16,6 +16,7 @@ SUBDIRS = \
|
||||
Mono.Data.Tds \
|
||||
System.Security \
|
||||
System.Data \
|
||||
Mono.Data \
|
||||
Mono.GetOptions \
|
||||
System.Web \
|
||||
System.Web.Services \
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2005-01-10 Daniel Morgan <[email protected]>
|
||||
|
||||
* Mono.Data.SybaseClient/SybaseConnection.cs: fix
|
||||
for packetSize not being set. Fixes bug 70930
|
||||
Thanks to [email protected] (Sebastien Robitaille)
|
||||
for reporting this bug.
|
||||
|
||||
2004-04-05 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* Mono.Data.SybaseClient.dll.sources: Removed SybaseConnectionPool.cs.
|
||||
|
||||
@@ -430,9 +430,7 @@ namespace Mono.Data.SybaseClient {
|
||||
if (!value.Equals (""))
|
||||
parameters [name.ToUpper ().Trim ()] = value;
|
||||
|
||||
if (this.ConnectionString == null)
|
||||
SetDefaultConnectionParameters (parameters);
|
||||
|
||||
SetDefaultConnectionParameters (parameters);
|
||||
SetProperties (parameters);
|
||||
|
||||
this.connectionString = connectionString;
|
||||
@@ -442,8 +440,10 @@ namespace Mono.Data.SybaseClient {
|
||||
{
|
||||
if (null == parameters.Get ("APPLICATION NAME"))
|
||||
parameters["APPLICATION NAME"] = "Mono SybaseClient Data Provider";
|
||||
if (null == parameters.Get ("CONNECT TIMEOUT") && null == parameters.Get ("CONNECTION TIMEOUT"))
|
||||
if (null == parameters.Get ("CONNECT TIMEOUT") && null == parameters.Get ("CONNECTION TIMEOUT")) {
|
||||
parameters["CONNECT TIMEOUT"] = "15";
|
||||
connectionTimeout = 15;
|
||||
}
|
||||
if (null == parameters.Get ("CONNECTION LIFETIME"))
|
||||
parameters["CONNECTION LIFETIME"] = "0";
|
||||
if (null == parameters.Get ("CONNECTION RESET"))
|
||||
@@ -452,14 +452,20 @@ namespace Mono.Data.SybaseClient {
|
||||
parameters["ENLIST"] = "true";
|
||||
if (null == parameters.Get ("INTEGRATED SECURITY") && null == parameters.Get ("TRUSTED_CONNECTION"))
|
||||
parameters["INTEGRATED SECURITY"] = "false";
|
||||
if (null == parameters.Get ("MAX POOL SIZE"))
|
||||
if (null == parameters.Get ("MAX POOL SIZE")) {
|
||||
parameters["MAX POOL SIZE"] = "100";
|
||||
if (null == parameters.Get ("MIN POOL SIZE"))
|
||||
maxPoolSize = 100;
|
||||
}
|
||||
if (null == parameters.Get ("MIN POOL SIZE")) {
|
||||
parameters["MIN POOL SIZE"] = "0";
|
||||
maxPoolSize = 0;
|
||||
}
|
||||
if (null == parameters.Get ("NETWORK LIBRARY") && null == parameters.Get ("NET"))
|
||||
parameters["NETWORK LIBRARY"] = "dbmssocn";
|
||||
if (null == parameters.Get ("PACKET SIZE"))
|
||||
if (null == parameters.Get ("PACKET SIZE")) {
|
||||
parameters["PACKET SIZE"] = "512";
|
||||
packetSize = 512;
|
||||
}
|
||||
if (null == parameters.Get ("PERSIST SECURITY INFO"))
|
||||
parameters["PERSIST SECURITY INFO"] = "false";
|
||||
if (null == parameters.Get ("POOLING"))
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
.makefrag
|
||||
.response
|
||||
library-deps.stamp
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Andreas Nahr ([email protected])
|
||||
//
|
||||
// (C) 2003 Ximian, Inc. http://www.ximian.com
|
||||
// (C) 2004 Novell (http://www.novell.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#if (NET_1_0)
|
||||
[assembly: AssemblyVersion ("1.0.3300.0")]
|
||||
#elif (NET_2_0)
|
||||
[assembly: AssemblyVersion ("2.0.3600.0")]
|
||||
#elif (NET_1_1)
|
||||
[assembly: AssemblyVersion ("1.0.5000.0")]
|
||||
#endif
|
||||
|
||||
/* TODO COMPLETE INFORMATION
|
||||
|
||||
[assembly: AssemblyTitle ("")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
|
||||
[assembly: CLSCompliant (true)]
|
||||
[assembly: AssemblyFileVersion ("0.0.0.1")]
|
||||
|
||||
[assembly: ComVisible (false)]
|
||||
|
||||
*/
|
||||
|
||||
[assembly: AssemblyDelaySign (true)]
|
||||
[assembly: AssemblyKeyFile ("../mono.pub")]
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
thisdir = class/Mono.Data
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = Mono.Data.dll
|
||||
LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll /r:System.Xml.dll \
|
||||
/r:System.Data.dll
|
||||
NO_TEST = yes
|
||||
|
||||
include ../../build/library.make
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
AssemblyInfo.cs
|
||||
DataTools.cs
|
||||
Provider.cs
|
||||
ProviderCollection.cs
|
||||
ProviderFactory.cs
|
||||
ProviderSectionHandler.cs
|
||||
@@ -6,7 +6,11 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=mypassword" />
|
||||
<add key="OraConnStr" value="factory=System.Data.OracleClient;data source=testdb;user id=scott;password=tiger" />
|
||||
<add key="PgConnStr" value="factory=Npgsql;Server=localhost;Database=monotest;User ID=monotest;Password=monotest" />
|
||||
<add key="MyConnStr" value="factory=ByteFX.Data.MySqlClient;Database=test" />
|
||||
<add key="FireConnStr" value="factory=FirebirdSql.Data.Firebird;Database=E:\FIREBIRD\EXAMPLES\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost" />
|
||||
</appSettings>
|
||||
<mono.data>
|
||||
<providers>
|
||||
@@ -29,42 +33,57 @@
|
||||
connection="System.Data.Odbc.OdbcConnection"
|
||||
adapter="System.Data.Odbc.OdbcDataAdapter"
|
||||
command="System.Data.Odbc.OdbcCommand"
|
||||
assembly="odbc"
|
||||
assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
description="ODBC" />
|
||||
<provider
|
||||
name="Mono.Data.TdsClient"
|
||||
connection="Mono.Data.TdsClient.TdsConnection"
|
||||
adapter="Mono.Data.TdsClient.TdsDataAdapter"
|
||||
command="Mono.Data.TdsClient.TdsCommand"
|
||||
assembly="Mono.Data.TdsClient"
|
||||
assembly="Mono.Data.TdsClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="TDS Generic" />
|
||||
<provider name="Mono.Data.MySql"
|
||||
connection="Mono.Data.MySql.MySqlConnection"
|
||||
adapter="Mono.Data.MySql.MySqlDataAdapter"
|
||||
command="Mono.Data.MySql.MySqlCommand"
|
||||
assembly="Mono.Data.MySql"
|
||||
<provider
|
||||
name="ByteFX.Data.MySqlClient"
|
||||
connection="ByteFX.Data.MySqlClient.MySqlConnection"
|
||||
adapter="ByteFX.Data.MySqlClient.MySqlDataAdapter"
|
||||
command="ByteFX.Data.MySqlClient.MySqlCommand"
|
||||
assembly="ByteFX.Data, Version=0.7.6.1, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="MySQL" />
|
||||
<provider
|
||||
name="Mono.Data.PostgreSqlClient"
|
||||
connection="Mono.Data.PostgreSqlClient.PgSqlConnection"
|
||||
adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter"
|
||||
command="Mono.Data.PostgreSqlClient.PgSqlCommand"
|
||||
assembly="Mono.Data.PostgreSqlClient"
|
||||
name="Npgsql"
|
||||
connection="Npgsql.NpgsqlConnection"
|
||||
adapter="Npgsql.NpgsqlDataAdapter"
|
||||
command="Npgsql.NpgsqlCommand"
|
||||
assembly="Npgsql, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
|
||||
description="PostgreSQL" />
|
||||
<provider
|
||||
name="Mono.Data.SqliteClient"
|
||||
connection="Mono.Data.SqliteClient.SqliteConnection"
|
||||
adapter="Mono.Data.SqliteClient.SqliteDataAdapter"
|
||||
command="Mono.Data.SqliteClient.SqliteCommand"
|
||||
assembly="Mono.Data.SqliteClient"
|
||||
assembly="Mono.Data.SqliteClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="SQL Lite" />
|
||||
<provider
|
||||
name="Mono.Data.SybaseClient"
|
||||
connection="Mono.Data.SybaseClient.SybaseConnection"
|
||||
adapter="Mono.Data.SybaseClient.SybaseDataAdapter"
|
||||
command="Mono.Data.SybaseClient.SybaseCommand"
|
||||
assembly="Mono.Data.SybaseClient"
|
||||
assembly="Mono.Data.SybaseClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="Sybase" />
|
||||
<provider
|
||||
name="FirebirdSql.Data.Firebird"
|
||||
connection="FirebirdSql.Data.Firebird.FbConnection"
|
||||
adapter="FirebirdSql.Data.Firebird.FbDataAdapter"
|
||||
command="FirebirdSql.Data.Firebird.FbCommand"
|
||||
assembly="FirebirdSql.Data.Firebird, Version=1.6.3.0, Culture=neutral, PublicKeyToken=e1b4f92304d7b12f"
|
||||
description="Firebird" />
|
||||
<provider
|
||||
name="IBM.Data.DB2"
|
||||
connection="IBM.Data.DB2.DB2Connection"
|
||||
adapter="IBM.Data.DB2.DB2DataAdapter"
|
||||
command="IBM.Data.DB2.DB2Command"
|
||||
assembly="IBM.Data.DB2, Version=1.0.1728.9997, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
|
||||
description="IBM DB2 Universal Database" />
|
||||
</providers>
|
||||
</mono.data>
|
||||
</configuration>
|
||||
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,11 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" />
|
||||
<add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=mypassword" />
|
||||
<add key="OraConnStr" value="factory=System.Data.OracleClient;data source=testdb;user id=scott;password=tiger" />
|
||||
<add key="PgConnStr" value="factory=Npgsql;Server=localhost;Database=monotest;User ID=monotest;Password=monotest" />
|
||||
<add key="MyConnStr" value="factory=ByteFX.Data.MySqlClient;Database=test" />
|
||||
<add key="FireConnStr" value="factory=FirebirdSql.Data.Firebird;Database=E:\FIREBIRD\EXAMPLES\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost" />
|
||||
</appSettings>
|
||||
<mono.data>
|
||||
<providers>
|
||||
@@ -29,42 +33,57 @@
|
||||
connection="System.Data.Odbc.OdbcConnection"
|
||||
adapter="System.Data.Odbc.OdbcDataAdapter"
|
||||
command="System.Data.Odbc.OdbcCommand"
|
||||
assembly="odbc"
|
||||
assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
description="ODBC" />
|
||||
<provider
|
||||
name="Mono.Data.TdsClient"
|
||||
connection="Mono.Data.TdsClient.TdsConnection"
|
||||
adapter="Mono.Data.TdsClient.TdsDataAdapter"
|
||||
command="Mono.Data.TdsClient.TdsCommand"
|
||||
assembly="Mono.Data.TdsClient"
|
||||
assembly="Mono.Data.TdsClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="TDS Generic" />
|
||||
<provider name="Mono.Data.MySql"
|
||||
connection="Mono.Data.MySql.MySqlConnection"
|
||||
adapter="Mono.Data.MySql.MySqlDataAdapter"
|
||||
command="Mono.Data.MySql.MySqlCommand"
|
||||
assembly="Mono.Data.MySql"
|
||||
<provider
|
||||
name="ByteFX.Data.MySqlClient"
|
||||
connection="ByteFX.Data.MySqlClient.MySqlConnection"
|
||||
adapter="ByteFX.Data.MySqlClient.MySqlDataAdapter"
|
||||
command="ByteFX.Data.MySqlClient.MySqlCommand"
|
||||
assembly="ByteFX.Data, Version=0.7.6.1, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="MySQL" />
|
||||
<provider
|
||||
name="Mono.Data.PostgreSqlClient"
|
||||
connection="Mono.Data.PostgreSqlClient.PgSqlConnection"
|
||||
adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter"
|
||||
command="Mono.Data.PostgreSqlClient.PgSqlCommand"
|
||||
assembly="Mono.Data.PostgreSqlClient"
|
||||
name="Npgsql"
|
||||
connection="Npgsql.NpgsqlConnection"
|
||||
adapter="Npgsql.NpgsqlDataAdapter"
|
||||
command="Npgsql.NpgsqlCommand"
|
||||
assembly="Npgsql, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
|
||||
description="PostgreSQL" />
|
||||
<provider
|
||||
name="Mono.Data.SqliteClient"
|
||||
connection="Mono.Data.SqliteClient.SqliteConnection"
|
||||
adapter="Mono.Data.SqliteClient.SqliteDataAdapter"
|
||||
command="Mono.Data.SqliteClient.SqliteCommand"
|
||||
assembly="Mono.Data.SqliteClient"
|
||||
assembly="Mono.Data.SqliteClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="SQL Lite" />
|
||||
<provider
|
||||
name="Mono.Data.SybaseClient"
|
||||
connection="Mono.Data.SybaseClient.SybaseConnection"
|
||||
adapter="Mono.Data.SybaseClient.SybaseDataAdapter"
|
||||
command="Mono.Data.SybaseClient.SybaseCommand"
|
||||
assembly="Mono.Data.SybaseClient"
|
||||
assembly="Mono.Data.SybaseClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
|
||||
description="Sybase" />
|
||||
<provider
|
||||
name="FirebirdSql.Data.Firebird"
|
||||
connection="FirebirdSql.Data.Firebird.FbConnection"
|
||||
adapter="FirebirdSql.Data.Firebird.FbDataAdapter"
|
||||
command="FirebirdSql.Data.Firebird.FbCommand"
|
||||
assembly="FirebirdSql.Data.Firebird, Version=1.6.3.0, Culture=neutral, PublicKeyToken=e1b4f92304d7b12f"
|
||||
description="Firebird" />
|
||||
<provider
|
||||
name="IBM.Data.DB2"
|
||||
connection="IBM.Data.DB2.DB2Connection"
|
||||
adapter="IBM.Data.DB2.DB2DataAdapter"
|
||||
command="IBM.Data.DB2.DB2Command"
|
||||
assembly="IBM.Data.DB2, Version=1.0.1728.9997, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
|
||||
description="IBM DB2 Universal Database" />
|
||||
</providers>
|
||||
</mono.data>
|
||||
</configuration>
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-12-30 Jonathan Pryor <[email protected]>
|
||||
|
||||
* Syscall.cs: All syscall_ functions should explicitly specify EntryPoint
|
||||
so that an EntryPointNotFoundException is avoided. Fixes 70706.
|
||||
|
||||
2004-07-09 Dick Porter <[email protected]>
|
||||
|
||||
* PeerCred.cs: Get the unix socket peer credentials.
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Mono.Posix {
|
||||
[DllImport ("MonoPosixHelper", EntryPoint="wstopsig")]
|
||||
public static extern int WSTOPSIG (int status);
|
||||
|
||||
[DllImport ("libc", SetLastError=true)]
|
||||
[DllImport ("libc", EntryPoint="creat", SetLastError=true)]
|
||||
internal static extern int syscall_creat (string pathname, int flags);
|
||||
|
||||
public static int creat (string pathname, FileMode flags)
|
||||
@@ -277,7 +277,7 @@ namespace Mono.Posix {
|
||||
|
||||
// TODO: utime
|
||||
|
||||
[DllImport ("libc")]
|
||||
[DllImport ("libc", EntryPoint="access", SetLastError=true)]
|
||||
internal extern static int syscall_access (string pathname, int mode);
|
||||
|
||||
[DllImport ("MonoPosixHelper")]
|
||||
@@ -302,7 +302,7 @@ namespace Mono.Posix {
|
||||
[DllImport ("libc", SetLastError=true)]
|
||||
public static extern int rename (string oldPath, string newPath);
|
||||
|
||||
[DllImport ("libc", SetLastError=true)]
|
||||
[DllImport ("libc", EntryPoint="mkdir", SetLastError=true)]
|
||||
internal extern static int syscall_mkdir (string pathname, int mode);
|
||||
|
||||
public static int mkdir (string pathname, FileMode mode)
|
||||
|
||||
@@ -82,7 +82,7 @@ class MakeMap {
|
||||
foreach (FieldInfo fi in t.GetFields ()){
|
||||
if (!fi.IsLiteral)
|
||||
continue;
|
||||
sh.WriteLine ("#define {0}_{1} {1}", n, fi.Name);
|
||||
sh.WriteLine ("#define {0}_{1} {2}", n, fi.Name, (int) fi.GetValue (null));
|
||||
}
|
||||
sh.WriteLine ();
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Mono.Math {
|
||||
/// </code>
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
internal static uint [] smallPrimes = {
|
||||
internal static readonly uint [] smallPrimes = {
|
||||
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
|
||||
73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
|
||||
157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,
|
||||
@@ -173,7 +173,9 @@ namespace Mono.Math {
|
||||
this.length = DEFAULT_LEN;
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger (Sign sign, uint len)
|
||||
{
|
||||
this.data = new uint [len];
|
||||
@@ -186,7 +188,9 @@ namespace Mono.Math {
|
||||
this.length = bi.length;
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger (BigInteger bi, uint len)
|
||||
{
|
||||
|
||||
@@ -230,7 +234,9 @@ namespace Mono.Math {
|
||||
this.Normalize ();
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger (uint [] inData)
|
||||
{
|
||||
length = (uint)inData.Length;
|
||||
@@ -243,13 +249,17 @@ namespace Mono.Math {
|
||||
this.Normalize ();
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger (uint ui)
|
||||
{
|
||||
data = new uint [] {ui};
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger (ulong ul)
|
||||
{
|
||||
data = new uint [2] { (uint)ul, (uint)(ul >> 32)};
|
||||
@@ -258,7 +268,9 @@ namespace Mono.Math {
|
||||
this.Normalize ();
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static implicit operator BigInteger (uint value)
|
||||
{
|
||||
return (new BigInteger (value));
|
||||
@@ -270,7 +282,9 @@ namespace Mono.Math {
|
||||
return (new BigInteger ((uint)value));
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static implicit operator BigInteger (ulong value)
|
||||
{
|
||||
return (new BigInteger (value));
|
||||
@@ -366,7 +380,9 @@ namespace Mono.Math {
|
||||
return -(int)Kernel.DwordMod (bi, (uint)-i);
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static uint operator % (BigInteger bi, uint ui)
|
||||
{
|
||||
return Kernel.DwordMod (bi, (uint)ui);
|
||||
@@ -448,7 +464,9 @@ namespace Mono.Math {
|
||||
return (bi % i);
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static uint Modulus (BigInteger bi, uint ui)
|
||||
{
|
||||
return (bi % ui);
|
||||
@@ -604,7 +622,9 @@ namespace Mono.Math {
|
||||
/// </summary>
|
||||
/// <param name="bitNum">The bit to test. The least significant bit is 0.</param>
|
||||
/// <returns>True if bitNum is set to 1, else false.</returns>
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public bool TestBit (uint bitNum)
|
||||
{
|
||||
uint bytePos = bitNum >> 5; // divide by 32
|
||||
@@ -625,19 +645,25 @@ namespace Mono.Math {
|
||||
return ((this.data [bytePos] | mask) == this.data [bytePos]);
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public void SetBit (uint bitNum)
|
||||
{
|
||||
SetBit (bitNum, true);
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public void ClearBit (uint bitNum)
|
||||
{
|
||||
SetBit (bitNum, false);
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public void SetBit (uint bitNum, bool value)
|
||||
{
|
||||
uint bytePos = bitNum >> 5; // divide by 32
|
||||
@@ -690,14 +716,18 @@ namespace Mono.Math {
|
||||
|
||||
#region Compare
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static bool operator == (BigInteger bi1, uint ui)
|
||||
{
|
||||
if (bi1.length != 1) bi1.Normalize ();
|
||||
return bi1.length == 1 && bi1.data [0] == ui;
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public static bool operator != (BigInteger bi1, uint ui)
|
||||
{
|
||||
if (bi1.length != 1) bi1.Normalize ();
|
||||
@@ -753,13 +783,17 @@ namespace Mono.Math {
|
||||
|
||||
#region Formatting
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public string ToString (uint radix)
|
||||
{
|
||||
return ToString (radix, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
}
|
||||
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public string ToString (uint radix, string characterSet)
|
||||
{
|
||||
if (characterSet.Length < radix)
|
||||
@@ -986,7 +1020,7 @@ namespace Mono.Math {
|
||||
|
||||
r2.Normalize ();
|
||||
|
||||
if (r2 < x) {
|
||||
if (r2 <= x) {
|
||||
Kernel.MinusEq (x, r2);
|
||||
} else {
|
||||
BigInteger val = new BigInteger (Sign.Positive, kPlusOne + 1);
|
||||
@@ -1124,7 +1158,9 @@ namespace Mono.Math {
|
||||
|
||||
// TODO: Make tests for this, not really needed b/c prime stuff
|
||||
// checks it, but still would be nice
|
||||
[CLSCompliant (false)]
|
||||
#if !INSIDE_CORLIB
|
||||
[CLSCompliant (false)]
|
||||
#endif
|
||||
public BigInteger Pow (uint b, BigInteger exp)
|
||||
{
|
||||
// if (b != 2) {
|
||||
@@ -1141,7 +1177,6 @@ namespace Mono.Math {
|
||||
}*/
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
private unsafe BigInteger OddPow (uint b, BigInteger exp)
|
||||
{
|
||||
exp.Normalize ();
|
||||
@@ -1496,7 +1531,6 @@ namespace Mono.Math {
|
||||
{
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static uint Inverse (uint n)
|
||||
{
|
||||
uint y = n, z;
|
||||
@@ -1516,7 +1550,6 @@ namespace Mono.Math {
|
||||
return n;
|
||||
}
|
||||
|
||||
[CLSCompliant (false)]
|
||||
public static unsafe BigInteger Reduce (BigInteger n, BigInteger m, uint mPrime)
|
||||
{
|
||||
BigInteger A = n;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-12-03 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* BigInteger.cs: Fix issue #70169 in ModPow when modulus is a power of
|
||||
two. Also sync other changes with HEAD (mostly removing warnings).
|
||||
|
||||
2004-10-25 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* BigInteger.cs: Fix issue #68452 when Randomize was being called on a
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
2004-12-06 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* RSAManaged.cs: Implement key blinding for RSA decryption with, or
|
||||
without, using CRT.
|
||||
|
||||
2004-11-23 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* PKCS1.cs: Merge from HEAD. Fix PKCS#1 v1.5 decryption when the
|
||||
ciphertext isn't exactly the same of the public key and some level 4
|
||||
compiler warnings.
|
||||
|
||||
2004-11-10 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* RC4.cs: Fixed RC4 for compatibility with .NET 2.0. The algorithm is
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
// PKCS1.cs - Implements PKCS#1 primitives.
|
||||
//
|
||||
// Author:
|
||||
// Sebastien Pouliot (spouliot@motus.com)
|
||||
// Sebastien Pouliot <sebastien@ximian.com>
|
||||
//
|
||||
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
|
||||
//
|
||||
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -107,7 +106,9 @@ namespace Mono.Security.Cryptography {
|
||||
public static byte[] OS2IP (byte[] x)
|
||||
{
|
||||
int i = 0;
|
||||
while ((x [i++] == 0x00) && (i < x.Length));
|
||||
while ((x [i++] == 0x00) && (i < x.Length)) {
|
||||
// confuse compiler into reporting a warning with {}
|
||||
}
|
||||
i--;
|
||||
if (i > 0) {
|
||||
byte[] result = new byte [x.Length - i];
|
||||
@@ -252,8 +253,8 @@ namespace Mono.Security.Cryptography {
|
||||
// RSAES-PKCS1-V1_5-DECRYPT (K, C)
|
||||
public static byte[] Decrypt_v15 (RSA rsa, byte[] C)
|
||||
{
|
||||
int size = rsa.KeySize / 8;
|
||||
if ((size < 11) || (C.Length != size))
|
||||
int size = rsa.KeySize >> 3; // div by 8
|
||||
if ((size < 11) || (C.Length > size))
|
||||
throw new CryptographicException ("decryption error");
|
||||
byte[] c = OS2IP (C);
|
||||
byte[] m = RSADP (rsa, c);
|
||||
|
||||
@@ -7,15 +7,11 @@
|
||||
//
|
||||
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
|
||||
// Portions (C) 2003 Ben Maurer
|
||||
// (C) 2004 Novell (http://www.novell.com)
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Key generation translated from Bouncy Castle JCE (http://www.bouncycastle.org/)
|
||||
// See bouncycastle.txt for license.
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
@@ -38,6 +34,7 @@
|
||||
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
using Mono.Math;
|
||||
|
||||
@@ -61,6 +58,7 @@ namespace Mono.Security.Cryptography {
|
||||
private const int defaultKeySize = 1024;
|
||||
|
||||
private bool isCRTpossible = false;
|
||||
private bool keyBlinding = true;
|
||||
private bool keypairGenerated = false;
|
||||
private bool m_disposed = false;
|
||||
|
||||
@@ -79,9 +77,9 @@ namespace Mono.Security.Cryptography {
|
||||
|
||||
public RSAManaged (int keySize)
|
||||
{
|
||||
KeySizeValue = keySize;
|
||||
LegalKeySizesValue = new KeySizes [1];
|
||||
LegalKeySizesValue [0] = new KeySizes (384, 16384, 8);
|
||||
base.KeySize = keySize;
|
||||
}
|
||||
|
||||
~RSAManaged ()
|
||||
@@ -164,7 +162,7 @@ namespace Mono.Security.Cryptography {
|
||||
}
|
||||
|
||||
// note: this property will exist in RSACryptoServiceProvider in
|
||||
// version 1.2 of the framework
|
||||
// version 2.0 of the framework
|
||||
public bool PublicOnly {
|
||||
get { return ((d == null) || (n == null)); }
|
||||
}
|
||||
@@ -183,6 +181,16 @@ namespace Mono.Security.Cryptography {
|
||||
GenerateKeyPair ();
|
||||
|
||||
BigInteger input = new BigInteger (rgb);
|
||||
BigInteger r = null;
|
||||
|
||||
// we use key blinding (by default) against timing attacks
|
||||
if (keyBlinding) {
|
||||
// x = (r^e * g) mod n
|
||||
// *new* random number (so it's timing is also random)
|
||||
r = BigInteger.GenerateRandom (n.BitCount ());
|
||||
input = r.ModPow (e, n) * input % n;
|
||||
}
|
||||
|
||||
BigInteger output;
|
||||
// decrypt (which uses the private key) can be
|
||||
// optimized by using CRT (Chinese Remainder Theorem)
|
||||
@@ -196,20 +204,26 @@ namespace Mono.Security.Cryptography {
|
||||
// thanks to benm!
|
||||
h = p - ((m2 - m1) * qInv % p);
|
||||
output = m2 + q * h;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// h = (m1 - m2) * qInv mod p
|
||||
h = (m1 - m2) * qInv % p;
|
||||
// m = m2 + q * h;
|
||||
output = m2 + q * h;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// m = c^d mod n
|
||||
output = input.ModPow (d, n);
|
||||
}
|
||||
|
||||
if (keyBlinding) {
|
||||
// Complete blinding
|
||||
// x^e / r mod n
|
||||
output = output * r.ModInverse (n) % n;
|
||||
r.Clear ();
|
||||
}
|
||||
|
||||
byte[] result = output.GetBytes ();
|
||||
// zeroize value
|
||||
// zeroize values
|
||||
input.Clear ();
|
||||
output.Clear ();
|
||||
return result;
|
||||
@@ -245,7 +259,7 @@ namespace Mono.Security.Cryptography {
|
||||
param.Modulus = n.GetBytes ();
|
||||
if (includePrivateParameters) {
|
||||
// some parameters are required for exporting the private key
|
||||
if ((d == null) || (p == null) || (q == null))
|
||||
if (d == null)
|
||||
throw new CryptographicException ("Missing private key");
|
||||
param.D = d.GetBytes ();
|
||||
// hack for bugzilla #57941 where D wasn't provided
|
||||
@@ -254,11 +268,11 @@ namespace Mono.Security.Cryptography {
|
||||
Buffer.BlockCopy (param.D, 0, normalizedD, (normalizedD.Length - param.D.Length), param.D.Length);
|
||||
param.D = normalizedD;
|
||||
}
|
||||
param.P = p.GetBytes ();
|
||||
param.Q = q.GetBytes ();
|
||||
// but CRT parameters are optionals
|
||||
if ((dp != null) && (dq != null) && (qInv != null)) {
|
||||
if ((p != null) && (q != null) && (dp != null) && (dq != null) && (qInv != null)) {
|
||||
// and we include them only if we have them all
|
||||
param.P = p.GetBytes ();
|
||||
param.Q = q.GetBytes ();
|
||||
param.DP = dp.GetBytes ();
|
||||
param.DQ = dq.GetBytes ();
|
||||
param.InverseQ = qInv.GetBytes ();
|
||||
@@ -348,5 +362,98 @@ namespace Mono.Security.Cryptography {
|
||||
public delegate void KeyGeneratedEventHandler (object sender, EventArgs e);
|
||||
|
||||
public event KeyGeneratedEventHandler KeyGenerated;
|
||||
|
||||
public override string ToXmlString (bool includePrivateParameters)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
RSAParameters rsaParams = ExportParameters (includePrivateParameters);
|
||||
try {
|
||||
sb.Append ("<RSAKeyValue>");
|
||||
|
||||
sb.Append ("<Modulus>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.Modulus));
|
||||
sb.Append ("</Modulus>");
|
||||
|
||||
sb.Append ("<Exponent>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.Exponent));
|
||||
sb.Append ("</Exponent>");
|
||||
|
||||
if (includePrivateParameters) {
|
||||
if (rsaParams.P != null) {
|
||||
sb.Append ("<P>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.P));
|
||||
sb.Append ("</P>");
|
||||
}
|
||||
if (rsaParams.Q != null) {
|
||||
sb.Append ("<Q>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.Q));
|
||||
sb.Append ("</Q>");
|
||||
}
|
||||
if (rsaParams.DP != null) {
|
||||
sb.Append ("<DP>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.DP));
|
||||
sb.Append ("</DP>");
|
||||
}
|
||||
if (rsaParams.DQ != null) {
|
||||
sb.Append ("<DQ>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.DQ));
|
||||
sb.Append ("</DQ>");
|
||||
}
|
||||
if (rsaParams.InverseQ != null) {
|
||||
sb.Append ("<InverseQ>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.InverseQ));
|
||||
sb.Append ("</InverseQ>");
|
||||
}
|
||||
sb.Append ("<D>");
|
||||
sb.Append (Convert.ToBase64String (rsaParams.D));
|
||||
sb.Append ("</D>");
|
||||
}
|
||||
|
||||
sb.Append ("</RSAKeyValue>");
|
||||
}
|
||||
catch {
|
||||
if (rsaParams.P != null)
|
||||
Array.Clear (rsaParams.P, 0, rsaParams.P.Length);
|
||||
if (rsaParams.Q != null)
|
||||
Array.Clear (rsaParams.Q, 0, rsaParams.Q.Length);
|
||||
if (rsaParams.DP != null)
|
||||
Array.Clear (rsaParams.DP, 0, rsaParams.DP.Length);
|
||||
if (rsaParams.DQ != null)
|
||||
Array.Clear (rsaParams.DQ, 0, rsaParams.DQ.Length);
|
||||
if (rsaParams.InverseQ != null)
|
||||
Array.Clear (rsaParams.InverseQ, 0, rsaParams.InverseQ.Length);
|
||||
if (rsaParams.D != null)
|
||||
Array.Clear (rsaParams.D, 0, rsaParams.D.Length);
|
||||
throw;
|
||||
}
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
// internal for Mono 1.0.x in order to preserve public contract
|
||||
// they are public for Mono 1.1.x (for 1.2) as the API isn't froze ATM
|
||||
|
||||
#if NET_2_0
|
||||
public
|
||||
#else
|
||||
internal
|
||||
#endif
|
||||
bool UseKeyBlinding {
|
||||
get { return keyBlinding; }
|
||||
// you REALLY shoudn't touch this (true is fine ;-)
|
||||
set { keyBlinding = value; }
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public
|
||||
#else
|
||||
internal
|
||||
#endif
|
||||
bool IsCrtPossible {
|
||||
// either the key pair isn't generated (and will be
|
||||
// generated with CRT parameters) or CRT is (or isn't)
|
||||
// possible (in case the key was imported)
|
||||
get { return (!keypairGenerated || isCRTpossible); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
2004-11-23 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* RecordProtocol.cs: Fixed ClientHelloV2 support.
|
||||
|
||||
2004-11-10 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* CipherSuiteFactory.cs, Context.cs, RecordProtocol.cs: Merge from
|
||||
|
||||
@@ -88,6 +88,9 @@ namespace Mono.Security.Protocol.Tls
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set last handshake message received to None
|
||||
this.context.LastHandshakeMsg = HandshakeType.ClientHello;
|
||||
|
||||
ContentType contentType = (ContentType)type;
|
||||
byte[] buffer = this.ReadRecordBuffer(type);
|
||||
|
||||
@@ -107,9 +110,6 @@ namespace Mono.Security.Protocol.Tls
|
||||
}
|
||||
}
|
||||
|
||||
// Set last handshake message received to None
|
||||
this.context.LastHandshakeMsg = HandshakeType.None;
|
||||
|
||||
// Process record
|
||||
byte[] result = message.ToArray();
|
||||
|
||||
@@ -540,9 +540,9 @@ namespace Mono.Security.Protocol.Tls
|
||||
if (check == 0)
|
||||
{
|
||||
// SSL/TLS cipher spec
|
||||
int index = 0;
|
||||
short code = codes.ReadInt16();
|
||||
if ((index = this.Context.SupportedCiphers.IndexOf(code)) != -1)
|
||||
short code = codes.ReadInt16();
|
||||
int index = this.Context.SupportedCiphers.IndexOf(code);
|
||||
if (index != -1)
|
||||
{
|
||||
this.Context.Cipher = this.Context.SupportedCiphers[index];
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
2004-12-19 Daniel Morgan <[email protected]>
|
||||
|
||||
* OracleCommand.cs: ExecuteReader needs to be able
|
||||
to handle non queries too (retrofitted from trunk)
|
||||
|
||||
* ChangeLog: added file
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
// Namespace: System.Data.OracleClient
|
||||
//
|
||||
// Authors:
|
||||
// Daniel Morgan <danmorg@sc.rr.com>
|
||||
// Daniel Morgan <danielmorg[email protected]>
|
||||
// Tim Coleman <[email protected]>
|
||||
//
|
||||
// Copyright (C) Daniel Morgan, 2002
|
||||
// Copyright (C) Daniel Morgan, 2002, 2004
|
||||
// Copyright (C) Tim Coleman , 2003
|
||||
//
|
||||
// Licensed under the MIT/X11 License.
|
||||
@@ -290,6 +290,16 @@ namespace System.Data.OracleClient {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
private bool IsNonQuery (OciStatementHandle statementHandle) {
|
||||
// assumes Prepare() has been called prior to calling this function
|
||||
|
||||
OciStatementType statementType = statementHandle.GetStatementType ();
|
||||
if (statementType.Equals (OciStatementType.Select))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public OracleDataReader ExecuteReader ()
|
||||
{
|
||||
return ExecuteReader (CommandBehavior.Default);
|
||||
@@ -314,8 +324,14 @@ namespace System.Data.OracleClient {
|
||||
else
|
||||
preparedStatement = null; // OracleDataReader releases the statement handle
|
||||
|
||||
bool isNonQuery = IsNonQuery (statement);
|
||||
|
||||
BindParameters (statement);
|
||||
hasRows = statement.ExecuteQuery ();
|
||||
|
||||
if (isNonQuery)
|
||||
ExecuteNonQueryInternal (statement, false);
|
||||
else
|
||||
hasRows = statement.ExecuteQuery ();
|
||||
|
||||
rd = new OracleDataReader (this, statement, hasRows);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,42 @@
|
||||
2005-01-20 Sureshkumar T <[email protected]>
|
||||
|
||||
* OdbcDataReader.cs: case for type OdbcType.Double added in
|
||||
GetValue. fixes bug #71173.
|
||||
|
||||
Thanks to patch given by "Appasamy T" <[email protected]>
|
||||
|
||||
2005-01-19 Sureshkumar T <[email protected]>
|
||||
|
||||
* OdbcDataReader.cs: Implement NextResultSet for multiple result
|
||||
set queries.
|
||||
|
||||
* OdbcDataReader.cs: build column schema once creating reader and
|
||||
then for each Next result set. Thanks to
|
||||
[email protected] (Sebastien Robitaille) for
|
||||
pointing out this optimization (bugzilla #70530).
|
||||
|
||||
* libodbc.cs: Added library calls SQLFreeStmt and SQLMoreResults
|
||||
for mutiple resultsets.
|
||||
|
||||
2005-01-19 Sureshkumar T <[email protected]>
|
||||
|
||||
* OdbcDataReader.cs: Pass OdbcCType.SignedBigInt for accessing big
|
||||
int columns.
|
||||
|
||||
* OdbcType.cs: Added a new enum for Odbc C DataTypes. This should
|
||||
essentially be passed to drivers, since the public OdbcType types
|
||||
differs from types expected in drivers in some cases.
|
||||
|
||||
* libodbc.cs : Added a ODBC method which takes OdbcCType
|
||||
enumeration for SQLGetData for BigInt fields.
|
||||
|
||||
fixes bug #65342.
|
||||
|
||||
2005-01-11 Sureshkumar T <[email protected]>
|
||||
|
||||
* OdbcDataReader.cs: Connection has to be closed only after
|
||||
Statement handle is freed. fixes bug #70048
|
||||
|
||||
2004-08-31 Umadevi S ([email protected])
|
||||
* OdbcDataReader.cs - Fixed Decimal parsing
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace System.Data.Odbc
|
||||
short colcount=0;
|
||||
libodbc.SQLNumResultCols(hstmt, ref colcount);
|
||||
cols=new OdbcColumn[colcount];
|
||||
GetSchemaTable ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -132,11 +133,11 @@ namespace System.Data.Odbc
|
||||
int i=0;
|
||||
foreach (OdbcColumn col in cols)
|
||||
{
|
||||
if (col.ColumnName==colname)
|
||||
if (col != null && col.ColumnName==colname)
|
||||
return i;
|
||||
i++;
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Dynamically load column descriptions as needed.
|
||||
@@ -170,18 +171,21 @@ namespace System.Data.Odbc
|
||||
public void Close ()
|
||||
{
|
||||
|
||||
OdbcReturn ret=libodbc.SQLCloseCursor(hstmt);
|
||||
// FIXME : have to implement output parameter binding
|
||||
OdbcReturn ret = libodbc.SQLFreeStmt (hstmt, libodbc.SQLFreeStmtOptions.Close);
|
||||
if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
|
||||
throw new OdbcException(new OdbcError("SQLCloseCursor",OdbcHandleType.Stmt,hstmt));
|
||||
|
||||
open = false;
|
||||
currentRow = -1;
|
||||
|
||||
if ((behavior & CommandBehavior.CloseConnection)==CommandBehavior.CloseConnection)
|
||||
this.command.Connection.Close();
|
||||
ret = libodbc.SQLFreeHandle( (ushort) OdbcHandleType.Stmt, hstmt);
|
||||
if ((ret!=OdbcReturn.Success) && (ret!=OdbcReturn.SuccessWithInfo))
|
||||
throw new OdbcException(new OdbcError("SQLFreeHandle",OdbcHandleType.Stmt,hstmt));
|
||||
|
||||
if ((behavior & CommandBehavior.CloseConnection)==CommandBehavior.CloseConnection)
|
||||
this.command.Connection.Close();
|
||||
|
||||
}
|
||||
|
||||
~OdbcDataReader ()
|
||||
@@ -335,9 +339,6 @@ namespace System.Data.Odbc
|
||||
|
||||
public int GetOrdinal (string name)
|
||||
{
|
||||
if (currentRow == -1)
|
||||
throw new IndexOutOfRangeException ();
|
||||
|
||||
int i=ColIndex(name);
|
||||
|
||||
if (i==-1)
|
||||
@@ -497,7 +498,7 @@ namespace System.Data.Odbc
|
||||
break;
|
||||
case OdbcType.BigInt:
|
||||
long long_data=0;
|
||||
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.BigInt, ref long_data, 0, ref outsize);
|
||||
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcCType.SignedBigInt, ref long_data, 0, ref outsize);
|
||||
DataValue=long_data;
|
||||
break;
|
||||
case OdbcType.NVarChar:
|
||||
@@ -519,6 +520,11 @@ namespace System.Data.Odbc
|
||||
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Real, ref float_data, 0, ref outsize);
|
||||
DataValue=float_data;
|
||||
break;
|
||||
case OdbcType.Double:
|
||||
double double_data=0;
|
||||
ret=libodbc.SQLGetData(hstmt, ColIndex, OdbcType.Double, ref double_data, 0, ref outsize);
|
||||
DataValue=double_data;
|
||||
break;
|
||||
case OdbcType.Timestamp:
|
||||
case OdbcType.DateTime:
|
||||
case OdbcType.Date:
|
||||
@@ -610,27 +616,45 @@ namespace System.Data.Odbc
|
||||
return (GetValue(ordinal) is DBNull);
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// Move to the next result set.
|
||||
/// </remarks>
|
||||
public bool NextResult ()
|
||||
{
|
||||
OdbcReturn ret=libodbc.SQLFetch(hstmt);
|
||||
if (ret!=OdbcReturn.Success)
|
||||
currentRow=-1;
|
||||
OdbcReturn ret = OdbcReturn.Success;
|
||||
ret = libodbc.SQLMoreResults (hstmt);
|
||||
if (ret == OdbcReturn.Success) {
|
||||
short colcount = 0;
|
||||
libodbc.SQLNumResultCols (hstmt, ref colcount);
|
||||
cols = new OdbcColumn [colcount];
|
||||
GetSchemaTable ();
|
||||
}
|
||||
return (ret==OdbcReturn.Success);
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// Load the next row in the current result set.
|
||||
/// </remarks>
|
||||
public bool NextRow ()
|
||||
{
|
||||
OdbcReturn ret=libodbc.SQLFetch (hstmt);
|
||||
if (ret != OdbcReturn.Success)
|
||||
currentRow = -1;
|
||||
else
|
||||
currentRow++;
|
||||
GetSchemaTable();
|
||||
|
||||
|
||||
// Clear cached values from last record
|
||||
foreach (OdbcColumn col in cols)
|
||||
{
|
||||
if (col!=null)
|
||||
col.Value=null;
|
||||
if (col != null)
|
||||
col.Value = null;
|
||||
}
|
||||
return (ret==OdbcReturn.Success);
|
||||
return (ret == OdbcReturn.Success);
|
||||
}
|
||||
|
||||
public bool Read ()
|
||||
{
|
||||
return NextResult();
|
||||
return NextRow ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//
|
||||
// System.Data.Odbc.OdbcType
|
||||
//
|
||||
// Author:
|
||||
// Brian Ritchie
|
||||
//
|
||||
// Copyright (C) Brian Ritchie, 2002
|
||||
//
|
||||
//
|
||||
// System.Data.Odbc.OdbcType
|
||||
//
|
||||
// Author:
|
||||
// Brian Ritchie
|
||||
//
|
||||
// Copyright (C) Brian Ritchie, 2002
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
@@ -29,53 +29,62 @@
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace System.Data.Odbc
|
||||
{
|
||||
|
||||
// From the ODBC documentation:
|
||||
//
|
||||
// In ODBC 3.x, the identifiers for date, time, and timestamp SQL data types
|
||||
// have changed from SQL_DATE, SQL_TIME, and SQL_TIMESTAMP (with instances of
|
||||
// #define in the header file of 9, 10, and 11) to SQL_TYPE_DATE, SQL_TYPE_TIME,
|
||||
// and SQL_TYPE_TIMESTAMP (with instances of #define in the header file of 91, 92, and 93),
|
||||
// respectively.
|
||||
|
||||
// Unmapped SQL Types
|
||||
//
|
||||
//#define SQL_FLOAT 6
|
||||
// could map to SQL_DOUBLE?
|
||||
//#define SQL_INTERVAL 10
|
||||
// could map to SmallDateTime?
|
||||
|
||||
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace System.Data.Odbc
|
||||
{
|
||||
|
||||
// From the ODBC documentation:
|
||||
//
|
||||
// In ODBC 3.x, the identifiers for date, time, and timestamp SQL data types
|
||||
// have changed from SQL_DATE, SQL_TIME, and SQL_TIMESTAMP (with instances of
|
||||
// #define in the header file of 9, 10, and 11) to SQL_TYPE_DATE, SQL_TYPE_TIME,
|
||||
// and SQL_TYPE_TIMESTAMP (with instances of #define in the header file of 91, 92, and 93),
|
||||
// respectively.
|
||||
|
||||
// Unmapped SQL Types
|
||||
//
|
||||
//#define SQL_FLOAT 6
|
||||
// could map to SQL_DOUBLE?
|
||||
//#define SQL_INTERVAL 10
|
||||
// could map to SmallDateTime?
|
||||
|
||||
public enum OdbcType
|
||||
{
|
||||
BigInt=-5, // SQL_BIGINT
|
||||
Binary=-2, // SQL_BINARY
|
||||
Bit=-7, // SQL_BIT
|
||||
Char=1, // SQL_CHAR
|
||||
Date=91, // SQL_TYPE_DATE
|
||||
DateTime=9, // SQL_DATETIME
|
||||
Decimal=3, // SQL_DECIMAL
|
||||
Double=8, // SQL_DOUBLE
|
||||
Image=-4, // SQL_LONGVARBINARY
|
||||
Int=4, // SQL_INTEGER
|
||||
NChar=-95, // SQL_UNICODE_CHAR
|
||||
NText=-97, // SQL_UNICODE_LONGVARCHAR
|
||||
Numeric=2, // SQL_NUMERIC
|
||||
NVarChar=-96, // SQL_UNICODE_VARCHAR
|
||||
Real=7, // SQL_REAL
|
||||
SmallDateTime=0,// ??????????????????????????
|
||||
SmallInt=5, // SQL_SMALLINT
|
||||
Time=92, // SQL_TYPE_TIME
|
||||
Text=-1, // SQL_LONGVARCHAR
|
||||
Timestamp=93, // SQL_TYPE_TIMESTAMP
|
||||
TinyInt=-6, // SQL_TINYINT
|
||||
UniqueIdentifier=-11, // SQL_GUID
|
||||
VarBinary=-3, // SQL_VARBINARY
|
||||
VarChar=12 // SQL_VARCHAR
|
||||
}
|
||||
}
|
||||
{
|
||||
BigInt=-5, // SQL_BIGINT
|
||||
Binary=-2, // SQL_BINARY
|
||||
Bit=-7, // SQL_BIT
|
||||
Char=1, // SQL_CHAR
|
||||
Date=91, // SQL_TYPE_DATE
|
||||
DateTime=9, // SQL_DATETIME
|
||||
Decimal=3, // SQL_DECIMAL
|
||||
Double=8, // SQL_DOUBLE
|
||||
Image=-4, // SQL_LONGVARBINARY
|
||||
Int=4, // SQL_INTEGER
|
||||
NChar=-95, // SQL_UNICODE_CHAR
|
||||
NText=-97, // SQL_UNICODE_LONGVARCHAR
|
||||
Numeric=2, // SQL_NUMERIC
|
||||
NVarChar=-96, // SQL_UNICODE_VARCHAR
|
||||
Real=7, // SQL_REAL
|
||||
SmallDateTime=0,// ??????????????????????????
|
||||
SmallInt=5, // SQL_SMALLINT
|
||||
Time=92, // SQL_TYPE_TIME
|
||||
Text=-1, // SQL_LONGVARCHAR
|
||||
Timestamp=93, // SQL_TYPE_TIMESTAMP
|
||||
TinyInt=-6, // SQL_TINYINT
|
||||
UniqueIdentifier=-11, // SQL_GUID
|
||||
VarBinary=-3, // SQL_VARBINARY
|
||||
VarChar=12 // SQL_VARCHAR
|
||||
}
|
||||
|
||||
// This internal enum is used as mapping types into database drivers.
|
||||
// This is essentially a map between public OdbcType to C types for
|
||||
// Odbc to call into driver.
|
||||
internal enum OdbcCType
|
||||
{
|
||||
SignedBigInt=-25 // SQL_C_SBIGINT
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace System.Data.Odbc
|
||||
CPMatch = 202
|
||||
}
|
||||
|
||||
internal enum OdbcConnectionAttribute : int
|
||||
internal enum OdbcConnectionAttribute : int
|
||||
{
|
||||
AutoCommit=102,
|
||||
TransactionIsolation=108
|
||||
@@ -210,27 +210,43 @@ namespace System.Data.Odbc
|
||||
internal static extern OdbcReturn SQLCloseCursor(IntPtr StatementHandle);
|
||||
|
||||
[DllImport("odbc32")]
|
||||
internal static extern OdbcReturn SQLError(IntPtr EnvironmentHandle,
|
||||
IntPtr ConnectionHandle, IntPtr StatementHandle,
|
||||
byte[] Sqlstate, ref int NativeError,
|
||||
byte[] MessageText, short BufferLength,
|
||||
ref short TextLength);
|
||||
|
||||
internal static extern OdbcReturn SQLError(IntPtr EnvironmentHandle,
|
||||
IntPtr ConnectionHandle, IntPtr StatementHandle,
|
||||
byte[] Sqlstate, ref int NativeError,
|
||||
byte[] MessageText, short BufferLength,
|
||||
ref short TextLength);
|
||||
|
||||
[DllImport("odbc32")]
|
||||
internal static extern OdbcReturn SQLGetStmtAttr(IntPtr StatementHandle,
|
||||
int Attribute, ref IntPtr Value, int BufLen, int StrLen);
|
||||
|
||||
[DllImport("odbc32")]
|
||||
internal static extern OdbcReturn SQLGetStmtAttr(IntPtr StatementHandle,
|
||||
int Attribute, ref IntPtr Value, int BufLen, int StrLen);
|
||||
|
||||
[DllImport("odbc32")]
|
||||
internal static extern OdbcReturn SQLSetDescField(IntPtr DescriptorHandle,
|
||||
short RecNumber, short FieldIdentifier, byte[] Value, int BufLen);
|
||||
internal static extern OdbcReturn SQLSetDescField(IntPtr DescriptorHandle,
|
||||
short RecNumber, short FieldIdentifier, byte[] Value, int BufLen);
|
||||
|
||||
[DllImport("odbc32")]
|
||||
internal static extern OdbcReturn SQLGetDiagRec (OdbcHandleType HandleType,
|
||||
IntPtr Handle, ushort RecordNumber,
|
||||
byte [] Sqlstate, ref int NativeError,
|
||||
byte [] MessageText, short BufferLength,
|
||||
ref short TextLength);
|
||||
|
||||
internal static extern OdbcReturn SQLGetDiagRec (OdbcHandleType HandleType,
|
||||
IntPtr Handle, ushort RecordNumber,
|
||||
byte [] Sqlstate, ref int NativeError,
|
||||
byte [] MessageText, short BufferLength,
|
||||
ref short TextLength);
|
||||
|
||||
|
||||
}
|
||||
[DllImport("odbc32.dll")]
|
||||
internal static extern OdbcReturn SQLGetData (IntPtr StatementHandle, ushort ColumnNumber, OdbcCType TargetType, ref long TargetPtr, int BufferLen, ref int Len);
|
||||
|
||||
[DllImport ("odbc32.dll")]
|
||||
internal static extern OdbcReturn SQLMoreResults (IntPtr Handle);
|
||||
|
||||
internal enum SQLFreeStmtOptions : short
|
||||
{
|
||||
Close = 0,
|
||||
Drop,
|
||||
Unbind,
|
||||
ResetParams
|
||||
}
|
||||
|
||||
[DllImport ("odbc32.dll")]
|
||||
internal static extern OdbcReturn SQLFreeStmt (IntPtr Handle, SQLFreeStmtOptions option);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,54 @@
|
||||
2005-01-28 Sureshkumar T <[email protected]>
|
||||
|
||||
* DataRow.cs: CopyValuesToRow : set the column value with the
|
||||
default version of the given row.
|
||||
* DataTable.cs: ImportRow: Copy values before adding row.
|
||||
* DataSet.cs: AddChangedRow: Add the row to the table after
|
||||
copying values.
|
||||
|
||||
Fixes bug #67317. Patch by Ankit Jain.
|
||||
|
||||
2005-01-19 Sureshkumar T <[email protected]>
|
||||
|
||||
* DataRelationCollection.cs:
|
||||
|
||||
Method Remove : Donot throw exception if DataRelation argument is
|
||||
null in DataRelationCollection.Remove method.
|
||||
|
||||
Method RemoveAt : Exception should be IndexOutOfRangeException if
|
||||
row index is not in list range.
|
||||
|
||||
Fixes nunit failures DataRelationCollection.Remove and
|
||||
DataRelationCollection.RemoveAt.
|
||||
|
||||
2005-01-19 Sureshkumar T <[email protected]>
|
||||
|
||||
* ConstraintCollection.cs: Donot throw exception if constraints
|
||||
are null in AddRange method. Check for null before using the
|
||||
argument.
|
||||
|
||||
fixes bug #69381.
|
||||
|
||||
2004-01-19 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlDiffLoader.cs : Ankit Jain <[email protected]> has a conflicting
|
||||
patches and some good catches. Some attributes should be skipped,
|
||||
and loaded value must be typed.
|
||||
|
||||
2004-01-19 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlConstants.cs,
|
||||
XmlDataInferenceLoader.cs,
|
||||
XmlDataReader.cs : use common const for http://www.w3.org/2000/xmlns/.
|
||||
* XmlDiffLoader.cs : It was not handling attributes. Fixed bug #70961.
|
||||
|
||||
2004-01-12 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DataSet.cs : When serializing DataTable, BuildSchema() is passed
|
||||
null relation collections.
|
||||
Quick fix for XmlSerializer deserialization. It does not require
|
||||
XML Schema included.
|
||||
|
||||
2004-11-10 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* CustomDataClassGenerator.cs : generated foreign key constraint
|
||||
|
||||
@@ -264,6 +264,9 @@ namespace System.Data {
|
||||
_mostRecentConstraints = constraints;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (constraints == null) || (constraints.Length == 0))
|
||||
return;
|
||||
|
||||
// Check whether the constraint is UniqueConstraint
|
||||
// And whether it was initialized with the special ctor
|
||||
@@ -287,17 +290,9 @@ namespace System.Data {
|
||||
|
||||
}
|
||||
|
||||
if ( (constraints == null) || (constraints.Length == 0))
|
||||
throw new ArgumentNullException ("Cannot add null");
|
||||
|
||||
else {
|
||||
foreach (Constraint constraint in constraints)
|
||||
Add (constraint);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
foreach (Constraint constraint in constraints)
|
||||
Add (constraint);
|
||||
}
|
||||
|
||||
// Helper AddRange() - Call this function when EndInit is called
|
||||
internal void PostEndInit()
|
||||
|
||||
@@ -541,7 +541,7 @@ namespace System.Data {
|
||||
public void Remove (DataRelation relation)
|
||||
{
|
||||
if (relation == null)
|
||||
throw new ArgumentNullException("Relation specified is null");
|
||||
return;
|
||||
|
||||
// check if the list doesnot contains this relation.
|
||||
if (!(List.Contains(relation)))
|
||||
@@ -563,7 +563,7 @@ namespace System.Data {
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
if (( index < 0 ) || (index >=List.Count))
|
||||
throw new ArgumentException("There is no row at position "+index+".");
|
||||
throw new IndexOutOfRangeException ("There is no row at position " + index + ".");
|
||||
Remove(this[index]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1355,8 +1355,7 @@ namespace System.Data {
|
||||
}
|
||||
|
||||
//Saving the current value as the column value
|
||||
row[index] = targetColumn[row._current];
|
||||
|
||||
row [index] = targetColumn [IndexFromVersion (DataRowVersion.Default)];
|
||||
}
|
||||
}
|
||||
CopyState(row);
|
||||
|
||||
@@ -490,8 +490,8 @@ namespace System.Data {
|
||||
}
|
||||
|
||||
DataRow newRow = copyTable.NewRow ();
|
||||
copyTable.Rows.Add (newRow);
|
||||
row.CopyValuesToRow (newRow);
|
||||
copyTable.Rows.Add (newRow);
|
||||
newRow.XmlRowID = row.XmlRowID;
|
||||
addedRows.Add (row,row);
|
||||
}
|
||||
@@ -1044,8 +1044,11 @@ namespace System.Data {
|
||||
reader.MoveToContent ();
|
||||
reader.ReadStartElement ();
|
||||
reader.MoveToContent ();
|
||||
ReadXmlSchema (reader);
|
||||
reader.MoveToContent ();
|
||||
if (reader.LocalName == "schema" &&
|
||||
reader.NamespaceURI == XmlSchema.Namespace) {
|
||||
ReadXmlSchema (reader);
|
||||
reader.MoveToContent ();
|
||||
}
|
||||
ReadXml (reader, XmlReadMode.DiffGram);
|
||||
reader.MoveToContent ();
|
||||
reader.ReadEndElement ();
|
||||
@@ -1406,7 +1409,7 @@ namespace System.Data {
|
||||
nsmgr.AddNamespace (XmlConstants.TnsPrefix, Namespace);
|
||||
nsmgr.AddNamespace (String.Empty, Namespace);
|
||||
}
|
||||
if (CheckExtendedPropertyExists ())
|
||||
if (CheckExtendedPropertyExists (tables, relations))
|
||||
nsmgr.AddNamespace (XmlConstants.MspropPrefix, XmlConstants.MspropNamespace);
|
||||
|
||||
if (atts.Count > 0)
|
||||
@@ -1416,7 +1419,7 @@ namespace System.Data {
|
||||
elem.Name = XmlConvert.EncodeName (DataSetName);
|
||||
|
||||
// Add namespaces used in DataSet components (tables, columns, ...)
|
||||
foreach (DataTable dt in Tables) {
|
||||
foreach (DataTable dt in tables) {
|
||||
foreach (DataColumn col in dt.Columns)
|
||||
CheckNamespace (col.Prefix, col.Namespace, nsmgr, schema);
|
||||
CheckNamespace (dt.Prefix, dt.Namespace, nsmgr, schema);
|
||||
@@ -1475,11 +1478,13 @@ namespace System.Data {
|
||||
return schema;
|
||||
}
|
||||
|
||||
private bool CheckExtendedPropertyExists ()
|
||||
private bool CheckExtendedPropertyExists (
|
||||
DataTableCollection tables,
|
||||
DataRelationCollection relations)
|
||||
{
|
||||
if (ExtendedProperties.Count > 0)
|
||||
return true;
|
||||
foreach (DataTable dt in Tables) {
|
||||
foreach (DataTable dt in tables) {
|
||||
if (dt.ExtendedProperties.Count > 0)
|
||||
return true;
|
||||
foreach (DataColumn col in dt.Columns)
|
||||
@@ -1489,7 +1494,9 @@ namespace System.Data {
|
||||
if (c.ExtendedProperties.Count > 0)
|
||||
return true;
|
||||
}
|
||||
foreach (DataRelation rel in Relations)
|
||||
if (relations == null)
|
||||
return false;
|
||||
foreach (DataRelation rel in relations)
|
||||
if (rel.ExtendedProperties.Count > 0)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@@ -948,9 +948,13 @@ namespace System.Data {
|
||||
/// </summary>
|
||||
public void ImportRow (DataRow row)
|
||||
{
|
||||
if (row.RowState == DataRowState.Detached)
|
||||
return;
|
||||
|
||||
DataRow newRow = NewRow();
|
||||
Rows.Add(newRow);
|
||||
row.CopyValuesToRow(newRow);
|
||||
row.CopyValuesToRow (newRow);
|
||||
Rows.Add (newRow);
|
||||
row.CopyState (newRow);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ internal class XmlConstants
|
||||
/// </summary>
|
||||
public const string SchemaNamespace = "http://www.w3.org/2001/XMLSchema";
|
||||
|
||||
public const string XmlnsNS = "http://www.w3.org/2000/xmlns/";
|
||||
|
||||
//xs elements and values
|
||||
//TODO - these must exist somwhere else???
|
||||
|
||||
@@ -146,8 +146,6 @@ namespace System.Data
|
||||
|
||||
internal class XmlDataInferenceLoader
|
||||
{
|
||||
const string XmlnsNS = "http://www.w3.org/2000/xmlns/";
|
||||
|
||||
public static void Infer (DataSet dataset, XmlDocument document, XmlReadMode mode, string [] ignoredNamespaces)
|
||||
{
|
||||
new XmlDataInferenceLoader (dataset, document, mode, ignoredNamespaces).ReadXml ();
|
||||
@@ -348,7 +346,7 @@ namespace System.Data
|
||||
bool hasText = false;
|
||||
|
||||
foreach (XmlAttribute attr in el.Attributes) {
|
||||
if (attr.NamespaceURI == XmlnsNS)
|
||||
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
|
||||
continue;
|
||||
if (ignoredNamespaces.Contains (attr.NamespaceURI))
|
||||
continue;
|
||||
@@ -460,7 +458,7 @@ namespace System.Data
|
||||
private ElementMappingType GetElementMappingType (XmlElement el)
|
||||
{
|
||||
foreach (XmlAttribute attr in el.Attributes) {
|
||||
if (attr.NamespaceURI == XmlnsNS)
|
||||
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
|
||||
continue;
|
||||
if (ignoredNamespaces.Contains (attr.NamespaceURI))
|
||||
continue;
|
||||
@@ -481,7 +479,7 @@ namespace System.Data
|
||||
{
|
||||
XmlElement top = document.DocumentElement;
|
||||
foreach (XmlAttribute attr in top.Attributes) {
|
||||
if (attr.NamespaceURI == XmlnsNS)
|
||||
if (attr.NamespaceURI == XmlConstants.XmlnsNS)
|
||||
continue;
|
||||
if (ignoredNamespaces.Contains (attr.NamespaceURI))
|
||||
continue;
|
||||
|
||||
@@ -83,8 +83,6 @@ namespace System.Data
|
||||
|
||||
internal class XmlDataReader
|
||||
{
|
||||
const string xmlnsNS = "http://www.w3.org/2000/xmlns/";
|
||||
|
||||
public static void ReadXml (
|
||||
DataSet dataset, XmlReader reader, XmlReadMode mode)
|
||||
{
|
||||
@@ -176,7 +174,7 @@ namespace System.Data
|
||||
// Consume attributes
|
||||
if (reader.MoveToFirstAttribute ()) {
|
||||
do {
|
||||
if (reader.NamespaceURI == xmlnsNS)
|
||||
if (reader.NamespaceURI == XmlConstants.XmlnsNS)
|
||||
continue;
|
||||
ReadElementAttribute (row);
|
||||
} while (reader.MoveToNextAttribute ());
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.XPath;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
@@ -211,7 +212,45 @@ namespace System.Data {
|
||||
reader.ReadEndElement ();
|
||||
}
|
||||
|
||||
private void LoadColumns (DataTable Table, DataRow Row, XmlReader reader, DataRowVersion loadType)
|
||||
private void LoadColumns (DataTable Table, DataRow Row,
|
||||
XmlReader reader, DataRowVersion loadType)
|
||||
{
|
||||
LoadColumnAttributes (Table, Row, reader, loadType);
|
||||
LoadColumnChildren (Table, Row, reader, loadType);
|
||||
}
|
||||
|
||||
private void LoadColumnAttributes (DataTable Table, DataRow Row,
|
||||
XmlReader reader, DataRowVersion loadType)
|
||||
{
|
||||
if (!reader.HasAttributes // this check will be faster
|
||||
|| !reader.MoveToFirstAttribute ())
|
||||
return;
|
||||
do {
|
||||
switch (reader.NamespaceURI) {
|
||||
case XmlConstants.XmlnsNS:
|
||||
case XmlConstants.DiffgrNamespace:
|
||||
case XmlConstants.MsdataNamespace:
|
||||
case XmlConstants.MspropNamespace:
|
||||
case XmlSchema.Namespace:
|
||||
continue;
|
||||
}
|
||||
DataColumn c = Table.Columns [reader.LocalName];
|
||||
if (c == null ||
|
||||
c.ColumnMapping != MappingType.Attribute) continue;
|
||||
if (c.Namespace == null && reader.NamespaceURI == String.Empty ||
|
||||
c.Namespace == reader.NamespaceURI) {
|
||||
object data = XmlDataLoader.StringToObject (c.DataType, reader.Value);
|
||||
if (loadType == DataRowVersion.Current)
|
||||
Row [c] = data;
|
||||
else
|
||||
Row.SetOriginalValue (c.ColumnName, data);
|
||||
} // otherwise just ignore as well as unknown elements.
|
||||
} while (reader.MoveToNextAttribute ());
|
||||
reader.MoveToElement ();
|
||||
}
|
||||
|
||||
private void LoadColumnChildren (DataTable Table, DataRow Row,
|
||||
XmlReader reader, DataRowVersion loadType)
|
||||
{
|
||||
if (reader.IsEmptyElement) {
|
||||
reader.Skip ();
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
2005-01-28 Sureshkumar T <[email protected]>
|
||||
|
||||
* DataTableTest.cs: added test case for checking ImportRow when
|
||||
the row state is detached. Test case by Ankit Jain.
|
||||
|
||||
2005-01-19 Sureshkumar T <[email protected]>
|
||||
|
||||
* DataRelationCollectionTest.cs:
|
||||
"Remove" Method: Should not throw
|
||||
exception while removing null data relaiton.
|
||||
"RemoveAt" Method: Should throw only IndexOutRange exception
|
||||
not ArgumentException.
|
||||
|
||||
This is same for all MS.NET versions.
|
||||
|
||||
2004-10-12 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DataSetTest.cs : now xs:schema contains xmlns="".
|
||||
|
||||
@@ -299,15 +299,7 @@ namespace MonoTests.System.Data
|
||||
drcol.Add(dr1);
|
||||
|
||||
DataRelation drnull = null;
|
||||
try
|
||||
{
|
||||
drcol.Remove(drnull);
|
||||
Fail("Err:: drcol.Remove(null) must fail");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
AssertEquals("test#3", typeof (ArgumentNullException), e.GetType());
|
||||
}
|
||||
drcol.Remove(drnull);
|
||||
|
||||
DataRelation newdr = new DataRelation("newdr"
|
||||
,_dataset.Tables["Customer"].Columns["custid"]
|
||||
@@ -354,7 +346,7 @@ namespace MonoTests.System.Data
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
AssertEquals ("test#1", typeof (ArgumentException), e.GetType ());
|
||||
AssertEquals ("test#1", typeof (IndexOutOfRangeException), e.GetType ());
|
||||
AssertEquals ("test#2", "There is no row at position -1.", e.Message);
|
||||
}
|
||||
try
|
||||
@@ -364,7 +356,7 @@ namespace MonoTests.System.Data
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
AssertEquals ("test#3", typeof (ArgumentException), e.GetType ());
|
||||
AssertEquals ("test#3", typeof (IndexOutOfRangeException), e.GetType ());
|
||||
AssertEquals ("test#4", "There is no row at position 101.",e.Message);
|
||||
}
|
||||
|
||||
|
||||
@@ -1111,6 +1111,28 @@ namespace MonoTests.System.Data
|
||||
AssertEquals ("#A03", DataRowState.Modified, table.Rows [2].RowState);
|
||||
AssertEquals ("#A04", DataRowState.Added, table.Rows [3].RowState);
|
||||
}
|
||||
public void ImportRow2 ()
|
||||
{
|
||||
DataTable table = new DataTable ();
|
||||
DataColumn col = new DataColumn ();
|
||||
col.ColumnName = "Id";
|
||||
col.DataType = Type.GetType ("System.Int32");
|
||||
table.Columns.Add (col);
|
||||
|
||||
table.PrimaryKey = new DataColumn [] {col};
|
||||
|
||||
col = new DataColumn ();
|
||||
col.ColumnName = "Name";
|
||||
col.DataType = Type.GetType ("System.String");
|
||||
table.Columns.Add (col);
|
||||
|
||||
DataRow row = table.NewRow ();
|
||||
row ["Id"] = 147;
|
||||
row ["name"] = "Abc";
|
||||
|
||||
table.ImportRow (row);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClearReset () //To test Clear and Reset methods
|
||||
{
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2004-12-06 Miguel de Icaza <[email protected]>
|
||||
|
||||
* FontFamily.cs: Families is static.
|
||||
|
||||
2004-11-03 Miguel de Icaza <[email protected]>
|
||||
|
||||
* TextureBrush.cs (Clone): While cloning, it is not enough to let
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace System.Drawing {
|
||||
}
|
||||
|
||||
|
||||
public FontFamily[] Families
|
||||
public static FontFamily[] Families
|
||||
{
|
||||
get {
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2004-12-17 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* HttpHelper.cs: Removed unused method. Optimized CopyStream method.
|
||||
* HttpServerChannel.cs: SendResponse does not return a bool any
|
||||
more, it throws an exception when it fails.
|
||||
* HttpServer.cs: Improved handling of errors.
|
||||
|
||||
2004-05-26 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* HttpServerChannel.cs: Default port is 0.
|
||||
|
||||
+14
-16
@@ -326,9 +326,9 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
requestHeaders [CommonTransportKeys.RequestUri] = uri;
|
||||
CreateUrl(uri,out url);
|
||||
|
||||
HttpWebRequest httpWebRequest = CreateWebRequest(url,requestHeaders,requestStream);
|
||||
HttpWebRequest httpWebRequest = CreateWebRequest (url,requestHeaders,requestStream);
|
||||
|
||||
SendAndRecieve(httpWebRequest,out responseHeaders,out responseStream);
|
||||
SendAndRecieve (httpWebRequest,out responseHeaders,out responseStream);
|
||||
}
|
||||
|
||||
|
||||
@@ -567,15 +567,11 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
}
|
||||
|
||||
Stream reqStream = request.GetRequestStream();
|
||||
if (requestStream is MemoryStream)
|
||||
{
|
||||
MemoryStream memStream = (MemoryStream)requestStream;
|
||||
reqStream.Write (memStream.GetBuffer(), 0, (int)memStream.Length);
|
||||
}
|
||||
else
|
||||
try {
|
||||
HttpHelper.CopyStream(requestStream, reqStream);
|
||||
|
||||
reqStream.Close();
|
||||
} finally {
|
||||
reqStream.Close();
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
@@ -602,17 +598,19 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
private void ReceiveResponse (HttpWebResponse httpWebResponse, out ITransportHeaders responseHeaders, out Stream responseStream)
|
||||
{
|
||||
responseHeaders = new TransportHeaders();
|
||||
Stream webStream = httpWebResponse.GetResponseStream();
|
||||
|
||||
try
|
||||
{
|
||||
Stream webStream = httpWebResponse.GetResponseStream();
|
||||
|
||||
if (httpWebResponse.ContentLength != -1)
|
||||
{
|
||||
byte[] buffer = new byte [httpWebResponse.ContentLength];
|
||||
int nr = 0;
|
||||
while (nr < buffer.Length)
|
||||
nr += webStream.Read (buffer, nr, buffer.Length - nr);
|
||||
while (nr < buffer.Length) {
|
||||
int pr = webStream.Read (buffer, nr, buffer.Length - nr);
|
||||
if (pr == 0) throw new RemotingException ("Connection closed");
|
||||
nr += pr;
|
||||
}
|
||||
responseStream = new MemoryStream (buffer);
|
||||
}
|
||||
else
|
||||
@@ -632,8 +630,8 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(httpWebResponse!=null)
|
||||
httpWebResponse.Close();
|
||||
webStream.Close ();
|
||||
httpWebResponse.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-51
@@ -73,60 +73,18 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Stream CopyStream(Stream inStream)
|
||||
public static void CopyStream (Stream inStream, Stream outStream)
|
||||
{
|
||||
|
||||
Stream outStream = new MemoryStream();
|
||||
|
||||
int temp;
|
||||
|
||||
try
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
temp = inStream.ReadByte();
|
||||
if(temp==-1)
|
||||
break;
|
||||
outStream.WriteByte((byte)temp);
|
||||
}
|
||||
outStream.Flush();
|
||||
outStream.Seek(0,SeekOrigin.Begin);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
|
||||
return outStream;
|
||||
}
|
||||
byte[] buffer = new byte [1024];
|
||||
|
||||
public static bool CopyStream(Stream inStream, Stream outStream)
|
||||
{
|
||||
int temp;
|
||||
int nr;
|
||||
while ((nr = inStream.Read (buffer, 0, buffer.Length)) > 0)
|
||||
outStream.Write (buffer, 0, nr);
|
||||
|
||||
try
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
temp = inStream.ReadByte();
|
||||
|
||||
if(temp==-1)
|
||||
break;
|
||||
outStream.WriteByte((byte)temp);
|
||||
}
|
||||
|
||||
outStream.Flush();
|
||||
|
||||
if(outStream.CanSeek)
|
||||
outStream.Seek(0,SeekOrigin.Begin);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
outStream.Flush ();
|
||||
|
||||
if (outStream.CanSeek)
|
||||
outStream.Seek (0,SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
public static String GetHostName()
|
||||
|
||||
+7
-26
@@ -59,12 +59,6 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
Sink = sink;
|
||||
}
|
||||
|
||||
public RequestArguments (Stream inputStream, Stream outputStream, HttpServerTransportSink sink)
|
||||
{
|
||||
InputStream = inputStream;
|
||||
OutputStream = outputStream;
|
||||
Sink = sink;
|
||||
}
|
||||
public Stream InputStream;
|
||||
public Stream OutputStream;
|
||||
public HttpServerTransportSink Sink;
|
||||
@@ -105,9 +99,8 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
else
|
||||
buffer = new byte [0];
|
||||
|
||||
|
||||
//Step (5)
|
||||
SendRequestForChannel (reqArg, HeaderFields, CustomHeaders, buffer);
|
||||
SendRequestForChannel (reqArg, HeaderFields, CustomHeaders, buffer);
|
||||
}
|
||||
|
||||
private static ArrayList RecieveHeader (RequestArguments reqArg)
|
||||
@@ -215,8 +208,7 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
SendResponse (reqArg, 408, null, null);
|
||||
break;
|
||||
default :
|
||||
//<Exception>
|
||||
break;
|
||||
throw e;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -261,7 +253,7 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
|
||||
}
|
||||
|
||||
public static bool SendResponse (RequestArguments reqArg, int httpStatusCode, ITransportHeaders headers, Stream responseStream)
|
||||
public static void SendResponse (RequestArguments reqArg, int httpStatusCode, ITransportHeaders headers, Stream responseStream)
|
||||
{
|
||||
byte [] headersBuffer = null;
|
||||
byte [] entityBuffer = null;
|
||||
@@ -309,22 +301,11 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
|
||||
headersBuffer = Encoding.ASCII.GetBytes (responseStr.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
//send headersBuffer
|
||||
reqArg.OutputStream.Write (headersBuffer, 0, headersBuffer.Length);
|
||||
//send headersBuffer
|
||||
reqArg.OutputStream.Write (headersBuffer, 0, headersBuffer.Length);
|
||||
|
||||
if (entityBuffer != null)
|
||||
reqArg.OutputStream.Write (entityBuffer, 0, entityBuffer.Length);
|
||||
}
|
||||
catch
|
||||
{
|
||||
//<EXCEPTION>
|
||||
//may be its the client's fault so just return with false
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
if (entityBuffer != null)
|
||||
reqArg.OutputStream.Write (entityBuffer, 0, entityBuffer.Length);
|
||||
}
|
||||
|
||||
internal static string GetReasonPhrase (int HttpStatusCode)
|
||||
|
||||
+2
-8
@@ -353,17 +353,11 @@ namespace System.Runtime.Remoting.Channels.Http
|
||||
switch (processing)
|
||||
{
|
||||
case ServerProcessing.Complete:
|
||||
if (!HttpServer.SendResponse (reqArg, 200, responseHeaders, responseStream))
|
||||
{
|
||||
//ooops couldnot send response !!!!!! and error occured
|
||||
}
|
||||
HttpServer.SendResponse (reqArg, 200, responseHeaders, responseStream);
|
||||
break;
|
||||
|
||||
case ServerProcessing.OneWay:
|
||||
if (!HttpServer.SendResponse (reqArg, 200, null, null))
|
||||
{
|
||||
//ooops couldnot send response !!!!!! and error occured
|
||||
}
|
||||
HttpServer.SendResponse (reqArg, 200, null, null);
|
||||
break;
|
||||
|
||||
case ServerProcessing.Async:
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2004-12-17 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* TcpMessageIO.cs: Removed some more WriteByte calls.
|
||||
* TcpClientTransportSink.cs: Flush the net stream after writing
|
||||
a message.
|
||||
|
||||
2004-12-10 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* TcpChannel.cs: Don't use regular expressions to parse the url, it's
|
||||
too slow.
|
||||
* TcpMessageIO.cs: Read byte chunks using the new StreamRead method,
|
||||
which won't block if the connection is closed.
|
||||
* TcpServerChannel.cs: Flush the stream after writing the response.
|
||||
Wrap the close call in a try/catch (some bytes can be left in the
|
||||
buffered stream if a connection is suddently closed, and it will fail
|
||||
when trying to flush them).
|
||||
|
||||
2004-12-09 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* TcpConnectionPool.cs: Access the socket stream through a
|
||||
BufferedStream.
|
||||
* TcpMessageIO.cs: Avoid ReadByte().
|
||||
* TcpServerChannel.cs: Access the socket stream through a
|
||||
BufferedStream. Abort the connection if an unknown message is received.
|
||||
All this fixes performance bug #70337.
|
||||
|
||||
2004-07-15 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* TcpServerChannel.cs: Set channel name from the provided properties.
|
||||
|
||||
+17
-8
@@ -140,17 +140,26 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
objectURI = null;
|
||||
port = 0;
|
||||
|
||||
Match m = Regex.Match (url, "tcp://([^:]+):([0-9]+)/?(.*)");
|
||||
if (!url.StartsWith ("tcp://")) return null;
|
||||
int colon = url.IndexOf (':', 6);
|
||||
if (colon == -1) return null;
|
||||
string host = url.Substring (6, colon - 6);
|
||||
|
||||
if (!m.Success)
|
||||
return null;
|
||||
int slash = url.IndexOf ('/', colon + 1);
|
||||
if (slash == -1) slash = url.Length;
|
||||
string port_str = url.Substring (colon + 1, slash - colon - 1);
|
||||
|
||||
string host = m.Groups[1].Value;
|
||||
string port_str = m.Groups[2].Value;
|
||||
objectURI = m.Groups[3].Value;
|
||||
port = Convert.ToInt32 (port_str);
|
||||
if (slash < url.Length)
|
||||
objectURI = url.Substring (slash + 1);
|
||||
|
||||
if (objectURI == string.Empty) objectURI = null;
|
||||
try {
|
||||
port = Convert.ToInt32 (port_str);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (objectURI == string.Empty)
|
||||
objectURI = null;
|
||||
|
||||
return host;
|
||||
}
|
||||
|
||||
+2
@@ -84,6 +84,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
connection = TcpConnectionPool.GetConnection (_host, _port);
|
||||
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, headers, connection.Buffer);
|
||||
connection.Stream.Flush ();
|
||||
|
||||
if (!isOneWay)
|
||||
{
|
||||
@@ -167,6 +168,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
// Sends the message
|
||||
connection = TcpConnectionPool.GetConnection (_host, _port);
|
||||
TcpMessageIO.SendMessageStream (connection.Stream, requestStream, requestHeaders, connection.Buffer);
|
||||
connection.Stream.Flush ();
|
||||
|
||||
// Reads the response
|
||||
MessageStatus status = TcpMessageIO.ReceiveMessageStatus (connection.Stream);
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
{
|
||||
_pool = pool;
|
||||
_client = client;
|
||||
_stream = client.GetStream();
|
||||
_stream = new BufferedStream (client.GetStream());
|
||||
_controlTime = DateTime.Now;
|
||||
_buffer = new byte[TcpMessageIO.DefaultStreamBufferSize];
|
||||
}
|
||||
|
||||
+48
-44
@@ -50,6 +50,14 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
// Identifies an incoming message
|
||||
public static MessageStatus ReceiveMessageStatus (Stream networkStream)
|
||||
{
|
||||
byte[] buffer = new byte[6];
|
||||
|
||||
try {
|
||||
StreamRead (networkStream, buffer, 6);
|
||||
} catch {
|
||||
return MessageStatus.Unknown;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
bool[] isOnTrack = new bool[_msgHeaders.Length];
|
||||
@@ -59,7 +67,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
while (atLeastOneOnTrack)
|
||||
{
|
||||
atLeastOneOnTrack = false;
|
||||
byte c = (byte)networkStream.ReadByte();
|
||||
byte c = buffer [i];
|
||||
for (int n = 0; n<_msgHeaders.Length; n++)
|
||||
{
|
||||
if (i > 0 && !isOnTrack[n]) continue;
|
||||
@@ -78,6 +86,18 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
return MessageStatus.CancelSignal;
|
||||
}
|
||||
}
|
||||
|
||||
static bool StreamRead (Stream networkStream, byte[] buffer, int count)
|
||||
{
|
||||
int nr = 0;
|
||||
do {
|
||||
int pr = networkStream.Read (buffer, nr, count - nr);
|
||||
if (pr == 0)
|
||||
throw new RemotingException ("Connection closed");
|
||||
nr += pr;
|
||||
} while (nr < count);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void SendMessageStream (Stream networkStream, Stream data, ITransportHeaders requestHeaders, byte[] buffer)
|
||||
{
|
||||
@@ -127,6 +147,11 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] msgUriTransportKey = new byte[] { 4, 0, 1, 1 };
|
||||
static byte[] msgContentTypeTransportKey = new byte[] { 6, 0, 1, 1 };
|
||||
static byte[] msgDefaultTransportKey = new byte[] { 1, 0, 1 };
|
||||
static byte[] msgHeaderTerminator = new byte[] { 0, 0 };
|
||||
|
||||
private static void SendHeaders(Stream networkStream, ITransportHeaders requestHeaders, byte[] buffer)
|
||||
{
|
||||
@@ -140,39 +165,34 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
switch (hdr.Key.ToString())
|
||||
{
|
||||
case CommonTransportKeys.RequestUri:
|
||||
buffer[0] = 4; buffer[1] = 0; buffer[2] = 1;
|
||||
networkStream.Write(buffer, 0, 3);
|
||||
networkStream.Write (msgUriTransportKey, 0, 4);
|
||||
break;
|
||||
case "Content-Type":
|
||||
buffer[0] = 6; buffer[1] = 0; buffer[2] = 1;
|
||||
networkStream.Write(buffer, 0, 3);
|
||||
networkStream.Write (msgContentTypeTransportKey, 0, 4);
|
||||
break;
|
||||
default:
|
||||
buffer[0] = 1; buffer[1] = 0; buffer[2] = 1;
|
||||
networkStream.Write(buffer, 0, 3);
|
||||
networkStream.Write (msgDefaultTransportKey, 0, 3);
|
||||
SendString (networkStream, hdr.Key.ToString(), buffer);
|
||||
networkStream.WriteByte (1);
|
||||
break;
|
||||
}
|
||||
networkStream.WriteByte (1);
|
||||
SendString (networkStream, hdr.Value.ToString(), buffer);
|
||||
}
|
||||
}
|
||||
networkStream.WriteByte (0); // End of headers
|
||||
networkStream.WriteByte (0);
|
||||
networkStream.Write (msgHeaderTerminator, 0, 2); // End of headers
|
||||
}
|
||||
|
||||
public static ITransportHeaders ReceiveHeaders (Stream networkStream, byte[] buffer)
|
||||
{
|
||||
byte headerType;
|
||||
headerType = (byte) networkStream.ReadByte ();
|
||||
networkStream.ReadByte ();
|
||||
|
||||
StreamRead (networkStream, buffer, 2);
|
||||
|
||||
byte headerType = buffer [0];
|
||||
TransportHeaders headers = new TransportHeaders ();
|
||||
|
||||
while (headerType != 0)
|
||||
{
|
||||
string key;
|
||||
networkStream.ReadByte (); // byte 1
|
||||
StreamRead (networkStream, buffer, 1); // byte 1
|
||||
switch (headerType)
|
||||
{
|
||||
case 4: key = CommonTransportKeys.RequestUri; break;
|
||||
@@ -180,11 +200,11 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
case 1: key = ReceiveString (networkStream, buffer); break;
|
||||
default: throw new NotSupportedException ("Unknown header code: " + headerType);
|
||||
}
|
||||
networkStream.ReadByte (); // byte 1
|
||||
StreamRead (networkStream, buffer, 1); // byte 1
|
||||
headers[key] = ReceiveString (networkStream, buffer);
|
||||
|
||||
headerType = (byte) networkStream.ReadByte ();
|
||||
networkStream.ReadByte ();
|
||||
StreamRead (networkStream, buffer, 2);
|
||||
headerType = buffer [0];
|
||||
}
|
||||
|
||||
return headers;
|
||||
@@ -197,31 +217,20 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
if (buffer == null) buffer = new byte[DefaultStreamBufferSize];
|
||||
|
||||
// Reads header tag: 0 -> Stream with headers or 2 -> Response Stream
|
||||
byte head = (byte)networkStream.ReadByte();
|
||||
byte c = (byte)networkStream.ReadByte();
|
||||
|
||||
c = (byte)networkStream.ReadByte();
|
||||
c = (byte)networkStream.ReadByte();
|
||||
|
||||
// +
|
||||
// Gets the length of the data stream
|
||||
int nr = 0;
|
||||
while (nr < 4)
|
||||
nr += networkStream.Read (buffer, nr, 4 - nr);
|
||||
StreamRead (networkStream, buffer, 8);
|
||||
|
||||
int byteCount = (buffer [0] | (buffer [1] << 8) |
|
||||
(buffer [2] << 16) | (buffer [3] << 24));
|
||||
int byteCount = (buffer [4] | (buffer [5] << 8) |
|
||||
(buffer [6] << 16) | (buffer [7] << 24));
|
||||
|
||||
// Reads the headers
|
||||
headers = ReceiveHeaders (networkStream, buffer);
|
||||
|
||||
byte[] resultBuffer = new byte[byteCount];
|
||||
StreamRead (networkStream, resultBuffer, byteCount);
|
||||
|
||||
nr = 0;
|
||||
while (nr < byteCount)
|
||||
nr += networkStream.Read (resultBuffer, nr, byteCount - nr);
|
||||
|
||||
|
||||
return new MemoryStream(resultBuffer);
|
||||
return new MemoryStream (resultBuffer);
|
||||
}
|
||||
|
||||
private static void SendString (Stream networkStream, string str, byte[] buffer)
|
||||
@@ -248,9 +257,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
private static string ReceiveString (Stream networkStream, byte[] buffer)
|
||||
{
|
||||
int nr = 0;
|
||||
while (nr < 4)
|
||||
nr += networkStream.Read (buffer, nr, 4 - nr);
|
||||
StreamRead (networkStream, buffer, 4);
|
||||
|
||||
// Reads the number of bytes (not chars!)
|
||||
|
||||
@@ -267,13 +274,10 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
// Reads the string
|
||||
|
||||
nr = 0;
|
||||
while (nr < byteCount)
|
||||
nr += networkStream.Read (buffer, nr, byteCount - nr);
|
||||
|
||||
char[] chars = Encoding.UTF8.GetChars(buffer, 0, byteCount);
|
||||
StreamRead (networkStream, buffer, byteCount);
|
||||
char[] chars = Encoding.UTF8.GetChars (buffer, 0, byteCount);
|
||||
|
||||
return new string(chars);
|
||||
return new string (chars);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-2
@@ -304,7 +304,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
|
||||
public void ProcessMessages()
|
||||
{
|
||||
_stream = _client.GetStream();
|
||||
_stream = new BufferedStream (_client.GetStream());
|
||||
|
||||
try
|
||||
{
|
||||
@@ -319,10 +319,12 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
_sink.InternalProcessMessage (this);
|
||||
break;
|
||||
|
||||
case MessageStatus.Unknown:
|
||||
case MessageStatus.CancelSignal:
|
||||
end = true;
|
||||
break;
|
||||
}
|
||||
_stream.Flush ();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -331,7 +333,10 @@ namespace System.Runtime.Remoting.Channels.Tcp
|
||||
}
|
||||
finally
|
||||
{
|
||||
_stream.Close();
|
||||
try {
|
||||
_stream.Close();
|
||||
}
|
||||
catch { }
|
||||
_serverChannel.ReleaseConnection (Thread.CurrentThread);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2004-12-09 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* ValueCollectionParameterReader.cs: Parse parameters in the correct
|
||||
way, Convert.ChangeType is not enough. This fixes bug #70266.
|
||||
Removed some types that are not supported as parameters.
|
||||
* MimeFormatter.cs: Added methods for xml <-> object conversion.
|
||||
* UrlEncodedParameterWriter.cs: Use a more elaborate method for converting
|
||||
from object to string, ToString() is not enough.
|
||||
|
||||
2004-12-03 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* SoapHttpClientProtocol.cs: dispose the StreamReader that wraps the
|
||||
response stream.
|
||||
|
||||
2004-09-15 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* Methods.cs: Use the service namespace as the base for the soap action.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
//
|
||||
|
||||
using System.Web.Services;
|
||||
using System.Xml;
|
||||
|
||||
namespace System.Web.Services.Protocols {
|
||||
public abstract class MimeFormatter {
|
||||
@@ -76,6 +77,55 @@ namespace System.Web.Services.Protocols {
|
||||
|
||||
public abstract void Initialize (object initializer);
|
||||
|
||||
internal static object StringToObj (Type type, string value)
|
||||
{
|
||||
switch (Type.GetTypeCode (type))
|
||||
{
|
||||
case TypeCode.Boolean: return XmlConvert.ToBoolean (value);
|
||||
case TypeCode.Byte: return XmlConvert.ToByte (value);
|
||||
case TypeCode.DateTime: return XmlConvert.ToDateTime (value);
|
||||
case TypeCode.Decimal: return XmlConvert.ToDecimal (value);
|
||||
case TypeCode.Double: return XmlConvert.ToDouble (value);
|
||||
case TypeCode.Int16: return XmlConvert.ToInt16 (value);
|
||||
case TypeCode.Int32: return XmlConvert.ToInt32 (value);
|
||||
case TypeCode.Int64: return XmlConvert.ToInt64 (value);
|
||||
case TypeCode.SByte: return XmlConvert.ToSByte (value);
|
||||
case TypeCode.Single: return XmlConvert.ToSingle (value);
|
||||
case TypeCode.UInt16: return XmlConvert.ToUInt16 (value);
|
||||
case TypeCode.UInt32: return XmlConvert.ToUInt32 (value);
|
||||
case TypeCode.UInt64: return XmlConvert.ToUInt64 (value);
|
||||
case TypeCode.String: return value;
|
||||
case TypeCode.Char:
|
||||
if (value.Length != 1) throw new InvalidOperationException ("Invalid char value");
|
||||
return value [0];
|
||||
}
|
||||
throw new InvalidOperationException ("Type not supported");
|
||||
}
|
||||
|
||||
internal static string ObjToString (object value)
|
||||
{
|
||||
if (value == null) return "";
|
||||
switch (Type.GetTypeCode (value.GetType ()))
|
||||
{
|
||||
case TypeCode.Boolean: return XmlConvert.ToString ((bool)value);
|
||||
case TypeCode.Byte: return XmlConvert.ToString ((byte)value);
|
||||
case TypeCode.Char: return XmlConvert.ToString ((char)value);
|
||||
case TypeCode.DateTime: return XmlConvert.ToString ((DateTime)value);
|
||||
case TypeCode.Decimal: return XmlConvert.ToString ((decimal)value);
|
||||
case TypeCode.Double: return XmlConvert.ToString ((double)value);
|
||||
case TypeCode.Int16: return XmlConvert.ToString ((Int16)value);
|
||||
case TypeCode.Int32: return XmlConvert.ToString ((Int32)value);
|
||||
case TypeCode.Int64: return XmlConvert.ToString ((Int64)value);
|
||||
case TypeCode.SByte: return XmlConvert.ToString ((sbyte)value);
|
||||
case TypeCode.Single: return XmlConvert.ToString ((Single)value);
|
||||
case TypeCode.UInt16: return XmlConvert.ToString ((UInt16)value);
|
||||
case TypeCode.UInt32: return XmlConvert.ToString ((UInt32)value);
|
||||
case TypeCode.UInt64: return XmlConvert.ToString ((UInt64)value);
|
||||
case TypeCode.String: return value as string;
|
||||
}
|
||||
throw new InvalidOperationException ("Type not supported");
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
+7
-4
@@ -263,13 +263,16 @@ namespace System.Web.Services.Protocols {
|
||||
|
||||
// Deserialize the response
|
||||
|
||||
StreamReader reader = new StreamReader (stream, encoding, false);
|
||||
XmlTextReader xml_reader = new XmlTextReader (reader);
|
||||
|
||||
SoapHeaderCollection headers;
|
||||
object content;
|
||||
|
||||
WebServiceHelper.ReadSoapMessage (xml_reader, type_info, msi.Use, msi.ResponseSerializer, out content, out headers);
|
||||
using (StreamReader reader = new StreamReader (stream, encoding, false)) {
|
||||
XmlTextReader xml_reader = new XmlTextReader (reader);
|
||||
|
||||
WebServiceHelper.ReadSoapMessage (xml_reader, type_info, msi.Use, msi.ResponseSerializer,
|
||||
out content, out headers);
|
||||
}
|
||||
|
||||
|
||||
if (content is Fault)
|
||||
{
|
||||
|
||||
+2
-2
@@ -75,13 +75,13 @@ namespace System.Web.Services.Protocols {
|
||||
{
|
||||
writer.Write (HttpUtility.UrlEncode (name, requestEncoding));
|
||||
writer.Write ("=");
|
||||
writer.Write (HttpUtility.UrlEncode (value.ToString(), requestEncoding));
|
||||
writer.Write (HttpUtility.UrlEncode (ObjToString (value), requestEncoding));
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write (HttpUtility.UrlEncode (name));
|
||||
writer.Write ("=");
|
||||
writer.Write (HttpUtility.UrlEncode (value.ToString()));
|
||||
writer.Write (HttpUtility.UrlEncode (ObjToString (value)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-7
@@ -80,10 +80,7 @@ namespace System.Web.Services.Protocols {
|
||||
return ( type.IsPrimitive ||
|
||||
type == typeof(string) ||
|
||||
type == typeof(DateTime) ||
|
||||
type == typeof(Guid) ||
|
||||
type == typeof(XmlQualifiedName) ||
|
||||
type == typeof(TimeSpan) ||
|
||||
type == typeof(byte[])
|
||||
type == typeof(Decimal)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,18 +93,17 @@ namespace System.Web.Services.Protocols {
|
||||
if (val == null) throw new InvalidOperationException ("Missing parameter: " + parameters[n].Name);
|
||||
try
|
||||
{
|
||||
res [n] = Convert.ChangeType (val, parameters[n].ParameterType);
|
||||
res [n] = StringToObj (parameters[n].ParameterType, val);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string error = "Cannot convert " + val + " to " + parameters[n].ParameterType.FullName + "\n";
|
||||
string error = "Cannot convert '" + val + "' to " + parameters[n].ParameterType.FullName + "\n";
|
||||
error += "Parameter name: " + parameters[n].Name + " --> " + ex.Message;
|
||||
throw new InvalidOperationException (error);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
2004-06-08 Alon Gazit <along@mainsoft.com>
|
||||
|
||||
* System.Web.dll.sources: added ServerVariablesCollection.
|
||||
2004-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
|
||||
|
||||
* System.Web.dll.sources: added ReusableMemoryStream.
|
||||
|
||||
2004-06-08 Alon Gazit <[email protected]>
|
||||
|
||||
* System.Web.dll.sources: added ServerVariablesCollection.
|
||||
|
||||
2004-06-08 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2004-12-15 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* WebConfigurationSettings.cs: correctly detect web.config changes.
|
||||
|
||||
2004-11-28 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HandlerItem.cs: for reusable items, return the same instance always.
|
||||
Fixes bug #69959.
|
||||
|
||||
2004-11-24 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* GlobalizationConfigurationHandler.cs: fixed stupid typo (uiculture ->
|
||||
uiCulture). Closes bug #69524.
|
||||
|
||||
2004-10-10 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* WebConfigurationSettings.cs: use CurrentExecutionFilePath instead of
|
||||
|
||||
@@ -69,9 +69,9 @@ namespace System.Web.Configuration
|
||||
if (attvalue != null)
|
||||
config.Culture = GetCulture (section, "culture", attvalue);
|
||||
|
||||
attvalue = AttValue ("uiculture", section, true);
|
||||
attvalue = AttValue ("uiCulture", section, true);
|
||||
if (attvalue != null)
|
||||
config.UICulture = GetCulture (section, "uiculture", attvalue);
|
||||
config.UICulture = GetCulture (section, "uiCulture", attvalue);
|
||||
|
||||
if (section.Attributes == null || section.Attributes.Count != 0)
|
||||
ThrowException ("Unknown attribute(s).", section);
|
||||
|
||||
@@ -32,6 +32,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
namespace System.Web.Configuration
|
||||
{
|
||||
@@ -44,6 +45,8 @@ namespace System.Web.Configuration
|
||||
private Regex requestRegex;
|
||||
private Regex pathRegex;
|
||||
static Hashtable regexCache;
|
||||
object instance;
|
||||
bool validated;
|
||||
|
||||
public HandlerItem (string requestType, string path, string type, bool validate)
|
||||
{
|
||||
@@ -56,19 +59,25 @@ namespace System.Web.Configuration
|
||||
DoValidation ();
|
||||
}
|
||||
|
||||
public object Create ()
|
||||
public object GetInstance ()
|
||||
{
|
||||
if (_type == null)
|
||||
DoValidation ();
|
||||
object obj = Interlocked.CompareExchange (ref instance, null, null);
|
||||
if (obj != null)
|
||||
return obj;
|
||||
|
||||
return HttpRuntime.CreateInternalObject (_type);
|
||||
DoValidation ();
|
||||
obj = HttpRuntime.CreateInternalObject (_type);
|
||||
IHttpHandler hnd = obj as IHttpHandler;
|
||||
if (hnd != null && hnd.IsReusable)
|
||||
Interlocked.CompareExchange (ref instance, hnd, null);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
public Type Type
|
||||
{
|
||||
get {
|
||||
if (_type == null)
|
||||
DoValidation ();
|
||||
DoValidation ();
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +106,15 @@ namespace System.Web.Configuration
|
||||
|
||||
void DoValidation ()
|
||||
{
|
||||
_type = Type.GetType (_typeName, true);
|
||||
if (validated)
|
||||
return;
|
||||
|
||||
lock (this) {
|
||||
Type t = Type.GetType (_typeName, true);
|
||||
_type = t;
|
||||
validated = true;
|
||||
}
|
||||
|
||||
if (typeof (IHttpHandler).IsAssignableFrom (_type))
|
||||
return;
|
||||
|
||||
|
||||
@@ -271,10 +271,6 @@ namespace System.Web.Configuration
|
||||
void SetChanged (object o, FileSystemEventArgs args)
|
||||
{
|
||||
lock (data) {
|
||||
if (watcher.Filter == "*.config" &&
|
||||
String.Compare (Path.GetFileName (args.FullPath), "web.config", true) != 0)
|
||||
return;
|
||||
|
||||
cacheTable.Clear ();
|
||||
data.Reset ();
|
||||
if (args.ChangeType == WatcherChangeTypes.Created)
|
||||
@@ -535,7 +531,7 @@ namespace System.Web.Configuration
|
||||
XmlDocument doc = GetDocumentForSection (sectionName);
|
||||
if (doc == null || doc.DocumentElement == null)
|
||||
return parentConfig;
|
||||
|
||||
|
||||
return iconf.Create (parentConfig, fileName, doc.DocumentElement);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* SessionStateModule.cs: set the path modifier when using cookie-less
|
||||
sessions.
|
||||
|
||||
2004-10-06 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* SessionStateModule.cs: use SetCurrentExePath instead of SetFilePath.
|
||||
|
||||
@@ -112,6 +112,7 @@ namespace System.Web.SessionState
|
||||
context.Request.SetCurrentExePath (UrlUtils.RemoveSessionId (base_path,
|
||||
context.Request.FilePath));
|
||||
context.Request.SetHeader (HeaderName, id);
|
||||
context.Response.SetAppPathModifier (String.Format ("({0})", id));
|
||||
}
|
||||
|
||||
void OnReleaseRequestState (object o, EventArgs args)
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2004-12-15 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HtmlForm.cs: MakeRelative() can be null. Thanks to Denis Gervaille.
|
||||
|
||||
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HtmlForm.cs: fixed the Action property when running a different
|
||||
page than the one requested (Transfer). Closes bug #69318.
|
||||
|
||||
2004-06-23 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HtmlForm.cs: disabled smartnavigation as we have no scripts to support
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.UI.HtmlControls{
|
||||
|
||||
@@ -87,19 +88,20 @@ namespace System.Web.UI.HtmlControls{
|
||||
Page.RegisterViewStateHandler();
|
||||
}
|
||||
|
||||
internal string Action{
|
||||
internal string Action {
|
||||
get{
|
||||
string executionFilePath = Context.Request.CurrentExecutionFilePath;
|
||||
string filePath = Context.Request.FilePath;
|
||||
string attr;
|
||||
if (String.ReferenceEquals(executionFilePath, filePath) == true){
|
||||
if (executionFilePath == filePath) {
|
||||
attr = filePath;
|
||||
int lastSlash = attr.LastIndexOf('/');
|
||||
if (lastSlash >= 0)
|
||||
attr = attr.Substring(lastSlash + 1);
|
||||
}
|
||||
else{
|
||||
attr = System.Web.Util.UrlUtils.MakeRelative(filePath,executionFilePath);
|
||||
} else {
|
||||
attr = UrlUtils.MakeRelative (executionFilePath, UrlUtils.GetDirectory (filePath));
|
||||
if (attr == null)
|
||||
attr = executionFilePath;
|
||||
}
|
||||
string queryString = Context.Request.QueryStringRaw;
|
||||
if (queryString != null && queryString.Length > 0)
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2005-01-20 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* CheckBox.cs: when rendering the input tag inside a span tag, keep the
|
||||
attributes that are meant to be in the input tag in their place.
|
||||
|
||||
2005-01-10 Juraj Skripsky <[email protected]>
|
||||
|
||||
* RepeatInfo.cs: fixed bug #68927 (DataList with RepeatLayout='Flow'
|
||||
generates invalid html).
|
||||
|
||||
2004-10-25 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* ListItemCollection.cs: fixed bug when indexing changed elements in
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace System.Web.UI.WebControls
|
||||
public class CheckBox : WebControl, IPostBackDataHandler
|
||||
{
|
||||
private static readonly object CheckedChangedEvent = new object();
|
||||
AttributeCollection commonAttrs;
|
||||
|
||||
public CheckBox(): base(HtmlTextWriterTag.Input)
|
||||
{
|
||||
@@ -148,7 +149,61 @@ namespace System.Web.UI.WebControls
|
||||
if (!SaveCheckedViewState)
|
||||
ViewState.SetItemDirty ("Checked", false);
|
||||
}
|
||||
|
||||
|
||||
static bool IsInputOrCommonAttr (string attname)
|
||||
{
|
||||
switch (attname) {
|
||||
case "VALUE":
|
||||
case "CHECKED":
|
||||
case "SIZE":
|
||||
case "MAXLENGTH":
|
||||
case "SRC":
|
||||
case "ALT":
|
||||
case "USEMAP":
|
||||
case "DISABLED":
|
||||
case "READONLY":
|
||||
case "ACCEPT":
|
||||
case "ACCESSKEY":
|
||||
case "TABINDEX":
|
||||
case "ONFOCUS":
|
||||
case "ONBLUR":
|
||||
case "ONSELECT":
|
||||
case "ONCHANGE":
|
||||
case "ONCLICK":
|
||||
case "ONDBLCLICK":
|
||||
case "ONMOUSEDOWN":
|
||||
case "ONMOUSEUP":
|
||||
case "ONMOUSEOVER":
|
||||
case "ONMOUSEMOVE":
|
||||
case "ONMOUSEOUT":
|
||||
case "ONKEYPRESS":
|
||||
case "ONKEYDOWN":
|
||||
case "ONKEYUP":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void AddAttributesForSpan (HtmlTextWriter writer)
|
||||
{
|
||||
ICollection k = Attributes.Keys;
|
||||
string [] keys = new string [k.Count];
|
||||
k.CopyTo (keys, 0);
|
||||
foreach (string key in keys) {
|
||||
if (!IsInputOrCommonAttr (key.ToUpper ()))
|
||||
continue;
|
||||
|
||||
if (commonAttrs == null)
|
||||
commonAttrs = new AttributeCollection (new StateBag ());
|
||||
|
||||
commonAttrs [key] = Attributes [key];
|
||||
Attributes.Remove (key);
|
||||
}
|
||||
|
||||
Attributes.AddAttributes (writer);
|
||||
}
|
||||
|
||||
protected override void Render (HtmlTextWriter writer)
|
||||
{
|
||||
bool hasBeginRendering = false;
|
||||
@@ -169,15 +224,8 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
if (Attributes.Count > 0){
|
||||
string val = Attributes ["value"];
|
||||
Attributes.Remove ("value");
|
||||
if (Attributes.Count > 0){
|
||||
hasBeginRendering = true;
|
||||
Attributes.AddAttributes (writer);
|
||||
}
|
||||
|
||||
if (val != null)
|
||||
Attributes ["value"] = val;
|
||||
hasBeginRendering = true;
|
||||
AddAttributesForSpan (writer);
|
||||
}
|
||||
|
||||
if (hasBeginRendering)
|
||||
@@ -185,17 +233,25 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
if (Text.Length > 0){
|
||||
TextAlign ta = TextAlign;
|
||||
if(ta == TextAlign.Right)
|
||||
if(ta == TextAlign.Right) {
|
||||
if (commonAttrs != null)
|
||||
commonAttrs.AddAttributes (writer);
|
||||
RenderInputTag (writer, ClientID);
|
||||
}
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.For, ClientID);
|
||||
writer.RenderBeginTag (HtmlTextWriterTag.Label);
|
||||
writer.Write (Text);
|
||||
writer.RenderEndTag ();
|
||||
if(ta == TextAlign.Left)
|
||||
if(ta == TextAlign.Left) {
|
||||
if (commonAttrs != null)
|
||||
commonAttrs.AddAttributes (writer);
|
||||
RenderInputTag (writer, ClientID);
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
if (commonAttrs != null)
|
||||
commonAttrs.AddAttributes (writer);
|
||||
RenderInputTag (writer, ClientID);
|
||||
}
|
||||
|
||||
if (hasBeginRendering)
|
||||
writer.RenderEndTag ();
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace System.Web.UI.WebControls
|
||||
writer.RenderEndTag();
|
||||
if(hasSeps && index != (total - 1))
|
||||
{
|
||||
if(colsCount == 1)
|
||||
if(isTable && colsCount == 1)
|
||||
{
|
||||
writer.RenderEndTag();
|
||||
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2004-12-14 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* ControlCollection.cs: fix off-by-one and store a null at the end to
|
||||
remove the reference to the removed control.
|
||||
|
||||
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Control.cs: when saving "Visible" into the ViewState, save the value
|
||||
for this precise control, as using the Visible property might give us
|
||||
Control's parent visibility. Fixes bug #69200.
|
||||
|
||||
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Control.cs: fixed ResolveUrl for relative URLs when using cookie-less
|
||||
sessions.
|
||||
|
||||
2004-11-09 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* Control.cs: unified a few bool fields into an int one.
|
||||
|
||||
* ControlCollection.cs: use an array internally instead of always
|
||||
allocating an arraylist. Also added our own enumerator.
|
||||
|
||||
* EmptyControlCollection.cs: there's no 'special' ctor now in the base
|
||||
class.
|
||||
|
||||
2004-10-29 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* ControlBuilder.cs: from HEAD.
|
||||
|
||||
@@ -44,65 +44,81 @@ namespace System.Web.UI
|
||||
[DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
|
||||
[ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
|
||||
[Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
|
||||
[DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
|
||||
[DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner,
|
||||
"System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
|
||||
public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
|
||||
{
|
||||
private static readonly object DataBindingEvent = new object();
|
||||
private static readonly object DisposedEvent = new object();
|
||||
private static readonly object InitEvent = new object();
|
||||
private static readonly object LoadEvent = new object();
|
||||
private static readonly object PreRenderEvent = new object();
|
||||
private static readonly object UnloadEvent = new object();
|
||||
private string uniqueID;
|
||||
private string _userId;
|
||||
private bool id_set;
|
||||
private ControlCollection _controls;
|
||||
private bool _enableViewState = true;
|
||||
private IDictionary _childViewStates;
|
||||
private bool _isNamingContainer;
|
||||
private Control _namingContainer;
|
||||
private Page _page;
|
||||
private Control _parent;
|
||||
private ISite _site;
|
||||
private bool _visible = true;
|
||||
private bool visibleChanged;
|
||||
private HttpContext _context;
|
||||
private bool _childControlsCreated;
|
||||
private StateBag _viewState;
|
||||
private bool _trackViewState;
|
||||
private EventHandlerList _events;
|
||||
private RenderMethod _renderMethodDelegate;
|
||||
private bool autoID = true;
|
||||
private bool creatingControls;
|
||||
private bool bindingContainer = true;
|
||||
private bool autoEventWireup = true;
|
||||
static readonly object DataBindingEvent = new object();
|
||||
static readonly object DisposedEvent = new object();
|
||||
static readonly object InitEvent = new object();
|
||||
static readonly object LoadEvent = new object();
|
||||
static readonly object PreRenderEvent = new object();
|
||||
static readonly object UnloadEvent = new object();
|
||||
static string[] defaultNameArray;
|
||||
|
||||
bool inited, initing;
|
||||
bool viewStateLoaded;
|
||||
bool loaded;
|
||||
bool prerendered;
|
||||
string uniqueID;
|
||||
string _userId;
|
||||
ControlCollection _controls;
|
||||
IDictionary _childViewStates;
|
||||
Control _namingContainer;
|
||||
Page _page;
|
||||
Control _parent;
|
||||
ISite _site;
|
||||
HttpContext _context;
|
||||
StateBag _viewState;
|
||||
EventHandlerList _events;
|
||||
RenderMethod _renderMethodDelegate;
|
||||
int defaultNumberID;
|
||||
|
||||
DataBindingCollection dataBindings;
|
||||
Hashtable pendingVS; // may hold unused viewstate data from child controls
|
||||
|
||||
|
||||
public Control()
|
||||
{
|
||||
if (this is INamingContainer) _isNamingContainer = true;
|
||||
}
|
||||
/*************/
|
||||
int stateMask;
|
||||
const int ENABLE_VIEWSTATE = 1;
|
||||
const int VISIBLE = 1 << 1;
|
||||
const int AUTOID = 1 << 2;
|
||||
const int CREATING_CONTROLS = 1 << 3;
|
||||
const int BINDING_CONTAINER = 1 << 4;
|
||||
const int AUTO_EVENT_WIREUP = 1 << 5;
|
||||
const int IS_NAMING_CONTAINER = 1 << 6;
|
||||
const int VISIBLE_CHANGED = 1 << 7;
|
||||
const int TRACK_VIEWSTATE = 1 << 8;
|
||||
const int CHILD_CONTROLS_CREATED = 1 << 9;
|
||||
const int ID_SET = 1 << 10;
|
||||
const int INITED = 1 << 11;
|
||||
const int INITING = 1 << 12;
|
||||
const int VIEWSTATE_LOADED = 1 << 13;
|
||||
const int LOADED = 1 << 14;
|
||||
const int PRERENDERED = 1 << 15;
|
||||
/*************/
|
||||
|
||||
static Control ()
|
||||
{
|
||||
defaultNameArray = new string [100];
|
||||
for (int i = 0 ; i < 100 ; i++)
|
||||
defaultNameArray [i] = "_ctrl" + i;
|
||||
}
|
||||
|
||||
public Control()
|
||||
{
|
||||
stateMask = ENABLE_VIEWSTATE | VISIBLE | AUTOID | BINDING_CONTAINER | AUTO_EVENT_WIREUP;
|
||||
if (this is INamingContainer)
|
||||
stateMask |= IS_NAMING_CONTAINER;
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
|
||||
public Control BindingContainer
|
||||
{
|
||||
get {
|
||||
Control container = NamingContainer;
|
||||
if (!container.bindingContainer)
|
||||
container = container.BindingContainer;
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
public Control BindingContainer {
|
||||
get {
|
||||
Control container = NamingContainer;
|
||||
if ((container.stateMask & BINDING_CONTAINER) == 0)
|
||||
container = container.BindingContainer;
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("An Identification of the control that is rendered.")]
|
||||
@@ -129,32 +145,25 @@ namespace System.Web.UI
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultValue (true), WebCategory ("FIXME")]
|
||||
[DefaultValue (true), WebCategory ("Behavior")]
|
||||
[WebSysDescription ("An Identification of the control that is rendered.")]
|
||||
public virtual bool EnableViewState //DIT
|
||||
{
|
||||
get
|
||||
{
|
||||
return _enableViewState;
|
||||
}
|
||||
set
|
||||
{
|
||||
_enableViewState = value;
|
||||
}
|
||||
}
|
||||
public virtual bool EnableViewState {
|
||||
get { return ((stateMask & ENABLE_VIEWSTATE) != 0); }
|
||||
set { SetMask (ENABLE_VIEWSTATE, value); }
|
||||
}
|
||||
|
||||
[MergableProperty (false), ParenthesizePropertyName (true)]
|
||||
[WebSysDescription ("The name of the control that is rendered.")]
|
||||
public virtual string ID {
|
||||
get {
|
||||
return (id_set ? _userId : null);
|
||||
return (((stateMask & ID_SET) != 0) ? _userId : null);
|
||||
}
|
||||
|
||||
set {
|
||||
if (value == "")
|
||||
value = null;
|
||||
|
||||
id_set = true;
|
||||
stateMask |= ID_SET;
|
||||
_userId = value;
|
||||
NullifyUniqueID ();
|
||||
}
|
||||
@@ -163,25 +172,23 @@ namespace System.Web.UI
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]
|
||||
public virtual Control NamingContainer //DIT
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_namingContainer == null && _parent != null)
|
||||
{
|
||||
if (_parent._isNamingContainer == false)
|
||||
_namingContainer = _parent.NamingContainer;
|
||||
else
|
||||
_namingContainer = _parent;
|
||||
}
|
||||
return _namingContainer;
|
||||
public virtual Control NamingContainer {
|
||||
get {
|
||||
if (_namingContainer == null && _parent != null) {
|
||||
if ((_parent.stateMask & IS_NAMING_CONTAINER) == 0)
|
||||
_namingContainer = _parent.NamingContainer;
|
||||
else
|
||||
_namingContainer = _parent;
|
||||
}
|
||||
|
||||
return _namingContainer;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("The webpage that this control resides on.")]
|
||||
public virtual Page Page //DIT
|
||||
public virtual Page Page //DIT
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -222,10 +229,10 @@ namespace System.Web.UI
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("A virtual directory containing the parent of the control.")]
|
||||
public virtual string TemplateSourceDirectory {
|
||||
get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }
|
||||
}
|
||||
[WebSysDescription ("A virtual directory containing the parent of the control.")]
|
||||
public virtual string TemplateSourceDirectory {
|
||||
get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
@@ -253,11 +260,19 @@ namespace System.Web.UI
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultValue (true), Bindable (true), WebCategory ("FIXME")]
|
||||
void SetMask (int m, bool val)
|
||||
{
|
||||
if (val)
|
||||
stateMask |= m;
|
||||
else
|
||||
stateMask &= ~m;
|
||||
}
|
||||
|
||||
[DefaultValue (true), Bindable (true), WebCategory ("Behavior")]
|
||||
[WebSysDescription ("Visiblity state of the control.")]
|
||||
public virtual bool Visible {
|
||||
get {
|
||||
if (_visible == false)
|
||||
if ((stateMask & VISIBLE) == 0)
|
||||
return false;
|
||||
|
||||
if (_parent != null)
|
||||
@@ -267,28 +282,25 @@ namespace System.Web.UI
|
||||
}
|
||||
|
||||
set {
|
||||
if (value != _visible) {
|
||||
if ((value && (stateMask & VISIBLE) == 0) ||
|
||||
(!value && (stateMask & VISIBLE) != 0)) {
|
||||
if (IsTrackingViewState)
|
||||
visibleChanged = true;
|
||||
stateMask |= VISIBLE_CHANGED;
|
||||
}
|
||||
|
||||
_visible = value;
|
||||
SetMask (VISIBLE, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected bool ChildControlsCreated //DIT
|
||||
{
|
||||
get
|
||||
{
|
||||
return _childControlsCreated;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == false && _childControlsCreated == true)
|
||||
_controls.Clear();
|
||||
_childControlsCreated = value;
|
||||
}
|
||||
}
|
||||
protected bool ChildControlsCreated {
|
||||
get { return ((stateMask & CHILD_CONTROLS_CREATED) != 0); }
|
||||
set {
|
||||
if (value == false && (stateMask & CHILD_CONTROLS_CREATED) != 0)
|
||||
Controls.Clear();
|
||||
|
||||
SetMask (CHILD_CONTROLS_CREATED, value);
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
@@ -326,13 +338,10 @@ namespace System.Web.UI
|
||||
return true;
|
||||
}
|
||||
}
|
||||
protected bool IsTrackingViewState //DIT
|
||||
{
|
||||
get
|
||||
{
|
||||
return _trackViewState;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsTrackingViewState {
|
||||
get { return ((stateMask & TRACK_VIEWSTATE) != 0); }
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
@@ -360,36 +369,42 @@ namespace System.Web.UI
|
||||
}
|
||||
}
|
||||
|
||||
internal bool AutoEventWireup {
|
||||
get { return autoEventWireup; }
|
||||
set { autoEventWireup = value; }
|
||||
}
|
||||
|
||||
internal void SetBindingContainer (bool isBC)
|
||||
{
|
||||
bindingContainer = isBC;
|
||||
}
|
||||
|
||||
internal bool AutoEventWireup {
|
||||
get { return (stateMask & AUTO_EVENT_WIREUP) != 0; }
|
||||
set { SetMask (AUTO_EVENT_WIREUP, value); }
|
||||
}
|
||||
|
||||
internal void SetBindingContainer (bool isBC)
|
||||
{
|
||||
SetMask (BINDING_CONTAINER, isBC);
|
||||
}
|
||||
|
||||
internal void ResetChildNames ()
|
||||
{
|
||||
defaultNumberID = 0;
|
||||
}
|
||||
|
||||
string GetDefaultName ()
|
||||
{
|
||||
return "_ctrl" + defaultNumberID++;
|
||||
}
|
||||
|
||||
|
||||
string GetDefaultName ()
|
||||
{
|
||||
string defaultName;
|
||||
if (defaultNumberID > 99) {
|
||||
defaultName = "_ctrl" + defaultNumberID++;
|
||||
} else {
|
||||
defaultName = defaultNameArray [defaultNumberID++];
|
||||
}
|
||||
return defaultName;
|
||||
}
|
||||
|
||||
void NullifyUniqueID ()
|
||||
{
|
||||
uniqueID = null;
|
||||
if (_controls == null)
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
foreach (Control c in _controls)
|
||||
c.NullifyUniqueID ();
|
||||
}
|
||||
|
||||
foreach (Control c in Controls)
|
||||
c.NullifyUniqueID ();
|
||||
}
|
||||
|
||||
protected internal virtual void AddedControl (Control control, int index)
|
||||
{
|
||||
/* Ensure the control don't have more than 1 parent */
|
||||
@@ -398,7 +413,7 @@ namespace System.Web.UI
|
||||
|
||||
control._parent = this;
|
||||
control._page = _page;
|
||||
Control nc = _isNamingContainer ? this : NamingContainer;
|
||||
Control nc = ((stateMask & IS_NAMING_CONTAINER) != 0) ? this : NamingContainer;
|
||||
|
||||
if (nc != null) {
|
||||
control._namingContainer = nc;
|
||||
@@ -406,10 +421,10 @@ namespace System.Web.UI
|
||||
control._userId = nc.GetDefaultName () + "a";
|
||||
}
|
||||
|
||||
if (initing || inited)
|
||||
if ((stateMask & (INITING | INITED)) != 0)
|
||||
control.InitRecursive (nc);
|
||||
|
||||
if (viewStateLoaded || loaded) {
|
||||
if ((stateMask & (VIEWSTATE_LOADED | LOADED)) != 0) {
|
||||
if (pendingVS != null) {
|
||||
object vs = pendingVS [index];
|
||||
if (vs != null) {
|
||||
@@ -422,10 +437,10 @@ namespace System.Web.UI
|
||||
}
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
if ((stateMask & LOADED) != 0)
|
||||
control.LoadRecursive ();
|
||||
|
||||
if (prerendered)
|
||||
if ((stateMask & PRERENDERED) != 0)
|
||||
control.PreRenderRecursiveInternal ();
|
||||
}
|
||||
|
||||
@@ -455,25 +470,24 @@ namespace System.Web.UI
|
||||
return new ControlCollection(this);
|
||||
}
|
||||
|
||||
protected virtual void EnsureChildControls () //DIT
|
||||
{
|
||||
if (ChildControlsCreated == false && !creatingControls) {
|
||||
creatingControls = true;
|
||||
CreateChildControls();
|
||||
ChildControlsCreated = true;
|
||||
creatingControls = false;
|
||||
}
|
||||
protected virtual void EnsureChildControls ()
|
||||
{
|
||||
if (ChildControlsCreated == false && (stateMask & CREATING_CONTROLS) == 0) {
|
||||
stateMask |= CREATING_CONTROLS;
|
||||
CreateChildControls();
|
||||
ChildControlsCreated = true;
|
||||
stateMask &= ~CREATING_CONTROLS;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsLiteralContent()
|
||||
{
|
||||
if (_controls != null)
|
||||
if (_controls.Count == 1)
|
||||
if (_controls[0] is LiteralControl)
|
||||
return true;
|
||||
if (HasControls () && Controls.Count == 1 && (Controls [0] is LiteralControl))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public virtual Control FindControl (string id)
|
||||
{
|
||||
return FindControl (id, 0);
|
||||
@@ -481,14 +495,14 @@ namespace System.Web.UI
|
||||
|
||||
Control LookForControlByName (string id)
|
||||
{
|
||||
if (!HasChildren)
|
||||
return null;
|
||||
if (!HasControls ())
|
||||
return null;
|
||||
|
||||
foreach (Control c in _controls) {
|
||||
foreach (Control c in Controls) {
|
||||
if (String.Compare (id, c._userId, true) == 0)
|
||||
return c;
|
||||
|
||||
if (!c._isNamingContainer && c.HasChildren) {
|
||||
if ((c.stateMask & IS_NAMING_CONTAINER) == 0 && c.HasControls ()) {
|
||||
Control child = c.LookForControlByName (id);
|
||||
if (child != null)
|
||||
return child;
|
||||
@@ -502,7 +516,7 @@ namespace System.Web.UI
|
||||
{
|
||||
EnsureChildControls ();
|
||||
Control namingContainer = null;
|
||||
if (!_isNamingContainer) {
|
||||
if ((stateMask & IS_NAMING_CONTAINER) == 0) {
|
||||
namingContainer = NamingContainer;
|
||||
if (namingContainer == null)
|
||||
return null;
|
||||
@@ -531,8 +545,8 @@ namespace System.Web.UI
|
||||
ViewState.LoadViewState (savedState);
|
||||
object o = ViewState ["Visible"];
|
||||
if (o != null) {
|
||||
_visible = (bool) o;
|
||||
visibleChanged = true;
|
||||
SetMask (VISIBLE, (bool) o);
|
||||
stateMask |= VISIBLE_CHANGED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,20 +617,24 @@ namespace System.Web.UI
|
||||
{
|
||||
RenderChildren(writer);
|
||||
}
|
||||
|
||||
protected virtual void RenderChildren(HtmlTextWriter writer) //DIT
|
||||
{
|
||||
if (_renderMethodDelegate != null)
|
||||
_renderMethodDelegate(writer, this);
|
||||
else if (_controls != null)
|
||||
foreach (Control c in _controls)
|
||||
c.RenderControl(writer);
|
||||
}
|
||||
|
||||
protected virtual void RenderChildren (HtmlTextWriter writer) //DIT
|
||||
{
|
||||
if (_renderMethodDelegate != null) {
|
||||
_renderMethodDelegate (writer, this);
|
||||
} else if (HasControls ()) {
|
||||
int len = Controls.Count;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Control c = Controls [i];
|
||||
c.RenderControl (writer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual object SaveViewState ()
|
||||
{
|
||||
if (visibleChanged) {
|
||||
ViewState ["Visible"] = Visible;
|
||||
if ((stateMask & VISIBLE_CHANGED) != 0) {
|
||||
ViewState ["Visible"] = (stateMask & VISIBLE) != 0;
|
||||
} else if (_viewState == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -628,7 +646,8 @@ namespace System.Web.UI
|
||||
{
|
||||
if (_viewState != null)
|
||||
_viewState.TrackViewState ();
|
||||
_trackViewState = true;
|
||||
|
||||
stateMask |= TRACK_VIEWSTATE;
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
@@ -640,11 +659,6 @@ namespace System.Web.UI
|
||||
eh(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
internal bool HasChildren
|
||||
{
|
||||
get { return (_controls != null && _controls.Count > 0); }
|
||||
}
|
||||
|
||||
[WebCategory ("FIXME")]
|
||||
[WebSysDescription ("Raised when the contols databound properties are evaluated.")]
|
||||
@@ -730,7 +744,7 @@ namespace System.Web.UI
|
||||
#if NET_2_0
|
||||
bool foundDataItem = false;
|
||||
|
||||
if (_isNamingContainer && Page != null) {
|
||||
if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
|
||||
object o = DataBinder.GetDataItem (this, out foundDataItem);
|
||||
if (foundDataItem)
|
||||
Page.PushDataItemContext (o);
|
||||
@@ -756,11 +770,14 @@ namespace System.Web.UI
|
||||
|
||||
void DataBindChildren ()
|
||||
{
|
||||
if (_controls == null)
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
foreach (Control c in _controls)
|
||||
c.DataBind();
|
||||
int len = Controls.Count;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Control c = Controls [i];
|
||||
c.DataBind ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -771,7 +788,7 @@ namespace System.Web.UI
|
||||
|
||||
public void RenderControl(HtmlTextWriter writer)
|
||||
{
|
||||
if (_visible)
|
||||
if ((stateMask & VISIBLE) != 0)
|
||||
Render(writer);
|
||||
}
|
||||
|
||||
@@ -790,9 +807,6 @@ namespace System.Web.UI
|
||||
if (ts == "" || !UrlUtils.IsRelativeUrl (relativeUrl))
|
||||
return relativeUrl;
|
||||
|
||||
if (relativeUrl.IndexOf ('/') == -1 && relativeUrl [0] != '.' && relativeUrl != "..")
|
||||
return relativeUrl;
|
||||
|
||||
HttpResponse resp = Context.Response;
|
||||
return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, relativeUrl));
|
||||
}
|
||||
@@ -806,18 +820,26 @@ namespace System.Web.UI
|
||||
internal void LoadRecursive()
|
||||
{
|
||||
OnLoad (EventArgs.Empty);
|
||||
if (_controls != null) {
|
||||
foreach (Control c in _controls)
|
||||
if (HasControls ()) {
|
||||
int len = Controls.Count;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
Control c = Controls[i];
|
||||
c.LoadRecursive ();
|
||||
}
|
||||
}
|
||||
loaded = true;
|
||||
stateMask |= LOADED;
|
||||
}
|
||||
|
||||
internal void UnloadRecursive(Boolean dispose)
|
||||
{
|
||||
if (_controls != null) {
|
||||
foreach (Control c in _controls)
|
||||
if (HasControls ()) {
|
||||
int len = Controls.Count;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
Control c = Controls[i];
|
||||
c.UnloadRecursive (dispose);
|
||||
}
|
||||
}
|
||||
|
||||
OnUnload (EventArgs.Empty);
|
||||
@@ -827,44 +849,50 @@ namespace System.Web.UI
|
||||
|
||||
internal void PreRenderRecursiveInternal()
|
||||
{
|
||||
if (_visible) {
|
||||
if ((stateMask & VISIBLE) != 0) {
|
||||
EnsureChildControls ();
|
||||
OnPreRender (EventArgs.Empty);
|
||||
if (_controls == null)
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
foreach (Control c in _controls)
|
||||
|
||||
int len = Controls.Count;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
Control c = Controls[i];
|
||||
c.PreRenderRecursiveInternal ();
|
||||
}
|
||||
}
|
||||
prerendered = true;
|
||||
stateMask |= PRERENDERED;
|
||||
}
|
||||
|
||||
internal void InitRecursive(Control namingContainer)
|
||||
{
|
||||
if (_controls != null) {
|
||||
if (_isNamingContainer)
|
||||
if (HasControls ()) {
|
||||
if ((stateMask & IS_NAMING_CONTAINER) != 0)
|
||||
namingContainer = this;
|
||||
|
||||
if (namingContainer != null &&
|
||||
namingContainer._userId == null &&
|
||||
namingContainer.autoID)
|
||||
namingContainer.AutoID)
|
||||
namingContainer._userId = namingContainer.GetDefaultName () + "b";
|
||||
|
||||
foreach (Control c in _controls) {
|
||||
int len = Controls.Count;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
Control c = Controls[i];
|
||||
c._page = Page;
|
||||
c._namingContainer = namingContainer;
|
||||
if (namingContainer != null && c._userId == null && c.autoID)
|
||||
if (namingContainer != null && c._userId == null && c.AutoID)
|
||||
c._userId = namingContainer.GetDefaultName () + "c";
|
||||
|
||||
c.InitRecursive (namingContainer);
|
||||
}
|
||||
c.InitRecursive (namingContainer);
|
||||
}
|
||||
}
|
||||
|
||||
initing = true;
|
||||
stateMask |= INITING;
|
||||
OnInit (EventArgs.Empty);
|
||||
TrackViewState ();
|
||||
inited = true;
|
||||
initing = false;
|
||||
stateMask |= INITED;
|
||||
stateMask &= ~INITING;
|
||||
}
|
||||
|
||||
internal object SaveViewStateRecursive ()
|
||||
@@ -876,19 +904,26 @@ namespace System.Web.UI
|
||||
ArrayList controlStates = null;
|
||||
|
||||
int idx = -1;
|
||||
foreach (Control ctrl in Controls) {
|
||||
object ctrlState = ctrl.SaveViewStateRecursive ();
|
||||
idx++;
|
||||
if (ctrlState == null)
|
||||
continue;
|
||||
if (HasControls ())
|
||||
{
|
||||
int len = Controls.Count;
|
||||
for (int i=0;i<len;i++)
|
||||
{
|
||||
Control ctrl = Controls[i];
|
||||
object ctrlState = ctrl.SaveViewStateRecursive ();
|
||||
idx++;
|
||||
if (ctrlState == null)
|
||||
continue;
|
||||
|
||||
if (controlList == null) {
|
||||
controlList = new ArrayList ();
|
||||
controlStates = new ArrayList ();
|
||||
if (controlList == null)
|
||||
{
|
||||
controlList = new ArrayList ();
|
||||
controlStates = new ArrayList ();
|
||||
}
|
||||
|
||||
controlList.Add (idx);
|
||||
controlStates.Add (ctrlState);
|
||||
}
|
||||
|
||||
controlList.Add (idx);
|
||||
controlStates.Add (ctrlState);
|
||||
}
|
||||
|
||||
object thisState = SaveViewState ();
|
||||
@@ -924,7 +959,7 @@ namespace System.Web.UI
|
||||
}
|
||||
}
|
||||
|
||||
viewStateLoaded = true;
|
||||
stateMask |= VIEWSTATE_LOADED;
|
||||
}
|
||||
|
||||
void IParserAccessor.AddParsedSubObject(object obj)
|
||||
@@ -949,18 +984,18 @@ namespace System.Web.UI
|
||||
return (dataBindings!=null && dataBindings.Count>0);
|
||||
}
|
||||
}
|
||||
|
||||
internal bool AutoID
|
||||
{
|
||||
get { return autoID; }
|
||||
set {
|
||||
if (value == false && _isNamingContainer)
|
||||
return;
|
||||
|
||||
autoID = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal bool AutoID
|
||||
{
|
||||
get { return (stateMask & AUTOID) != 0; }
|
||||
set {
|
||||
if (value == false && (stateMask & IS_NAMING_CONTAINER) != 0)
|
||||
return;
|
||||
|
||||
SetMask (AUTOID, value);
|
||||
}
|
||||
}
|
||||
|
||||
internal void PreventAutoID()
|
||||
{
|
||||
AutoID = false;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//
|
||||
// System.Web.UI.ControlCollection.cs
|
||||
//
|
||||
// Duncan Mak ([email protected])
|
||||
// Authors:
|
||||
// Duncan Mak ([email protected])
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc.
|
||||
// Copyright (c) 2002-2004 Novell, Inc. (http://www.novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
@@ -34,41 +36,39 @@ namespace System.Web.UI {
|
||||
|
||||
public class ControlCollection : ICollection, IEnumerable
|
||||
{
|
||||
ArrayList list;
|
||||
Control owner;
|
||||
Control [] controls;
|
||||
int version;
|
||||
int count;
|
||||
bool readOnly;
|
||||
|
||||
public ControlCollection (Control owner)
|
||||
{
|
||||
if (owner == null)
|
||||
throw new ArgumentException ();
|
||||
throw new ArgumentException ("owner");
|
||||
|
||||
list = new ArrayList ();
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
internal ControlCollection (Control owner, bool shortList)
|
||||
{
|
||||
if (owner == null)
|
||||
throw new ArgumentException ();
|
||||
|
||||
list = new ArrayList (shortList ? 1 : 0);
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get { return list.Count; }
|
||||
get { return count; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly {
|
||||
get { return list.IsReadOnly; }
|
||||
get { return readOnly; }
|
||||
}
|
||||
|
||||
public bool IsSynchronized {
|
||||
get { return list.IsSynchronized; }
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public virtual Control this [int index] {
|
||||
get { return list [index] as Control; }
|
||||
get {
|
||||
if (index < 0 || index >= count)
|
||||
throw new ArgumentOutOfRangeException ("index");
|
||||
|
||||
return controls [index];
|
||||
}
|
||||
}
|
||||
|
||||
protected Control Owner {
|
||||
@@ -76,18 +76,33 @@ namespace System.Web.UI {
|
||||
}
|
||||
|
||||
public object SyncRoot {
|
||||
get { return list.SyncRoot; }
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
void EnsureControls ()
|
||||
{
|
||||
if (controls == null) {
|
||||
controls = new Control [5];
|
||||
} else if (controls.Length < count + 1) {
|
||||
int n = controls.Length == 5 ? 3 : 2;
|
||||
Control [] newControls = new Control [controls.Length * n];
|
||||
Array.Copy (controls, 0, newControls, 0, controls.Length);
|
||||
controls = newControls;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Add (Control child)
|
||||
{
|
||||
if (child == null)
|
||||
throw new ArgumentNullException ();
|
||||
if (IsReadOnly)
|
||||
|
||||
if (readOnly)
|
||||
throw new HttpException ();
|
||||
|
||||
list.Add (child);
|
||||
owner.AddedControl (child, list.Count - 1);
|
||||
EnsureControls ();
|
||||
version++;
|
||||
controls [count++] = child;
|
||||
owner.AddedControl (child, count - 1);
|
||||
}
|
||||
|
||||
public virtual void AddAt (int index, Control child)
|
||||
@@ -95,64 +110,134 @@ namespace System.Web.UI {
|
||||
if (child == null) // maybe we should check for ! (child is Control)?
|
||||
throw new ArgumentNullException ();
|
||||
|
||||
if ((index < -1) || (index > Count))
|
||||
if (index < -1 || index > count)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
if (IsReadOnly)
|
||||
if (readOnly)
|
||||
throw new HttpException ();
|
||||
|
||||
if (index == -1){
|
||||
if (index == -1) {
|
||||
Add (child);
|
||||
} else {
|
||||
list.Insert (index, child);
|
||||
owner.AddedControl (child, index);
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureControls ();
|
||||
version++;
|
||||
Array.Copy (controls, index, controls, index + 1, count - index);
|
||||
count++;
|
||||
controls [index] = child;
|
||||
owner.AddedControl (child, index);
|
||||
}
|
||||
|
||||
public virtual void Clear ()
|
||||
{
|
||||
foreach (Control ctrl in list)
|
||||
owner.RemovedControl (ctrl);
|
||||
if (controls == null)
|
||||
return;
|
||||
|
||||
list.Clear ();
|
||||
version++;
|
||||
for (int i = 0; i < count; i++)
|
||||
owner.RemovedControl (controls [i]);
|
||||
|
||||
count = 0;
|
||||
if (owner != null)
|
||||
owner.ResetChildNames ();
|
||||
}
|
||||
|
||||
public virtual bool Contains (Control c)
|
||||
{
|
||||
return list.Contains (c);
|
||||
return (controls != null && Array.IndexOf (controls, c) != -1);
|
||||
}
|
||||
|
||||
public void CopyTo (Array array, int index)
|
||||
{
|
||||
list.CopyTo (array, index);
|
||||
if (controls == null)
|
||||
return;
|
||||
|
||||
controls.CopyTo (array, index);
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator ()
|
||||
{
|
||||
return list.GetEnumerator ();
|
||||
return new SimpleEnumerator (this);
|
||||
}
|
||||
|
||||
public virtual int IndexOf (Control c)
|
||||
{
|
||||
return list.IndexOf (c);
|
||||
if (controls == null)
|
||||
return -1;
|
||||
|
||||
return Array.IndexOf (controls, c);
|
||||
}
|
||||
|
||||
public virtual void Remove (Control value)
|
||||
{
|
||||
list.Remove (value);
|
||||
owner.RemovedControl (value);
|
||||
int idx = IndexOf (value);
|
||||
if (idx == -1)
|
||||
return;
|
||||
RemoveAt (idx);
|
||||
}
|
||||
|
||||
public virtual void RemoveAt (int index)
|
||||
{
|
||||
if (IsReadOnly)
|
||||
if (readOnly)
|
||||
throw new HttpException ();
|
||||
|
||||
Control value = (Control) list [index];
|
||||
list.RemoveAt (index);
|
||||
owner.RemovedControl (value);
|
||||
version++;
|
||||
Control ctrl = controls [index];
|
||||
count--;
|
||||
if (count - index > 0)
|
||||
Array.Copy (controls, index + 1, controls, index, count - index);
|
||||
|
||||
controls [count] = null;
|
||||
owner.RemovedControl (ctrl);
|
||||
}
|
||||
|
||||
// Almost the same as in ArrayList
|
||||
sealed class SimpleEnumerator : IEnumerator
|
||||
{
|
||||
ControlCollection coll;
|
||||
int index;
|
||||
int version;
|
||||
object currentElement;
|
||||
|
||||
public SimpleEnumerator (ControlCollection coll)
|
||||
{
|
||||
this.coll = coll;
|
||||
index = -1;
|
||||
version = coll.version;
|
||||
}
|
||||
|
||||
public bool MoveNext ()
|
||||
{
|
||||
if (version != coll.version)
|
||||
throw new InvalidOperationException ("List has changed.");
|
||||
|
||||
if (index >= -1 && ++index < coll.Count) {
|
||||
currentElement = coll [index];
|
||||
return true;
|
||||
} else {
|
||||
index = -2;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public object Current {
|
||||
get {
|
||||
if (index < 0)
|
||||
throw new InvalidOperationException (index == -1 ? "Enumerator not started" : "Enumerator ended");
|
||||
|
||||
return currentElement;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset ()
|
||||
{
|
||||
if (version != coll.version)
|
||||
throw new InvalidOperationException ("List has changed.");
|
||||
|
||||
index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace System.Web.UI {
|
||||
public class EmptyControlCollection : ControlCollection
|
||||
{
|
||||
public EmptyControlCollection (Control owner)
|
||||
: base (owner, true)
|
||||
: base (owner)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* UrlUtils.cs: made (Insert|Get|Remove)SessionId use the appRoot +
|
||||
SessionID + vpath format.
|
||||
|
||||
2004-07-20 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* UrlUtils.cs: don't pass double slash when the path begins with a
|
||||
|
||||
@@ -333,32 +333,61 @@ namespace System.Web.Util
|
||||
return url;
|
||||
}
|
||||
|
||||
// appRoot + SessionID + vpath
|
||||
public static string InsertSessionId (string id, string path)
|
||||
{
|
||||
string dir = GetDirectory (path);
|
||||
if (!dir.EndsWith ("/"))
|
||||
dir += "/";
|
||||
|
||||
return Reduce (dir + "(" + id + ")/" + GetFile (path));
|
||||
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
|
||||
if (!appvpath.EndsWith ("/"))
|
||||
appvpath += "/";
|
||||
|
||||
if (path.StartsWith (appvpath))
|
||||
path = path.Substring (appvpath.Length);
|
||||
|
||||
if (path [0] == '/')
|
||||
path = path.Length > 1 ? path.Substring (1) : "";
|
||||
|
||||
return Reduce (appvpath + "(" + id + ")/" + path);
|
||||
}
|
||||
|
||||
public static string GetSessionId (string path)
|
||||
{
|
||||
int len = path.Length;
|
||||
if ((len < SessionId.IdLength + 2) || (path [len - 1] != ')') ||
|
||||
(path [len - SessionId.IdLength - 2] != '('))
|
||||
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
|
||||
if (path.Length <= appvpath.Length)
|
||||
return null;
|
||||
|
||||
return path.Substring (len - SessionId.IdLength - 1, SessionId.IdLength);
|
||||
path = path.Substring (appvpath.Length);
|
||||
if (path.Length == 0 || path [0] != '/')
|
||||
path = '/' + path;
|
||||
|
||||
int len = path.Length;
|
||||
if ((len < SessionId.IdLength + 3) || (path [1] != '(') ||
|
||||
(path [SessionId.IdLength + 2] != ')'))
|
||||
return null;
|
||||
|
||||
return path.Substring (2, SessionId.IdLength);
|
||||
}
|
||||
|
||||
public static string RemoveSessionId (string base_path, string file_path)
|
||||
{
|
||||
int len = base_path.Length;
|
||||
string dir = base_path.Substring (0, len - SessionId.IdLength - 2);
|
||||
// Caller did a GetSessionId first
|
||||
int idx = base_path.IndexOf ("/(");
|
||||
string dir = base_path.Substring (0, idx + 1);
|
||||
if (!dir.EndsWith ("/"))
|
||||
dir += "/";
|
||||
|
||||
idx = base_path.IndexOf (")/");
|
||||
if (idx != -1 && base_path.Length > idx + 2) {
|
||||
string dir2 = base_path.Substring (idx + 2);
|
||||
if (!dir2.EndsWith ("/"))
|
||||
dir2 += "/";
|
||||
|
||||
dir += dir2;
|
||||
}
|
||||
|
||||
return Reduce (dir + GetFile (file_path));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ System.Web/ProcessModelInfo.cs
|
||||
System.Web/ProcessShutdownReason.cs
|
||||
System.Web/ProcessStatus.cs
|
||||
System.Web/QueueManager.cs
|
||||
System.Web/ReusableMemoryStream.cs
|
||||
System.Web/ServerVariablesCollection.cs
|
||||
System.Web/StaticFileHandler.cs
|
||||
System.Web/TODOAttribute.cs
|
||||
|
||||
@@ -1,3 +1,40 @@
|
||||
2005-01-20 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpApplication.cs: if there are no more handlers, finish the request and
|
||||
ensure we call Complete on it. Now FreeTextBox 3.0 works.
|
||||
|
||||
2004-12-21 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpRequest.cs: honor the maxRequestSize limit from machine.config.
|
||||
|
||||
2004-12-15 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpApplication.cs: reread application CultureInfo as web.config
|
||||
might have changed. Fixes bug #62539.
|
||||
|
||||
2004-11-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpResponse.cs: fixed ApplyAppPathModifier to insert the session ID.
|
||||
|
||||
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpApplicationFactory.cs: monitor changes in global.asax and bin
|
||||
directory and shutdown the application when that happens. Fixes bug
|
||||
#49651.
|
||||
|
||||
2004-11-29 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* ReusableMemoryStream.cs: copied from System.IO.MemoryStream and
|
||||
slightly modified to allow expanding the buffer for cases on which the
|
||||
regular MemoryStream don't allow it.
|
||||
|
||||
* HttpWriter.cs: use the new ReusableMemoryStream and fix bug #59841.
|
||||
Otherwise we would have to allocate a new MemoryStream...
|
||||
|
||||
2004-11-28 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpApplication.cs: Create() is now GetInstance().
|
||||
|
||||
2004-11-12 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HttpResponse.cs: added internl SetHeadersSent.
|
||||
|
||||
@@ -660,6 +660,11 @@ namespace System.Web
|
||||
_currentStateIdx++;
|
||||
}
|
||||
|
||||
if (_currentStateIdx >= _handlers.Length) {
|
||||
_currentStateIdx = _endStateIdx;
|
||||
break;
|
||||
}
|
||||
|
||||
handler = _handlers [_currentStateIdx];
|
||||
_countSteps++;
|
||||
lasterror = ExecuteState (handler, ref ready_sync);
|
||||
@@ -674,7 +679,6 @@ namespace System.Web
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Finish the request off..
|
||||
if (lasterror != null || _currentStateIdx == _endStateIdx) {
|
||||
_app._asyncWebResult.Complete ((_countSyncSteps == _countSteps),
|
||||
@@ -787,7 +791,7 @@ namespace System.Web
|
||||
if (handler == null)
|
||||
throw new HttpException ("Cannot get system.web/httpHandlers handler.");
|
||||
|
||||
object result = handler.FindHandler (type, file).Create ();
|
||||
object result = handler.FindHandler (type, file).GetInstance ();
|
||||
if (result is IHttpHandler)
|
||||
return (IHttpHandler) result;
|
||||
|
||||
@@ -890,6 +894,7 @@ namespace System.Web
|
||||
|
||||
internal void OnStateExecuteEnter ()
|
||||
{
|
||||
InitCulture ();
|
||||
SaveThreadCulture ();
|
||||
_savedContext = HttpContext.Context;
|
||||
HttpContext.Context = _Context;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
//
|
||||
// System.Web.HttpApplicationFactory
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (c) 2002,2003 Ximian, Inc. (http://www.ximian.com)
|
||||
//
|
||||
//
|
||||
// System.Web.HttpApplicationFactory
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (c) 2002,2003 Ximian, Inc. (http://www.ximian.com)
|
||||
// (c) Copyright 2004 Novell, Inc. (http://www.novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
@@ -28,26 +29,30 @@
|
||||
// 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.IO;
|
||||
using System.Reflection;
|
||||
using System.Web.UI;
|
||||
using System.Web.Compilation;
|
||||
using System.Web.SessionState;
|
||||
|
||||
namespace System.Web {
|
||||
class HttpApplicationFactory {
|
||||
private string _appFilename;
|
||||
private Type _appType;
|
||||
|
||||
private bool _appInitialized;
|
||||
private bool _appFiredEnd;
|
||||
|
||||
private Stack _appFreePublicList;
|
||||
private int _appFreePublicInstances;
|
||||
static private int _appMaxFreePublicInstances = 32;
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Web.UI;
|
||||
using System.Web.Compilation;
|
||||
using System.Web.SessionState;
|
||||
|
||||
namespace System.Web {
|
||||
class HttpApplicationFactory {
|
||||
private string _appFilename;
|
||||
private Type _appType;
|
||||
|
||||
private bool _appInitialized;
|
||||
private bool _appFiredEnd;
|
||||
|
||||
private Stack _appFreePublicList;
|
||||
private int _appFreePublicInstances;
|
||||
|
||||
FileSystemWatcher appFileWatcher;
|
||||
FileSystemWatcher binWatcher;
|
||||
|
||||
static private int _appMaxFreePublicInstances = 32;
|
||||
|
||||
private HttpApplicationState _state;
|
||||
|
||||
static IHttpHandler custApplication;
|
||||
@@ -71,22 +76,23 @@ namespace System.Web {
|
||||
|
||||
return Path.Combine (physicalAppPath, "global.asax");
|
||||
}
|
||||
|
||||
private void CompileApp(HttpContext context) {
|
||||
if (File.Exists(_appFilename)) {
|
||||
// Setup filemonitor for all filedepend also. CacheDependency?
|
||||
|
||||
_appType = ApplicationFileParser.GetCompiledApplicationType (_appFilename, context);
|
||||
if (_appType == null) {
|
||||
string msg = String.Format ("Error compiling application file ({0}).", _appFilename);
|
||||
throw new ApplicationException (msg);
|
||||
}
|
||||
} else {
|
||||
_appType = typeof (System.Web.HttpApplication);
|
||||
_state = new HttpApplicationState ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CompileApp (HttpContext context)
|
||||
{
|
||||
if (File.Exists (_appFilename)) {
|
||||
_appType = ApplicationFileParser.GetCompiledApplicationType (_appFilename, context);
|
||||
if (_appType == null) {
|
||||
string msg = String.Format ("Error compiling application file ({0}).", _appFilename);
|
||||
throw new ApplicationException (msg);
|
||||
}
|
||||
|
||||
appFileWatcher = CreateWatcher (_appFilename, new FileSystemEventHandler (OnAppFileChanged));
|
||||
} else {
|
||||
_appType = typeof (System.Web.HttpApplication);
|
||||
_state = new HttpApplicationState ();
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsEventHandler (MethodInfo m)
|
||||
{
|
||||
if (m.ReturnType != typeof (void))
|
||||
@@ -175,6 +181,29 @@ namespace System.Web {
|
||||
app.Dispose ();
|
||||
}
|
||||
|
||||
FileSystemWatcher CreateWatcher (string file, FileSystemEventHandler hnd)
|
||||
{
|
||||
FileSystemWatcher watcher = new FileSystemWatcher ();
|
||||
|
||||
watcher.Path = Path.GetFullPath (Path.GetDirectoryName (file));
|
||||
watcher.Filter = Path.GetFileName (file);
|
||||
|
||||
watcher.Changed += hnd;
|
||||
watcher.Created += hnd;
|
||||
watcher.Deleted += hnd;
|
||||
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
return watcher;
|
||||
}
|
||||
|
||||
void OnAppFileChanged (object sender, FileSystemEventArgs args)
|
||||
{
|
||||
binWatcher.EnableRaisingEvents = false;
|
||||
appFileWatcher.EnableRaisingEvents = false;
|
||||
HttpRuntime.UnloadAppDomain ();
|
||||
}
|
||||
|
||||
private void InitializeFactory (HttpContext context)
|
||||
{
|
||||
_appFilename = GetAppFilename (context);
|
||||
@@ -186,7 +215,14 @@ namespace System.Web {
|
||||
|
||||
// Startup
|
||||
app.Startup(context, HttpApplicationFactory.ApplicationState);
|
||||
|
||||
|
||||
// Shutdown the application if bin directory changes.
|
||||
string binFiles = HttpRuntime.BinDirectory;
|
||||
if (Directory.Exists (binFiles))
|
||||
binFiles = Path.Combine (binFiles, "*.*");
|
||||
|
||||
binWatcher = CreateWatcher (binFiles, new FileSystemEventHandler (OnAppFileChanged));
|
||||
|
||||
// Fire OnAppStart
|
||||
HttpApplicationFactory.FireOnAppStart (app);
|
||||
|
||||
|
||||
@@ -226,6 +226,11 @@ namespace System.Web {
|
||||
_arrRawContent = new byte [0];
|
||||
|
||||
int length = ContentLength;
|
||||
HttpRuntimeConfig cfg = (HttpRuntimeConfig) _oContext.GetConfig ("system.web/httpRuntime");
|
||||
int maxRequestLength = cfg.MaxRequestLength * 1024;
|
||||
if (ContentLength > maxRequestLength)
|
||||
throw new HttpException (400, "Maximum request length exceeded.");
|
||||
|
||||
if (_WorkerRequest.IsEntireEntityBodyIsPreloaded () || length <= _arrRawContent.Length)
|
||||
return _arrRawContent;
|
||||
|
||||
@@ -242,6 +247,9 @@ namespace System.Web {
|
||||
if (read == 0 ||read == -1 )
|
||||
break;
|
||||
|
||||
if (ContentLength > maxRequestLength || ms.Length + read > maxRequestLength)
|
||||
throw new HttpException (400, "Maximum request length exceeded.");
|
||||
|
||||
ms.Write (arrBuffer, 0, read);
|
||||
}
|
||||
|
||||
|
||||
@@ -356,8 +356,15 @@ namespace System.Web
|
||||
virtualPath = UrlUtils.Reduce (virtualPath);
|
||||
}
|
||||
|
||||
if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) > 0)
|
||||
virtualPath = UrlUtils.Combine (app_path_mod, virtualPath);
|
||||
if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) < 0) {
|
||||
string rvd = _Context.Request.RootVirtualDir;
|
||||
string basevd = rvd.Replace (app_path_mod, "");
|
||||
|
||||
if (!virtualPath.StartsWith (basevd))
|
||||
return virtualPath;
|
||||
|
||||
virtualPath = UrlUtils.Combine (rvd, virtualPath.Substring (basevd.Length));
|
||||
}
|
||||
|
||||
return virtualPath;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace System.Web
|
||||
|
||||
HttpResponseStream _ResponseStream;
|
||||
|
||||
MemoryStream _OutputStream;
|
||||
ReusableMemoryStream _OutputStream;
|
||||
StreamWriter _OutputHelper;
|
||||
Encoding _Encoding;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace System.Web
|
||||
_Response = Response;
|
||||
|
||||
_Encoding = _Response.ContentEncoding;
|
||||
_OutputStream = new MemoryStream (MaxBufferSize);
|
||||
_OutputStream = new ReusableMemoryStream (MaxBufferSize);
|
||||
_OutputHelper = new StreamWriter (_OutputStream, _Response.ContentEncoding);
|
||||
_ResponseStream = new HttpResponseStream (this);
|
||||
}
|
||||
@@ -116,9 +116,9 @@ namespace System.Web
|
||||
|
||||
internal void Clear ()
|
||||
{
|
||||
// This clears all the buffers that are around
|
||||
_OutputHelper.Flush ();
|
||||
_OutputStream.SetLength (0);
|
||||
_OutputHelper.Close ();
|
||||
_OutputStream = new ReusableMemoryStream (_OutputStream.GetBuffer ());
|
||||
_OutputHelper = new StreamWriter (_OutputStream, _Response.ContentEncoding);
|
||||
}
|
||||
|
||||
internal void SendContent (HttpWorkerRequest Handler)
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
//
|
||||
// System.Web.ReusableMemoryStream
|
||||
// Trimmed down copy of System.IO.MemoryStream used by HttpWriter.
|
||||
//
|
||||
// Authors: Marcin Szczepanski ([email protected])
|
||||
// Patrik Torstensson
|
||||
// Gonzalo Paniagua Javier ([email protected])
|
||||
//
|
||||
// (c) 2001,2002 Marcin Szczepanski, Patrik Torstensson
|
||||
// (c) 2003 Ximian, Inc. (http://www.ximian.com)
|
||||
// Copyright (C) 2004 Novell (http://www.novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Web
|
||||
{
|
||||
[Serializable]
|
||||
class ReusableMemoryStream : Stream
|
||||
{
|
||||
int capacity;
|
||||
int length;
|
||||
byte [] internalBuffer;
|
||||
bool streamClosed;
|
||||
int position;
|
||||
|
||||
public ReusableMemoryStream (int capacity)
|
||||
{
|
||||
if (capacity < 0)
|
||||
throw new ArgumentOutOfRangeException ("capacity");
|
||||
|
||||
this.capacity = capacity;
|
||||
internalBuffer = new byte [capacity];
|
||||
}
|
||||
|
||||
public ReusableMemoryStream (byte [] buffer)
|
||||
{
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException ("buffer");
|
||||
|
||||
capacity = buffer.Length;
|
||||
internalBuffer = buffer;
|
||||
}
|
||||
|
||||
void CheckIfClosedThrowDisposed ()
|
||||
{
|
||||
if (streamClosed)
|
||||
throw new ObjectDisposedException (GetType ().ToString ());
|
||||
}
|
||||
|
||||
public override bool CanRead {
|
||||
get { return !streamClosed; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
get { return !streamClosed; }
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return !streamClosed; }
|
||||
}
|
||||
|
||||
int Capacity {
|
||||
get {
|
||||
CheckIfClosedThrowDisposed ();
|
||||
return capacity;
|
||||
}
|
||||
|
||||
set {
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (value == capacity)
|
||||
return; // LAMENESS: see MemoryStreamTest.ConstructorFive
|
||||
|
||||
if (value < 0 || value < length)
|
||||
throw new ArgumentOutOfRangeException ("value",
|
||||
"New capacity cannot be negative or less than the current capacity " + value + " " + capacity);
|
||||
|
||||
byte [] newBuffer = null;
|
||||
if (value != 0) {
|
||||
newBuffer = new byte [value];
|
||||
Buffer.BlockCopy (internalBuffer, 0, newBuffer, 0, length);
|
||||
}
|
||||
|
||||
internalBuffer = newBuffer; // It's null when capacity is set to 0
|
||||
capacity = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
get {
|
||||
CheckIfClosedThrowDisposed ();
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
public override long Position {
|
||||
get {
|
||||
CheckIfClosedThrowDisposed ();
|
||||
return position;
|
||||
}
|
||||
|
||||
set {
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (value < 0)
|
||||
throw new ArgumentOutOfRangeException ("value",
|
||||
"Position cannot be negative" );
|
||||
|
||||
if (value > Int32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ("value",
|
||||
"Position must be non-negative and less than 2^31 - 1 - origin");
|
||||
|
||||
position = (int) value;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Close ()
|
||||
{
|
||||
streamClosed = true;
|
||||
}
|
||||
|
||||
public override void Flush ()
|
||||
{
|
||||
}
|
||||
|
||||
public byte [] GetBuffer ()
|
||||
{
|
||||
return internalBuffer;
|
||||
}
|
||||
|
||||
public override int Read ([In,Out] byte [] buffer, int offset, int count)
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException ("buffer");
|
||||
|
||||
if (position >= length || count == 0)
|
||||
return 0;
|
||||
|
||||
if (position > length - count)
|
||||
count = length - position;
|
||||
|
||||
Buffer.BlockCopy (internalBuffer, position, buffer, offset, count);
|
||||
position += count;
|
||||
return count;
|
||||
}
|
||||
|
||||
public override int ReadByte ()
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (position >= length)
|
||||
return -1;
|
||||
|
||||
return internalBuffer [position++];
|
||||
}
|
||||
|
||||
public override long Seek (long offset, SeekOrigin loc)
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
|
||||
if (offset > (long) Int32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ("Offset out of range. " + offset);
|
||||
|
||||
int refPoint;
|
||||
switch (loc) {
|
||||
case SeekOrigin.Begin:
|
||||
if (offset < 0)
|
||||
throw new IOException ("Attempted to seek before start of MemoryStream.");
|
||||
refPoint = 0;
|
||||
break;
|
||||
case SeekOrigin.Current:
|
||||
refPoint = position;
|
||||
break;
|
||||
case SeekOrigin.End:
|
||||
refPoint = length;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException ("loc", "Invalid SeekOrigin");
|
||||
}
|
||||
|
||||
refPoint += (int) offset;
|
||||
if (refPoint < 0)
|
||||
throw new IOException ("Attempted to seek before start of MemoryStream.");
|
||||
|
||||
position = refPoint;
|
||||
return position;
|
||||
}
|
||||
|
||||
int CalculateNewCapacity (int minimum)
|
||||
{
|
||||
if (minimum < 256)
|
||||
minimum = 256;
|
||||
|
||||
if (minimum < capacity * 2)
|
||||
minimum = capacity * 2;
|
||||
|
||||
return minimum;
|
||||
}
|
||||
|
||||
public override void SetLength (long value)
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
|
||||
if (value < 0 || value > (long) Int32.MaxValue)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
int newSize = (int) value;
|
||||
if (newSize > capacity)
|
||||
Capacity = CalculateNewCapacity (newSize);
|
||||
else if (newSize < length)
|
||||
Array.Clear (internalBuffer, newSize, length - newSize);
|
||||
|
||||
length = newSize;
|
||||
if (position > length)
|
||||
position = length;
|
||||
}
|
||||
|
||||
public override void Write (byte [] buffer, int offset, int count)
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException ("buffer");
|
||||
|
||||
if (offset < 0 || count < 0)
|
||||
throw new ArgumentOutOfRangeException ();
|
||||
|
||||
if (buffer.Length - offset < count)
|
||||
throw new ArgumentException ("offset+count",
|
||||
"The size of the buffer is less than offset + count.");
|
||||
|
||||
// reordered to avoid possible integer overflow
|
||||
if (position > capacity - count)
|
||||
Capacity = CalculateNewCapacity (position + count);
|
||||
|
||||
Buffer.BlockCopy (buffer, offset, internalBuffer, position, count);
|
||||
position += count;
|
||||
if (position >= length)
|
||||
length = position;
|
||||
}
|
||||
|
||||
public override void WriteByte (byte value)
|
||||
{
|
||||
CheckIfClosedThrowDisposed ();
|
||||
if (position >= capacity)
|
||||
Capacity = CalculateNewCapacity (position + 1);
|
||||
|
||||
if (position >= length)
|
||||
length = position + 1;
|
||||
|
||||
internalBuffer [position++] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2004-11-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XslVariable.cs : Local param might be overriden by XsltArgumentList.
|
||||
(plus some extraneous field cleanup.)
|
||||
|
||||
2004-06-18 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XslNumber.cs : Globalization. Removed unused code.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2005-01-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlSchema.cs : Write() should handle carefully output
|
||||
namespace/prefix mapping.
|
||||
|
||||
2004-09-16 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* BuiltInDatatype.cs, SchemaDataValueType.cs :
|
||||
|
||||
@@ -893,8 +893,6 @@ namespace System.Xml.Schema
|
||||
XmlSerializerNamespaces nss = new XmlSerializerNamespaces ();
|
||||
|
||||
if (namespaceManager != null) {
|
||||
if (nss == null)
|
||||
nss = new XmlSerializerNamespaces ();
|
||||
foreach (string name in namespaceManager) {
|
||||
//xml and xmlns namespaces are added by default in namespaceManager.
|
||||
//So we should ignore them
|
||||
@@ -904,10 +902,21 @@ namespace System.Xml.Schema
|
||||
}
|
||||
|
||||
if (Namespaces != null && Namespaces.Count > 0) {
|
||||
nss.Add (String.Empty, XmlSchema.Namespace);
|
||||
foreach (XmlQualifiedName qn in Namespaces.ToArray ()) {
|
||||
XmlQualifiedName [] qnames = Namespaces.ToArray ();
|
||||
foreach (XmlQualifiedName qn in qnames)
|
||||
nss.Add (qn.Name, qn.Namespace);
|
||||
string p = String.Empty;
|
||||
bool loop = true;
|
||||
for (int idx = 1; loop; idx++) {
|
||||
loop = false;
|
||||
foreach (XmlQualifiedName qn in qnames)
|
||||
if (qn.Name == p) {
|
||||
p = "q" + idx;
|
||||
loop = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
nss.Add (p, XmlSchema.Namespace);
|
||||
}
|
||||
|
||||
if (nss.Count == 0) {
|
||||
|
||||
@@ -1,3 +1,48 @@
|
||||
2005-01-25 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* XmlSchemaImporter.cs: When importing a default value of type enum,
|
||||
translate it from the schema value to the clr value.
|
||||
|
||||
2005-01-18 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* SerializationCodeGenerator.cs: don't use _config if it has not been
|
||||
assigned.
|
||||
|
||||
2005-01-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SerializationCodeGenerator.cs : the last merge was wrong. Fixed the
|
||||
build.
|
||||
|
||||
2005-01-12 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SerializationCodeGeneratorConfiguration.cs,
|
||||
SerializationCodeGenerator.cs : Added some generation configuration:
|
||||
<generateAsInternal>
|
||||
write custom reader/writer as internal classes.
|
||||
<noreader>, <nowriter>
|
||||
They make generation of reader and/or writer optional.
|
||||
* XmlSerializerNamespaces.cs :
|
||||
Now it uses ListDictionary instead of Hashtable.
|
||||
* XmlSerializationWriter.cs : entries in XmlSerializerNamespaces are
|
||||
written unless there is already the same prefix-ns mapping.
|
||||
|
||||
2005-01-12 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* XmlTypeMapElementInfo.cs: Added new IndexOfElement method.
|
||||
* XmlSchemaImporter.cs: When importing a base type of a complex type,
|
||||
make sure that the base class is always imported as a class and not
|
||||
as an array. If it has been imported as array, import it again.
|
||||
This fixes bug #70839. Other minor fixes as well.
|
||||
* XmlSerializationWriter.cs: Fixed warning.
|
||||
|
||||
2004-12-09 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* SerializationCodeGenerator.cs: Yet another generation fix.
|
||||
|
||||
2004-12-09 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* SerializationCodeGenerator.cs: Fixed generation of enum literals.
|
||||
|
||||
2004-10-19 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlSerializationWriter.cs : When namespace is an empty string,
|
||||
|
||||
@@ -233,9 +233,11 @@ namespace System.Xml.Serialization
|
||||
WriteLine ("namespace " + entry.Key);
|
||||
WriteLineInd ("{");
|
||||
|
||||
GenerateReader (readerClassName, (ArrayList) entry.Value);
|
||||
WriteLine ("");
|
||||
GenerateWriter (writerClassName, (ArrayList) entry.Value);
|
||||
if (!_config.NoReader)
|
||||
GenerateReader (readerClassName, (ArrayList) entry.Value);
|
||||
WriteLine ("");
|
||||
if (!_config.NoWriter)
|
||||
GenerateWriter (writerClassName, (ArrayList) entry.Value);
|
||||
WriteLine ("");
|
||||
|
||||
WriteLineUni ("}");
|
||||
@@ -275,7 +277,10 @@ namespace System.Xml.Serialization
|
||||
|
||||
InitHooks ();
|
||||
|
||||
WriteLine ("public class " + writerClassName + " : XmlSerializationWriter");
|
||||
if (_config == null || !_config.GenerateAsInternal)
|
||||
WriteLine ("public class " + writerClassName + " : XmlSerializationWriter");
|
||||
else
|
||||
WriteLine ("internal class " + writerClassName + " : XmlSerializationWriter");
|
||||
WriteLineInd ("{");
|
||||
|
||||
for (int n=0; n<maps.Count; n++)
|
||||
@@ -1059,7 +1064,10 @@ namespace System.Xml.Serialization
|
||||
|
||||
public void GenerateReader (string readerClassName, ArrayList maps)
|
||||
{
|
||||
WriteLine ("public class " + readerClassName + " : XmlSerializationReader");
|
||||
if (_config == null || !_config.GenerateAsInternal)
|
||||
WriteLine ("public class " + readerClassName + " : XmlSerializationReader");
|
||||
else
|
||||
WriteLine ("internal class " + readerClassName + " : XmlSerializationReader");
|
||||
WriteLineInd ("{");
|
||||
|
||||
_mapsToGenerate = new ArrayList ();
|
||||
@@ -2352,7 +2360,7 @@ namespace System.Xml.Serialization
|
||||
|
||||
string GetTypeOf (Type td)
|
||||
{
|
||||
return "typeof(" + td.FullName + ")";
|
||||
return "typeof(" + td.FullName.Replace ('+','.') + ")";
|
||||
}
|
||||
|
||||
string GetString (string str)
|
||||
@@ -2369,7 +2377,8 @@ namespace System.Xml.Serialization
|
||||
XmlQualifiedName qn = (XmlQualifiedName)ob;
|
||||
return "new XmlQualifiedName (" + GetLiteral(qn.Name) + "," + GetLiteral(qn.Namespace) + ")";
|
||||
}
|
||||
else return (ob is IFormattable) ? ((IFormattable) ob).ToString (null, CultureInfo.InvariantCulture) : ob.ToString ();
|
||||
if (ob is Enum) return ob.GetType () + "." + ob;
|
||||
return (ob is IFormattable) ? ((IFormattable) ob).ToString (null, CultureInfo.InvariantCulture) : ob.ToString ();
|
||||
}
|
||||
|
||||
void WriteLineInd (string code)
|
||||
|
||||
+10
@@ -56,6 +56,16 @@ namespace System.Xml.Serialization
|
||||
[XmlElement ("writer")]
|
||||
public string WriterClassName;
|
||||
|
||||
|
||||
[XmlElement ("noReader")]
|
||||
public bool NoReader;
|
||||
|
||||
[XmlElement ("noWriter")]
|
||||
public bool NoWriter;
|
||||
|
||||
[XmlElement ("generateAsInternal")]
|
||||
public bool GenerateAsInternal;
|
||||
|
||||
[XmlElement ("namespace")]
|
||||
public string Namespace;
|
||||
|
||||
|
||||
@@ -406,6 +406,14 @@ namespace System.Xml.Serialization {
|
||||
return ImportType (name, type, root);
|
||||
}
|
||||
|
||||
XmlTypeMapping ImportClass (XmlQualifiedName name)
|
||||
{
|
||||
XmlTypeMapping map = ImportType (name, null);
|
||||
if (map.TypeData.SchemaType == SchemaTypes.Class) return map;
|
||||
XmlSchemaComplexType stype = schemas.Find (name, typeof (XmlSchemaComplexType)) as XmlSchemaComplexType;
|
||||
return CreateClassMap (name, stype, new XmlQualifiedName (map.ElementName, map.Namespace));
|
||||
}
|
||||
|
||||
XmlTypeMapping ImportType (XmlQualifiedName name, XmlSchemaType stype, XmlQualifiedName root)
|
||||
{
|
||||
XmlTypeMapping map = GetRegisteredTypeMapping (name);
|
||||
@@ -430,8 +438,6 @@ namespace System.Xml.Serialization {
|
||||
|
||||
XmlTypeMapping ImportClassComplexType (XmlQualifiedName typeQName, XmlSchemaComplexType stype, XmlQualifiedName root)
|
||||
{
|
||||
XmlTypeMapping map;
|
||||
|
||||
// The need for fixups: If the complex type is an array, then to get the type of the
|
||||
// array we need first to get the type of the items of the array.
|
||||
// But if one of the item types or its children has a referece to this type array,
|
||||
@@ -449,7 +455,7 @@ namespace System.Xml.Serialization {
|
||||
ListMap listMap = BuildArrayMap (typeQName, stype, out typeData);
|
||||
if (listMap != null)
|
||||
{
|
||||
map = CreateArrayTypeMapping (typeQName, typeData);
|
||||
XmlTypeMapping map = CreateArrayTypeMapping (typeQName, typeData);
|
||||
map.ObjectMap = listMap;
|
||||
return map;
|
||||
}
|
||||
@@ -464,7 +470,12 @@ namespace System.Xml.Serialization {
|
||||
// Register the map right now but do not build it,
|
||||
// This will avoid loops.
|
||||
|
||||
map = CreateTypeMapping (typeQName, SchemaTypes.Class, root);
|
||||
return CreateClassMap (typeQName, stype, root);
|
||||
}
|
||||
|
||||
XmlTypeMapping CreateClassMap (XmlQualifiedName typeQName, XmlSchemaComplexType stype, XmlQualifiedName root)
|
||||
{
|
||||
XmlTypeMapping map = CreateTypeMapping (typeQName, SchemaTypes.Class, root);
|
||||
map.Documentation = GetDocumentation (stype);
|
||||
RegisterMapFixup (map, typeQName, stype);
|
||||
return map;
|
||||
@@ -527,6 +538,8 @@ namespace System.Xml.Serialization {
|
||||
|
||||
ImportAttributes (typeQName, cmap, stype.Attributes, stype.AnyAttribute, classIds);
|
||||
ImportExtensionTypes (typeQName);
|
||||
|
||||
if (isMixed) AddTextMember (typeQName, cmap, classIds);
|
||||
|
||||
GetTypeMapping (TypeTranslator.GetTypeData (typeof(object))).DerivedTypes.Add (map);
|
||||
}
|
||||
@@ -557,7 +570,7 @@ namespace System.Xml.Serialization {
|
||||
member.TypeData = GetAttributeTypeData (typeQName, attr);
|
||||
|
||||
if (refAttr.DefaultValue != null)
|
||||
member.DefaultValue = XmlCustomFormatter.FromXmlString (member.TypeData, refAttr.DefaultValue);
|
||||
member.DefaultValue = ImportDefaultValue (member.TypeData, refAttr.DefaultValue);
|
||||
else if (member.TypeData.IsValueType)
|
||||
member.IsOptionalValueType = (refAttr.ValidatedUse != XmlSchemaUse.Required);
|
||||
|
||||
@@ -690,7 +703,12 @@ namespace System.Xml.Serialization {
|
||||
void ImportParticleComplexContent (XmlQualifiedName typeQName, ClassMap cmap, XmlSchemaParticle particle, CodeIdentifiers classIds, bool isMixed)
|
||||
{
|
||||
ImportParticleContent (typeQName, cmap, particle, classIds, false, ref isMixed);
|
||||
if (isMixed && cmap.XmlTextCollector == null)
|
||||
if (isMixed) AddTextMember (typeQName, cmap, classIds);
|
||||
}
|
||||
|
||||
void AddTextMember (XmlQualifiedName typeQName, ClassMap cmap, CodeIdentifiers classIds)
|
||||
{
|
||||
if (cmap.XmlTextCollector == null)
|
||||
{
|
||||
XmlTypeMapMemberFlatList member = new XmlTypeMapMemberFlatList ();
|
||||
member.Name = classIds.AddUnique ("Text", member);
|
||||
@@ -742,7 +760,7 @@ namespace System.Xml.Serialization {
|
||||
if (typeData.SchemaType != SchemaTypes.Array)
|
||||
{
|
||||
member = new XmlTypeMapMemberElement ();
|
||||
if (refElem.DefaultValue != null) member.DefaultValue = XmlCustomFormatter.FromXmlString (typeData, refElem.DefaultValue);
|
||||
if (refElem.DefaultValue != null) member.DefaultValue = ImportDefaultValue (typeData, refElem.DefaultValue);
|
||||
}
|
||||
else if (GetTypeMapping (typeData).IsSimpleType)
|
||||
{
|
||||
@@ -810,6 +828,18 @@ namespace System.Xml.Serialization {
|
||||
}
|
||||
}
|
||||
|
||||
object ImportDefaultValue (TypeData typeData, string value)
|
||||
{
|
||||
if (typeData.SchemaType == SchemaTypes.Enum) {
|
||||
XmlTypeMapping map = GetTypeMapping (typeData);
|
||||
EnumMap emap = (EnumMap) map.ObjectMap;
|
||||
string res = emap.GetEnumName (value);
|
||||
if (res == null) throw new InvalidOperationException ("'" + value + "' is not a valid enumeration value");
|
||||
return res;
|
||||
} else
|
||||
return XmlCustomFormatter.FromXmlString (typeData, value);
|
||||
}
|
||||
|
||||
void ImportChoiceContent (XmlQualifiedName typeQName, ClassMap cmap, XmlSchemaChoice choice, CodeIdentifiers classIds, bool multiValue)
|
||||
{
|
||||
XmlTypeMapElementInfoList choices = new XmlTypeMapElementInfoList ();
|
||||
@@ -843,8 +873,22 @@ namespace System.Xml.Serialization {
|
||||
bool allEqual = true;
|
||||
Hashtable types = new Hashtable ();
|
||||
|
||||
foreach (XmlTypeMapElementInfo einfo in choices)
|
||||
for (int n = choices.Count - 1; n >= 0; n--)
|
||||
{
|
||||
XmlTypeMapElementInfo einfo = (XmlTypeMapElementInfo) choices [n];
|
||||
|
||||
// In some complex schemas, we may end up with several options
|
||||
// with the same name. It is better to ignore the extra options
|
||||
// than to crash. It's the best we can do, and btw it works
|
||||
// better than in MS.NET.
|
||||
|
||||
if (cmap.GetElement (einfo.ElementName, einfo.Namespace) != null ||
|
||||
choices.IndexOfElement (einfo.ElementName, einfo.Namespace) != n)
|
||||
{
|
||||
choices.RemoveAt (n);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (types.ContainsKey (einfo.TypeData)) twoEqual = true;
|
||||
else types.Add (einfo.TypeData, einfo);
|
||||
|
||||
@@ -1042,7 +1086,7 @@ namespace System.Xml.Serialization {
|
||||
|
||||
// Add base map members to this map
|
||||
|
||||
XmlTypeMapping baseMap = ImportType (qname, null);
|
||||
XmlTypeMapping baseMap = ImportClass (qname);
|
||||
BuildPendingMap (baseMap);
|
||||
ClassMap baseClassMap = (ClassMap)baseMap.ObjectMap;
|
||||
|
||||
|
||||
@@ -479,7 +479,7 @@ namespace System.Xml.Serialization {
|
||||
|
||||
ICollection namespaces = ns.Namespaces.Values;
|
||||
foreach (XmlQualifiedName qn in namespaces) {
|
||||
if (qn.Namespace != String.Empty && Writer.LookupPrefix (qn.Namespace) == null)
|
||||
if (qn.Namespace != String.Empty && Writer.LookupPrefix (qn.Namespace) != qn.Name)
|
||||
WriteAttribute ("xmlns", qn.Name, xmlNamespace, qn.Namespace);
|
||||
}
|
||||
}
|
||||
@@ -742,8 +742,6 @@ namespace System.Xml.Serialization {
|
||||
serializedObjects [o] = o;
|
||||
}
|
||||
|
||||
WriteState oldState = Writer.WriteState;
|
||||
|
||||
string prefix = null;
|
||||
|
||||
if (topLevelElement && ns != null && ns.Length != 0)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace System.Xml.Serialization
|
||||
{
|
||||
@@ -39,11 +40,11 @@ namespace System.Xml.Serialization
|
||||
/// </summary>
|
||||
public class XmlSerializerNamespaces
|
||||
{
|
||||
private Hashtable namespaces;
|
||||
private ListDictionary namespaces;
|
||||
|
||||
public XmlSerializerNamespaces ()
|
||||
{
|
||||
namespaces = new Hashtable ();
|
||||
namespaces = new ListDictionary ();
|
||||
}
|
||||
|
||||
public XmlSerializerNamespaces(XmlQualifiedName[] namespaces)
|
||||
@@ -87,7 +88,7 @@ namespace System.Xml.Serialization
|
||||
return null;
|
||||
}
|
||||
|
||||
internal Hashtable Namespaces
|
||||
internal ListDictionary Namespaces
|
||||
{
|
||||
get {
|
||||
return namespaces;
|
||||
|
||||
@@ -172,6 +172,15 @@ namespace System.Xml.Serialization
|
||||
|
||||
class XmlTypeMapElementInfoList: ArrayList
|
||||
{
|
||||
public int IndexOfElement (string name, string namspace)
|
||||
{
|
||||
for (int n=0; n<Count; n++) {
|
||||
XmlTypeMapElementInfo info = (XmlTypeMapElementInfo) base [n];
|
||||
if (info.ElementName == name && info.Namespace == namspace)
|
||||
return n;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2005-01-13 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlResolver.cs : throw ArgumentException in ResolveUri().
|
||||
|
||||
2005-01-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlTextWriter.cs : WriteComment() was outputting extraneous EOL.
|
||||
|
||||
2004-11-30 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DTDReader.cs : Consideration on parameter entity was missing for
|
||||
attribute default value. Fixed bug #70008.
|
||||
|
||||
2004-11-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlWriter.cs : after WriteAttributes(), argument XmlReader must
|
||||
|
||||
Loaded 100 of 253 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user