mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
109
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4674914b9 | ||
|
|
e7702bf35d | ||
|
|
c3f5ca896a | ||
|
|
a41a82a694 | ||
|
|
bdb31e441e | ||
|
|
0b8e8c6cb7 | ||
|
|
e4c96ec70a | ||
|
|
f91f74d6d7 | ||
|
|
0263ba084f | ||
|
|
4b085e4b62 | ||
|
|
651f863792 | ||
|
|
2365397ca3 | ||
|
|
dfd3372251 | ||
|
|
4c9ee53953 | ||
|
|
8921ca9e49 | ||
|
|
bf1d85db26 | ||
|
|
4f5f2e43e2 | ||
|
|
0d8d9abd48 | ||
|
|
9f4abfb1d5 | ||
|
|
22c4e0ee3b | ||
|
|
4e92234406 | ||
|
|
4ab670066a | ||
|
|
29f9e5ff3d | ||
|
|
292fa3413f | ||
|
|
17ebd3efa0 | ||
|
|
7b6992976a | ||
|
|
02bd2a8b2d | ||
|
|
4415259ba1 | ||
|
|
8253721cb0 | ||
|
|
589b50de6f | ||
|
|
85f197004d | ||
|
|
01c866af9c | ||
|
|
4bf53054c2 | ||
|
|
04ca35cc6a | ||
|
|
43806c6701 | ||
|
|
8dd2dbbe9e | ||
|
|
5c45430b3f | ||
|
|
d70052496a | ||
|
|
3de2cd8abe | ||
|
|
91f3e24d60 | ||
|
|
681488c662 | ||
|
|
3b095deb1e | ||
|
|
5cc7eaea6e | ||
|
|
7803cd3ec4 | ||
|
|
4ebde82145 | ||
|
|
b9b681b89f | ||
|
|
a5aeef3952 | ||
|
|
4de89dd439 | ||
|
|
15c9b8f2ca | ||
|
|
8baca4235f | ||
|
|
a927d1db6a | ||
|
|
efed257d39 | ||
|
|
9ad9b08458 | ||
|
|
9b2393d1c7 | ||
|
|
463c186397 | ||
|
|
45d870860c | ||
|
|
47df667e6e | ||
|
|
62e7e2c54d | ||
|
|
788c9757fd | ||
|
|
daa2f108f3 | ||
|
|
81bb1146d4 | ||
|
|
8da02c6d46 | ||
|
|
fa1a176ef6 | ||
|
|
aebf222336 | ||
|
|
5afdc7affb | ||
|
|
7d6aa1e322 | ||
|
|
db66ea05c0 | ||
|
|
43e34e9221 | ||
|
|
69154db126 | ||
|
|
1f7a1c183c | ||
|
|
beb7543392 | ||
|
|
d0dbad9ad7 | ||
|
|
4f8c33af39 | ||
|
|
90c46b9308 | ||
|
|
8082e15625 | ||
|
|
58864d7fca | ||
|
|
c79c91c80c | ||
|
|
8973515d9d | ||
|
|
9346c56300 | ||
|
|
5a4e4d261b | ||
|
|
259bc42379 | ||
|
|
9b28a1de73 | ||
|
|
1eb27e1f63 | ||
|
|
7edb572581 | ||
|
|
364a5d0b74 | ||
|
|
3aa9628276 | ||
|
|
bcc8b6fb2d | ||
|
|
eefca1d2f0 | ||
|
|
075b2246c4 | ||
|
|
70390d5989 | ||
|
|
08a3283160 | ||
|
|
f65e2f5bde | ||
|
|
89a11d5206 | ||
|
|
cd1791a956 | ||
|
|
06bce6170a | ||
|
|
6eb53dd31a | ||
|
|
329316a6c6 | ||
|
|
cb768e733f | ||
|
|
d1973e174d | ||
|
|
fd3fd2455f | ||
|
|
7944cbd726 | ||
|
|
ef0ea82263 | ||
|
|
2de8607599 | ||
|
|
ca5715e665 | ||
|
|
774fd03e78 | ||
|
|
8b8d58705b | ||
|
|
c5cbb9cb4b | ||
|
|
95ab6bc64d | ||
|
|
2403930b66 |
No files matched your search
@@ -1,3 +1,7 @@
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* mono-core.spec.in: Add Microsoft.WebApplication.targets
|
||||
|
||||
2009-08-29 Jonathan Pryor <[email protected]>
|
||||
|
||||
* man/mdoc-export-html.1: Document --with-profile, --with-version.
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.5)
|
||||
AM_INIT_AUTOMAKE(mono,2.6)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=1.0
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2009-09-26 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* test/queue.c: new tests.
|
||||
* src/gqueue.c: fixed pop_head.
|
||||
|
||||
2009-09-26 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* src/gqueue.c: add g_queue_push_tail.
|
||||
|
||||
2009-06-20 Zoltan Varga <[email protected]>
|
||||
|
||||
* src/glib.h: Add GUINT32_FROM/TO_BE macros.
|
||||
|
||||
@@ -469,6 +469,8 @@ typedef struct {
|
||||
gpointer g_queue_pop_head (GQueue *queue);
|
||||
void g_queue_push_head (GQueue *queue,
|
||||
gpointer data);
|
||||
void g_queue_push_tail (GQueue *queue,
|
||||
gpointer data);
|
||||
gboolean g_queue_is_empty (GQueue *queue);
|
||||
GQueue *g_queue_new (void);
|
||||
void g_queue_free (GQueue *queue);
|
||||
|
||||
+31
-15
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Author:
|
||||
* Duncan Mak ([email protected])
|
||||
* Gonzalo Paniagua Javier ([email protected])
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
@@ -23,7 +24,7 @@
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* (C) 2006 Novell, Inc.
|
||||
* Copyright (c) 2006-2009 Novell, Inc.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,19 +34,23 @@
|
||||
gpointer
|
||||
g_queue_pop_head (GQueue *queue)
|
||||
{
|
||||
gpointer head = NULL;
|
||||
gpointer result;
|
||||
GList *old_head;
|
||||
|
||||
if (queue->length != 0){
|
||||
GList *old_head;
|
||||
if (!queue || queue->length == 0)
|
||||
return NULL;
|
||||
|
||||
old_head = queue->head;
|
||||
head = old_head->data;
|
||||
queue->head = old_head->next;
|
||||
queue->length--;
|
||||
g_list_free_1 (old_head);
|
||||
}
|
||||
result = queue->head->data;
|
||||
old_head = queue->head;
|
||||
queue->head = old_head->next;
|
||||
g_list_free_1 (old_head);
|
||||
|
||||
return head;
|
||||
if (--queue->length)
|
||||
queue->head->prev = NULL;
|
||||
else
|
||||
queue->tail = NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -71,13 +76,24 @@ g_queue_push_head (GQueue *queue, gpointer head)
|
||||
queue->length ++;
|
||||
}
|
||||
|
||||
void
|
||||
g_queue_push_tail (GQueue *queue, gpointer data)
|
||||
{
|
||||
if (!queue)
|
||||
return;
|
||||
|
||||
queue->tail = g_list_append (queue->tail, data);
|
||||
if (queue->head == NULL)
|
||||
queue->head = queue->tail;
|
||||
else
|
||||
queue->tail = queue->tail->next;
|
||||
queue->length++;
|
||||
}
|
||||
|
||||
GQueue *
|
||||
g_queue_new (void)
|
||||
{
|
||||
GQueue *queue = g_new0 (GQueue, 1);
|
||||
queue->length = 0;
|
||||
|
||||
return queue;
|
||||
return g_new0 (GQueue, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -15,6 +15,66 @@ test_queue_push ()
|
||||
if (queue->length != 3)
|
||||
return FAILED ("push failed");
|
||||
|
||||
if (NULL != queue->head->prev)
|
||||
return FAILED ("HEAD: prev is wrong");
|
||||
if (strcmp ("baz", queue->head->data))
|
||||
return FAILED ("HEAD: First element is wrong");
|
||||
if (strcmp ("bar", queue->head->next->data))
|
||||
return FAILED ("HEAD: Second element is wrong");
|
||||
if (strcmp ("foo", queue->head->next->next->data))
|
||||
return FAILED ("HEAD: Third element is wrong");
|
||||
if (NULL != queue->head->next->next->next)
|
||||
return FAILED ("HEAD: End is wrong");
|
||||
|
||||
if (NULL != queue->tail->next)
|
||||
return FAILED ("TAIL: next is wrong");
|
||||
if (strcmp ("foo", queue->tail->data))
|
||||
return FAILED ("TAIL: Third element is wrong");
|
||||
if (strcmp ("bar", queue->tail->prev->data))
|
||||
return FAILED ("TAIL: Second element is wrong");
|
||||
if (strcmp ("baz", queue->tail->prev->prev->data))
|
||||
return FAILED ("TAIL: First element is wrong");
|
||||
if (NULL != queue->tail->prev->prev->prev)
|
||||
return FAILED ("TAIL: End is wrong");
|
||||
|
||||
g_queue_free (queue);
|
||||
return OK;
|
||||
}
|
||||
|
||||
RESULT
|
||||
test_queue_push_tail ()
|
||||
{
|
||||
GQueue *queue = g_queue_new ();
|
||||
|
||||
g_queue_push_tail (queue, "baz");
|
||||
g_queue_push_tail (queue, "bar");
|
||||
g_queue_push_tail (queue, "foo");
|
||||
|
||||
if (queue->length != 3)
|
||||
return FAILED ("push failed");
|
||||
|
||||
if (NULL != queue->head->prev)
|
||||
return FAILED ("HEAD: prev is wrong");
|
||||
if (strcmp ("baz", queue->head->data))
|
||||
return FAILED ("HEAD: First element is wrong");
|
||||
if (strcmp ("bar", queue->head->next->data))
|
||||
return FAILED ("HEAD: Second element is wrong");
|
||||
if (strcmp ("foo", queue->head->next->next->data))
|
||||
return FAILED ("HEAD: Third element is wrong");
|
||||
if (NULL != queue->head->next->next->next)
|
||||
return FAILED ("HEAD: End is wrong");
|
||||
|
||||
if (NULL != queue->tail->next)
|
||||
return FAILED ("TAIL: next is wrong");
|
||||
if (strcmp ("foo", queue->tail->data))
|
||||
return FAILED ("TAIL: Third element is wrong");
|
||||
if (strcmp ("bar", queue->tail->prev->data))
|
||||
return FAILED ("TAIL: Second element is wrong");
|
||||
if (strcmp ("baz", queue->tail->prev->prev->data))
|
||||
return FAILED ("TAIL: First element is wrong");
|
||||
if (NULL != queue->tail->prev->prev->prev)
|
||||
return FAILED ("TAIL: End is wrong");
|
||||
|
||||
g_queue_free (queue);
|
||||
return OK;
|
||||
}
|
||||
@@ -47,6 +107,30 @@ test_queue_pop ()
|
||||
if (queue->length != 0)
|
||||
return FAILED ("expect 0 length .");
|
||||
|
||||
g_queue_push_head (queue, "foo");
|
||||
g_queue_push_head (queue, "bar");
|
||||
g_queue_push_head (queue, "baz");
|
||||
|
||||
g_queue_pop_head (queue);
|
||||
|
||||
if (NULL != queue->head->prev)
|
||||
return FAILED ("HEAD: prev is wrong");
|
||||
if (strcmp ("bar", queue->head->data))
|
||||
return FAILED ("HEAD: Second element is wrong");
|
||||
if (strcmp ("foo", queue->head->next->data))
|
||||
return FAILED ("HEAD: Third element is wrong");
|
||||
if (NULL != queue->head->next->next)
|
||||
return FAILED ("HEAD: End is wrong");
|
||||
|
||||
if (NULL != queue->tail->next)
|
||||
return FAILED ("TAIL: next is wrong");
|
||||
if (strcmp ("foo", queue->tail->data))
|
||||
return FAILED ("TAIL: Second element is wrong");
|
||||
if (strcmp ("bar", queue->tail->prev->data))
|
||||
return FAILED ("TAIL: First element is wrong");
|
||||
if (NULL != queue->tail->prev->prev)
|
||||
return FAILED ("TAIL: End is wrong");
|
||||
|
||||
g_queue_free (queue);
|
||||
return OK;
|
||||
}
|
||||
@@ -89,6 +173,7 @@ test_queue_is_empty ()
|
||||
|
||||
static Test queue_tests [] = {
|
||||
{ "push", test_queue_push},
|
||||
{"push_tail", test_queue_push_tail},
|
||||
{ "pop", test_queue_pop},
|
||||
{ "new", test_queue_new},
|
||||
{"is_empty", test_queue_is_empty},
|
||||
|
||||
+5
-1
@@ -148,7 +148,11 @@ monotouch_dirs := \
|
||||
System \
|
||||
System.Core \
|
||||
System.Json \
|
||||
System.Xml.Linq
|
||||
System.Xml.Linq \
|
||||
System.Runtime.Serialization \
|
||||
System.ServiceModel \
|
||||
System.ServiceModel.Web \
|
||||
System.Web.Services
|
||||
|
||||
net_3_5_dirs := \
|
||||
Microsoft.Build.Framework \
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2009-09-26 Jonathan Pobst <[email protected]>
|
||||
[Backport]
|
||||
* TreeNode.cs: When we invalidate a node, make sure we start at
|
||||
0, instead of the node's Bounds.Left, which does not include
|
||||
the +/-, checkbox, or stateimages.
|
||||
[Fixes bug #542481]
|
||||
|
||||
2009-09-24 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* DataGridView.cs: Compare the name and not displayname of properties
|
||||
|
||||
@@ -1072,11 +1072,8 @@ namespace System.Windows.Forms
|
||||
TreeView tv = TreeView;
|
||||
if (tv == null)
|
||||
return;
|
||||
|
||||
// Use actual TreeView width to invalidate total prev/new area
|
||||
Rectangle bounds = Bounds;
|
||||
bounds.Width = tv.ClientSize.Width;
|
||||
tv.Invalidate (bounds);
|
||||
|
||||
tv.UpdateNode (this);
|
||||
}
|
||||
|
||||
internal void InvalidateWidth ()
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
GroupingCollection parentCollection;
|
||||
Project parentProject;
|
||||
bool read_only;
|
||||
bool evaluated;
|
||||
|
||||
public BuildItemGroup ()
|
||||
: this (null, null, null, false)
|
||||
@@ -237,6 +238,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void Evaluate ()
|
||||
{
|
||||
if (evaluated)
|
||||
return;
|
||||
foreach (BuildItem bi in buildItems) {
|
||||
if (bi.Condition == String.Empty)
|
||||
bi.Evaluate (parentProject, true);
|
||||
@@ -245,6 +248,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
bi.Evaluate (parentProject, ce.BoolEvaluate (parentProject));
|
||||
}
|
||||
}
|
||||
evaluated = true;
|
||||
}
|
||||
|
||||
internal void ReplaceWith (BuildItem item, List <BuildItem> list)
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
Project parentProject;
|
||||
List <BuildProperty> properties;
|
||||
Dictionary <string, BuildProperty> propertiesByName;
|
||||
bool evaluated;
|
||||
|
||||
public BuildPropertyGroup ()
|
||||
: this (null, null, null, false)
|
||||
@@ -221,9 +222,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void Evaluate ()
|
||||
{
|
||||
if (evaluated)
|
||||
return;
|
||||
|
||||
foreach (BuildProperty bp in properties)
|
||||
if (ConditionParser.ParseAndEvaluate (bp.Condition, parentProject))
|
||||
bp.Evaluate ();
|
||||
|
||||
evaluated = true;
|
||||
}
|
||||
|
||||
public string Condition {
|
||||
|
||||
@@ -1,3 +1,71 @@
|
||||
2009-10-03 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs (OS): New.
|
||||
(InitializeProperties): Set 'OS' as a pre-defined property, set to
|
||||
'Windows_NT', 'Unix' or 'OSX' depending on the platform.
|
||||
|
||||
2009-10-02 Ankit Jain <[email protected]>
|
||||
|
||||
* Expression.cs (Parse): Don't change '/' to '\\', not required.
|
||||
|
||||
2009-10-01 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs (AddImport): Show the correct source file name, when
|
||||
the import is in the main project file.
|
||||
|
||||
2009-10-01 Ankit Jain <[email protected]>
|
||||
|
||||
Fix bug #543299.
|
||||
* Import.cs (.ctor): Evaluate and set EvaluatedProjectPath to
|
||||
the full path of the imported project here itself, instead of ..
|
||||
(Evaluate): .. here.
|
||||
* ImportCollection.cs (Add): Use import.EvaluatedProjectPath .
|
||||
(Contains): New.
|
||||
* Project.cs (AddImport): Don't process if condition is false.
|
||||
Warn if a circular reference is detected, and ignore the import.
|
||||
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* GroupingCollection.cs (Evaluate): Mark internal.
|
||||
* Project.cs (AddImport): Only evaluate the properties,
|
||||
till before the import.
|
||||
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs (DoLoad): Don't use XmlReader.Create, for loading
|
||||
the project xml, as returned Xml*Reader normalizes the newlines.
|
||||
Instead directly use the TextReader with XmlDocument.Load ().
|
||||
|
||||
2009-09-27 Ankit Jain <[email protected]>
|
||||
|
||||
* ConditionParser.cs: Show the condition being parsed in the
|
||||
exception message.
|
||||
|
||||
2009-09-26 Ankit Jain <[email protected]>
|
||||
|
||||
* Expression.cs: Allow '-' in item, property and metadata names.
|
||||
|
||||
2009-09-26 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs (Evaluate): Split into this and ..
|
||||
(PrepareForEvaluate): .. this.
|
||||
(AddImport): Evaluate the current set of properties/items etc,
|
||||
before processing the imported project. Honor the Condition
|
||||
for the Import.
|
||||
(ProcessProjectAttributes): Update MSBuildProjectDefaultTargets
|
||||
property.
|
||||
* GroupingCollection.cs (Evaluate): Don't evaluate Imports here.
|
||||
* BuildItemGroup.cs (Evaluate): Evaluate only once.
|
||||
* BuildPropertyGroup.cs (Evaluate): Evaluate only once.
|
||||
|
||||
2009-09-26 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs: Get InitialTargets from the imported projects also.
|
||||
The combined list of targets are executed, in the order they were
|
||||
found.
|
||||
DefaultTargets are also read in from imported projects, and the first
|
||||
non-empty DefaultTargets found is used.
|
||||
|
||||
2009-09-25 Ankit Jain <[email protected]>
|
||||
|
||||
* Project.cs (BuildTarget): Handle skipped targets.
|
||||
|
||||
@@ -39,11 +39,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
internal class ConditionParser {
|
||||
|
||||
ConditionTokenizer tokenizer;
|
||||
string conditionStr;
|
||||
|
||||
ConditionParser (string condition)
|
||||
{
|
||||
tokenizer = new ConditionTokenizer ();
|
||||
tokenizer.Tokenize (condition);
|
||||
conditionStr = condition;
|
||||
}
|
||||
|
||||
public static bool ParseAndEvaluate (string condition, Project context)
|
||||
@@ -171,7 +173,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
} else if (token.Type == TokenType.Not) {
|
||||
e = ParseNotExpression ();
|
||||
} else
|
||||
throw new ExpressionParseException (String.Format ("Unexpected token type {0}.", token.Type));
|
||||
throw new ExpressionParseException (String.Format ("Unexpected token type {0}, while parsing {1}", token.Type, conditionStr));
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -244,7 +246,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
{
|
||||
if (tokenizer.Token.Type != type)
|
||||
throw new ExpressionParseException ("Expected token type of type: " + type + ", got " +
|
||||
tokenizer.Token.Type + " (" + tokenizer.Token.Value + ") .");
|
||||
tokenizer.Token.Type + " (" + tokenizer.Token.Value + "), while parsing " + conditionStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
bool allowItems = (options & ParseOptions.AllowItems) == ParseOptions.AllowItems;
|
||||
bool allowMd = (options & ParseOptions.AllowMetadata) == ParseOptions.AllowMetadata;
|
||||
|
||||
expression = expression.Replace ('/', Path.DirectorySeparatorChar);
|
||||
expression = expression.Replace ('\\', Path.DirectorySeparatorChar);
|
||||
|
||||
string [] parts;
|
||||
@@ -299,7 +298,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (item_regex == null)
|
||||
item_regex = new Regex (
|
||||
@"@\(\s*"
|
||||
+ @"(?<itemname>[_A-Za-z][_0-9a-zA-Z]*)"
|
||||
+ @"(?<itemname>[_A-Za-z][_\-0-9a-zA-Z]*)"
|
||||
+ @"(?<has_transform>\s*->\s*'(?<transform>[^']*)')?"
|
||||
+ @"(?<has_separator>\s*,\s*'(?<separator>[^']*)')?"
|
||||
+ @"\s*\)");
|
||||
@@ -312,7 +311,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (property_regex == null)
|
||||
property_regex = new Regex (
|
||||
@"\$\(\s*"
|
||||
+ @"(?<name>[_a-zA-Z][_0-9a-zA-Z]*)"
|
||||
+ @"(?<name>[_a-zA-Z][_\-0-9a-zA-Z]*)"
|
||||
+ @"\s*\)");
|
||||
return property_regex;
|
||||
}
|
||||
@@ -323,8 +322,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (metadata_regex == null)
|
||||
metadata_regex = new Regex (
|
||||
@"%\(\s*"
|
||||
+ @"((?<name>[_a-zA-Z][_0-9a-zA-Z]*)\.)?"
|
||||
+ @"(?<meta>[_a-zA-Z][_0-9a-zA-Z]*)"
|
||||
+ @"((?<name>[_a-zA-Z][_\-0-9a-zA-Z]*)\.)?"
|
||||
+ @"(?<meta>[_a-zA-Z][_\-0-9a-zA-Z]*)"
|
||||
+ @"\s*\)");
|
||||
return metadata_regex;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
Evaluate (EvaluationType.Choose);
|
||||
}
|
||||
|
||||
void Evaluate (EvaluationType type)
|
||||
internal void Evaluate (EvaluationType type)
|
||||
{
|
||||
BuildItemGroup big;
|
||||
BuildPropertyGroup bpg;
|
||||
@@ -183,10 +183,6 @@ namespace Microsoft.Build.BuildEngine {
|
||||
bpg = (BuildPropertyGroup) evaluate_iterator.Value;
|
||||
if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
|
||||
bpg.Evaluate ();
|
||||
} else if (evaluate_iterator.Value is Import) {
|
||||
import = (Import) evaluate_iterator.Value;
|
||||
if (ConditionParser.ParseAndEvaluate (import.Condition, project))
|
||||
import.Evaluate ();
|
||||
}
|
||||
|
||||
// if it wasn't moved by adding anything because of evaluating a Import shift it
|
||||
|
||||
@@ -51,17 +51,16 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
if (ProjectPath == String.Empty)
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
|
||||
evaluatedProjectPath = GetFullPath ();
|
||||
if (EvaluatedProjectPath == String.Empty)
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
}
|
||||
|
||||
// FIXME: condition
|
||||
internal void Evaluate ()
|
||||
{
|
||||
evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
|
||||
string filename = GetFullPath ();
|
||||
|
||||
if (EvaluatedProjectPath == String.Empty)
|
||||
throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
|
||||
|
||||
string filename = evaluatedProjectPath;
|
||||
// NOTE: it's a hack to transform Microsoft.CSharp.Targets to Microsoft.CSharp.targets
|
||||
if (Path.HasExtension (filename))
|
||||
filename = Path.ChangeExtension (filename, Path.GetExtension (filename));
|
||||
|
||||
@@ -47,9 +47,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void Add (Import import)
|
||||
{
|
||||
if (!filenames.ContainsKey (import.ProjectPath)) {
|
||||
if (!filenames.ContainsKey (import.EvaluatedProjectPath)) {
|
||||
groupingCollection.Add (import);
|
||||
filenames.Add (import.ProjectPath, null);
|
||||
filenames.Add (import.EvaluatedProjectPath, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,11 @@ namespace Microsoft.Build.BuildEngine {
|
||||
array.SetValue(it.Current, i++);
|
||||
}
|
||||
}
|
||||
|
||||
internal bool Contains (Import import)
|
||||
{
|
||||
return filenames.ContainsKey (import.EvaluatedProjectPath);
|
||||
}
|
||||
|
||||
public void CopyTo (Import[] array, int index)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
bool isValidated;
|
||||
BuildItemGroupCollection itemGroups;
|
||||
ImportCollection imports;
|
||||
string[] initialTargets;
|
||||
List<string> initialTargets;
|
||||
Dictionary <string, BuildItemGroup> last_item_group_containing;
|
||||
bool needToReevaluate;
|
||||
Engine parentEngine;
|
||||
@@ -101,6 +101,8 @@ namespace Microsoft.Build.BuildEngine {
|
||||
current_settings = BuildSettings.None;
|
||||
|
||||
builtTargetKeys = new List<string> ();
|
||||
initialTargets = new List<string> ();
|
||||
defaultTargets = new string [0];
|
||||
|
||||
globalProperties = new BuildPropertyGroup (null, this, null, false);
|
||||
foreach (BuildProperty bp in parentEngine.GlobalProperties)
|
||||
@@ -298,7 +300,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!initialTargetsBuilt && initialTargets != null && initialTargets.Length > 0) {
|
||||
if (!initialTargetsBuilt) {
|
||||
foreach (string target in initialTargets) {
|
||||
if (!BuildTarget (target.Trim (), targetOutputs))
|
||||
return false;
|
||||
@@ -707,16 +709,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
try {
|
||||
ParentEngine.RemoveLoadedProject (this);
|
||||
|
||||
XmlReaderSettings settings = new XmlReaderSettings ();
|
||||
|
||||
if (SchemaFile != null) {
|
||||
settings.Schemas.Add (null, SchemaFile);
|
||||
settings.ValidationType = ValidationType.Schema;
|
||||
settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
|
||||
}
|
||||
|
||||
XmlReader xmlReader = XmlReader.Create (textReader, settings);
|
||||
xmlDocument.Load (xmlReader);
|
||||
xmlDocument.Load (textReader);
|
||||
|
||||
if (xmlDocument.DocumentElement.Name == "VisualStudioProject")
|
||||
throw new InvalidProjectFileException (String.Format (
|
||||
@@ -724,6 +717,12 @@ namespace Microsoft.Build.BuildEngine {
|
||||
"supported by xbuild. You need to convert it to msbuild " +
|
||||
"format to build with xbuild.", fullFileName));
|
||||
|
||||
if (SchemaFile != null) {
|
||||
xmlDocument.Schemas.Add (XmlSchema.Read (
|
||||
new StreamReader (SchemaFile), ValidationCallBack));
|
||||
xmlDocument.Validate (ValidationCallBack);
|
||||
}
|
||||
|
||||
if (xmlDocument.DocumentElement.Name != "Project") {
|
||||
throw new InvalidProjectFileException (String.Format (
|
||||
"The element <{0}> is unrecognized, or not supported in this context.", xmlDocument.DocumentElement.Name));
|
||||
@@ -766,12 +765,9 @@ namespace Microsoft.Build.BuildEngine {
|
||||
if (ParentEngine.DefaultTasksRegistered)
|
||||
taskDatabase.CopyTasks (ParentEngine.DefaultTasks);
|
||||
|
||||
if (xmlDocument.DocumentElement.GetAttributeNode ("DefaultTargets") != null)
|
||||
defaultTargets = xmlDocument.DocumentElement.GetAttribute ("DefaultTargets").Split (';');
|
||||
else
|
||||
defaultTargets = new string [0];
|
||||
|
||||
ProcessProjectAttributes (xmlDocument.DocumentElement.Attributes);
|
||||
initialTargets = new List<string> ();
|
||||
defaultTargets = new string [0];
|
||||
PrepareForEvaluate ();
|
||||
ProcessElements (xmlDocument.DocumentElement, null);
|
||||
|
||||
isDirty = false;
|
||||
@@ -783,12 +779,17 @@ namespace Microsoft.Build.BuildEngine {
|
||||
foreach (XmlAttribute attr in attributes) {
|
||||
switch (attr.Name) {
|
||||
case "InitialTargets":
|
||||
initialTargets = attr.Value.Split (new char [] {';'},
|
||||
StringSplitOptions.RemoveEmptyEntries);
|
||||
initialTargets.AddRange (attr.Value.Split (
|
||||
new char [] {';', ' '},
|
||||
StringSplitOptions.RemoveEmptyEntries));
|
||||
break;
|
||||
case "DefaultTargets":
|
||||
defaultTargets = attr.Value.Split (new char [] {';'},
|
||||
// first non-empty DefaultTargets found is used
|
||||
if (defaultTargets == null || defaultTargets.Length == 0)
|
||||
defaultTargets = attr.Value.Split (new char [] {';', ' '},
|
||||
StringSplitOptions.RemoveEmptyEntries);
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets",
|
||||
DefaultTargets, PropertyType.Reserved));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -796,6 +797,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
internal void ProcessElements (XmlElement rootElement, ImportedProject ip)
|
||||
{
|
||||
ProcessProjectAttributes (rootElement.Attributes);
|
||||
foreach (XmlNode xn in rootElement.ChildNodes) {
|
||||
if (xn is XmlElement) {
|
||||
XmlElement xe = (XmlElement) xn;
|
||||
@@ -833,7 +835,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
void Evaluate ()
|
||||
void PrepareForEvaluate ()
|
||||
{
|
||||
evaluatedItems = new BuildItemGroup (null, this, null, true);
|
||||
evaluatedItemsIgnoringCondition = new BuildItemGroup (null, this, null, true);
|
||||
@@ -843,7 +845,10 @@ namespace Microsoft.Build.BuildEngine {
|
||||
RemoveBuiltTargets ();
|
||||
|
||||
InitializeProperties ();
|
||||
}
|
||||
|
||||
void Evaluate ()
|
||||
{
|
||||
groupingCollection.Evaluate ();
|
||||
|
||||
//FIXME: UsingTasks aren't really evaluated. (shouldn't use expressions or anything)
|
||||
@@ -895,6 +900,7 @@ namespace Microsoft.Build.BuildEngine {
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", parentEngine.BinPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
|
||||
EvaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
|
||||
|
||||
// FIXME: make some internal method that will work like GetDirectoryName but output String.Empty on null/String.Empty
|
||||
string projectDir;
|
||||
@@ -933,10 +939,32 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
void AddImport (XmlElement xmlElement, ImportedProject importingProject)
|
||||
{
|
||||
Import import;
|
||||
|
||||
import = new Import (xmlElement, this, importingProject);
|
||||
// eval all the properties etc till the import
|
||||
groupingCollection.Evaluate (EvaluationType.Property);
|
||||
|
||||
Import import = new Import (xmlElement, this, importingProject);
|
||||
if (!ConditionParser.ParseAndEvaluate (import.Condition, this))
|
||||
return;
|
||||
|
||||
if (Imports.Contains (import)) {
|
||||
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
|
||||
"A circular reference was found involving the import of {0}. Only" +
|
||||
" the first import of this file will be used, ignoring others.",
|
||||
import.ProjectPath);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (String.Compare (fullFileName, import.EvaluatedProjectPath) == 0) {
|
||||
LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
|
||||
"The main project file was imported here, which creates a circular " +
|
||||
"reference. Ignoring this import.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Imports.Add (import);
|
||||
import.Evaluate ();
|
||||
}
|
||||
|
||||
void AddItemGroup (XmlElement xmlElement, ImportedProject importedProject)
|
||||
@@ -978,11 +1006,13 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
public string DefaultTargets {
|
||||
get {
|
||||
return xmlDocument.DocumentElement.GetAttribute ("DefaultTargets");
|
||||
return String.Join ("; ", defaultTargets);
|
||||
}
|
||||
set {
|
||||
xmlDocument.DocumentElement.SetAttribute ("DefaultTargets", value);
|
||||
defaultTargets = value.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (value != null)
|
||||
defaultTargets = value.Split (new char [] {';', ' '},
|
||||
StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1177,11 +1207,14 @@ namespace Microsoft.Build.BuildEngine {
|
||||
|
||||
public string InitialTargets {
|
||||
get {
|
||||
return xmlDocument.DocumentElement.GetAttribute ("InitialTargets");
|
||||
return String.Join ("; ", initialTargets.ToArray ());
|
||||
}
|
||||
set {
|
||||
initialTargets.Clear ();
|
||||
xmlDocument.DocumentElement.SetAttribute ("InitialTargets", value);
|
||||
initialTargets = value.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (value != null)
|
||||
initialTargets.AddRange (value.Split (
|
||||
new char [] {';', ' '}, StringSplitOptions.RemoveEmptyEntries));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1245,6 +1278,22 @@ namespace Microsoft.Build.BuildEngine {
|
||||
internal static string XmlNamespace {
|
||||
get { return ns; }
|
||||
}
|
||||
|
||||
static string OS {
|
||||
get {
|
||||
PlatformID pid = Environment.OSVersion.Platform;
|
||||
switch ((int)pid) {
|
||||
case 128:
|
||||
case 4:
|
||||
return "Unix";
|
||||
case 6:
|
||||
return "OSX";
|
||||
default:
|
||||
return "Windows_NT";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
2009-10-01 Ankit Jain <[email protected]>
|
||||
|
||||
* ImportTest.cs (TestAdd1): Add tests for multiple imports.
|
||||
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* ProjectTest.cs (TestPropertiesFromImportedProjects): New.
|
||||
|
||||
2009-09-26 Ankit Jain <[email protected]>
|
||||
|
||||
* TargetTest.cs (TestOverridingTargets): New.
|
||||
|
||||
2009-09-26 Ankit Jain <[email protected]>
|
||||
|
||||
* ProjectTest.cs (TestInitialTargetsWithImports):
|
||||
(TestDefaultTargets):
|
||||
(TestDefaultTargetsWithImports):
|
||||
(TestNoDefaultTargetsWithImports):
|
||||
(TestNoDefaultTargets): New tests.
|
||||
|
||||
2009-08-29 Ankit Jain <[email protected]>
|
||||
|
||||
* BuildItemTest.cs (TestSetMetadata5a): New.
|
||||
|
||||
@@ -31,6 +31,7 @@ using Microsoft.Build.BuildEngine;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using NUnit.Framework;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
[TestFixture]
|
||||
@@ -42,9 +43,27 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
[Test]
|
||||
public void TestAdd1 ()
|
||||
{
|
||||
string first = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Import Project='second.proj'/>
|
||||
</Project>
|
||||
";
|
||||
using (StreamWriter sw = new StreamWriter ("Test/resources/first.proj")) {
|
||||
sw.Write (first);
|
||||
}
|
||||
|
||||
string second = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
</Project>
|
||||
";
|
||||
using (StreamWriter sw = new StreamWriter ("Test/resources/second.proj")) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
string documentString = @"
|
||||
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Import Project='Test/resources/Import.csproj'/>
|
||||
<Import Project='Test/resources/first.proj'/>
|
||||
<Import Project='Test/resources/Import.csproj' Condition='false'/>
|
||||
</Project>
|
||||
";
|
||||
|
||||
@@ -53,15 +72,21 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
project = engine.CreateNewProject ();
|
||||
project.LoadXml (documentString);
|
||||
|
||||
Import[] t = new Import [1];
|
||||
Import[] t = new Import [2];
|
||||
Assert.AreEqual (2, project.Imports.Count, "Number of imports");
|
||||
project.Imports.CopyTo (t, 0);
|
||||
|
||||
string base_dir = Path.Combine (Environment.CurrentDirectory, Path.Combine ("Test", "resources"));
|
||||
|
||||
Assert.IsNull (t [0].Condition, "A1");
|
||||
Assert.AreEqual (false, t [0].IsImported, "A2");
|
||||
Assert.AreEqual ("Test/resources/Import.csproj", t [0].ProjectPath, "A3");
|
||||
Assert.IsNotNull (t [0].EvaluatedProjectPath, "A4");
|
||||
// FIXME: why there is no IsNotEmpty () in Mono NUnit?
|
||||
Assert.IsTrue (String.Empty != t [0].EvaluatedProjectPath, "A5");
|
||||
|
||||
Assert.AreEqual (false, t[0].IsImported, "A5");
|
||||
Assert.AreEqual ("Test/resources/first.proj", t[0].ProjectPath, "A6");
|
||||
Assert.AreEqual (Path.Combine (base_dir, "first.proj"), t[0].EvaluatedProjectPath, "A7");
|
||||
|
||||
Assert.AreEqual (true, t[1].IsImported, "A2");
|
||||
Assert.AreEqual ("second.proj", t[1].ProjectPath, "A3");
|
||||
Assert.AreEqual (Path.Combine (base_dir, "second.proj"), t[1].EvaluatedProjectPath, "A4");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -1514,15 +1514,282 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
Assert.AreEqual (0, logger.CheckHead ("Executing pre target", MessageImportance.Normal), "A1");
|
||||
Assert.AreEqual (0, logger.CheckHead ("Executing boo target", MessageImportance.Normal), "A2");
|
||||
Assert.AreEqual (0, logger.Count, "A3");
|
||||
logger.CheckLoggedMessageHead ("Executing pre target", "A1");
|
||||
logger.CheckLoggedMessageHead ("Executing boo target", "A2");
|
||||
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInitialTargetsWithImports () {
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""One "">
|
||||
<Target Name=""One"">
|
||||
<Message Text='Executing Second::One target'/>
|
||||
</Target>
|
||||
<Import Project='third.proj'/>
|
||||
</Project>
|
||||
";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""Two"">
|
||||
<Target Name=""Two"">
|
||||
<Message Text='Executing Third::Two target'/>
|
||||
</Target>
|
||||
</Project>
|
||||
";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "third.proj")))) {
|
||||
sw.Write (third);
|
||||
}
|
||||
|
||||
project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""pre"">
|
||||
<Target Name=""boo"">
|
||||
<Message Text=""Executing boo target""/>
|
||||
</Target>
|
||||
<Target Name=""pre"">
|
||||
<Message Text=""Executing pre target""/>
|
||||
</Target>
|
||||
<Import Project='Test/resources/second.proj'/>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Executing pre target", "A1");
|
||||
logger.CheckLoggedMessageHead ("Executing Second::One target", "A2");
|
||||
logger.CheckLoggedMessageHead ("Executing Third::Two target", "A3");
|
||||
logger.CheckLoggedMessageHead ("Executing boo target", "A4");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
|
||||
Assert.AreEqual ("pre; One; Two", project.InitialTargets, "List of initial targets");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDefaultTargets () {
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
project.LoadXml (@"<Project DefaultTargets='pre' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
|
||||
<Target Name=""boo"">
|
||||
<Message Text=""Executing boo target""/>
|
||||
</Target>
|
||||
<Target Name=""pre"">
|
||||
<Message Text=""Executing pre target""/>
|
||||
</Target>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Executing pre target", "A1");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
|
||||
Assert.AreEqual ("pre", project.DefaultTargets, "Default targets");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestDefaultTargetsWithImports () {
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
string second = @"<Project DefaultTargets='One' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Target Name=""One"">
|
||||
<Message Text='Executing Second::One target'/>
|
||||
</Target>
|
||||
</Project>";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
project.LoadXml (@"<Project DefaultTargets='pre' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
|
||||
<Target Name=""boo"">
|
||||
<Message Text=""Executing boo target""/>
|
||||
</Target>
|
||||
<Target Name=""pre"">
|
||||
<Message Text=""Executing pre target""/>
|
||||
</Target>
|
||||
<Import Project='Test/resources/second.proj'/>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Executing pre target", "A1");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
|
||||
Assert.AreEqual ("pre", project.DefaultTargets, "Default targets");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNoDefaultTargetsWithImports () {
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
|
||||
string second = @"<Project DefaultTargets='; One ; Two' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Target Name=""One"">
|
||||
<Message Text='Executing Second::One target'/>
|
||||
</Target>
|
||||
<Target Name=""Two"">
|
||||
<Message Text='Executing Second::Two target'/>
|
||||
</Target>
|
||||
|
||||
</Project>";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
|
||||
<Target Name=""boo"">
|
||||
<Message Text=""Executing boo target""/>
|
||||
</Target>
|
||||
<Target Name=""pre"">
|
||||
<Message Text=""Executing pre target""/>
|
||||
</Target>
|
||||
<Import Project='Test/resources/second.proj'/>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Executing Second::One target", "A1");
|
||||
logger.CheckLoggedMessageHead ("Executing Second::Two target", "A2");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
|
||||
Assert.AreEqual ("One; Two", project.DefaultTargets, "Default targets");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNoDefaultTargets () {
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
|
||||
<Target Name=""boo"">
|
||||
<Message Text=""Executing boo target""/>
|
||||
</Target>
|
||||
<Target Name=""pre"">
|
||||
<Message Text=""Executing pre target""/>
|
||||
</Target>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Executing boo target", "A1");
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
|
||||
Assert.AreEqual ("", project.DefaultTargets, "Default targets");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPropertiesFromImportedProjects ()
|
||||
{
|
||||
Engine engine = new Engine (Consts.BinPath);
|
||||
Project project = engine.CreateNewProject ();
|
||||
|
||||
string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
|
||||
<PropertyGroup>
|
||||
<Prop1>InitialVal</Prop1>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Second Include=""$(ThirdProp):Third""/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name=""Main"">
|
||||
<Message Text=""Prop1: $(Prop1) FooItem: @(FooItem)""/>
|
||||
<Message Text=""Second: @(Second) ThirdProp: $(ThirdProp)""/>
|
||||
</Target>
|
||||
<Import Project=""third.proj""/>
|
||||
</Project>";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
|
||||
<PropertyGroup>
|
||||
<ThirdProp>Third Value</ThirdProp>
|
||||
</PropertyGroup>
|
||||
</Project>";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "third.proj")))) {
|
||||
sw.Write (third);
|
||||
}
|
||||
|
||||
project.LoadXml (@"<Project InitialTargets=""Main"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<ItemGroup>
|
||||
<FooItem Include=""$(Prop1):Something""/>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=""Test/resources/second.proj""/>
|
||||
</Project>");
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
try {
|
||||
Assert.IsTrue (project.Build (), "Build failed");
|
||||
|
||||
logger.CheckLoggedMessageHead ("Prop1: InitialVal FooItem: InitialVal:Something", "A1");
|
||||
logger.CheckLoggedMessageHead ("Second: Third Value:Third ThirdProp: Third Value", "A2");
|
||||
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
} catch {
|
||||
logger.DumpMessages ();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestRequiredTask_String1 ()
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ using Microsoft.Build.BuildEngine;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using NUnit.Framework;
|
||||
using System.IO;
|
||||
|
||||
namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
[TestFixture]
|
||||
@@ -370,5 +371,54 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestOverridingTargets ()
|
||||
{
|
||||
Engine engine;
|
||||
Project project;
|
||||
|
||||
string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Target Name='BeforeBuild'/>
|
||||
<Target Name='AfterBuild'/>
|
||||
<Target Name='Build' DependsOnTargets='BeforeBuild'>
|
||||
<Message Text='Build executing'/>
|
||||
<CallTarget Targets='AfterBuild'/>
|
||||
</Target>
|
||||
</Project>";
|
||||
using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
|
||||
sw.Write (second);
|
||||
}
|
||||
|
||||
string documentString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
|
||||
<Target Name='AfterBuild'>
|
||||
<Message Text='Overriding AfterBuild'/>
|
||||
</Target>
|
||||
|
||||
<Import Project='Test/resources/second.proj'/>
|
||||
<Target Name='BeforeBuild'>
|
||||
<Message Text='Overriding BeforeBuild'/>
|
||||
</Target>
|
||||
</Project>";
|
||||
|
||||
engine = new Engine (Consts.BinPath);
|
||||
project = engine.CreateNewProject ();
|
||||
project.LoadXml (documentString);
|
||||
|
||||
MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
|
||||
new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
|
||||
engine.RegisterLogger (logger);
|
||||
|
||||
bool result = project.Build ("Build");
|
||||
if (!result) {
|
||||
logger.DumpMessages ();
|
||||
Assert.Fail ("Build failed");
|
||||
}
|
||||
|
||||
logger.CheckLoggedMessageHead ("Overriding BeforeBuild", "A1");
|
||||
logger.CheckLoggedMessageHead ("Build executing", "A1");
|
||||
|
||||
Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* Exec.cs: Write the commands, which can be multiline,
|
||||
to a temporary file, and execute that with "cmd.exe /c"
|
||||
on windows and "sh" on non-windows.
|
||||
(LogToolCommand): Override, and emit the commands instead
|
||||
of the actual args passed to the shell.
|
||||
|
||||
2009-09-28 Ankit Jain <[email protected]>
|
||||
|
||||
* WriteLinesToFiles.cs (Execute): Handle empty list of
|
||||
lines.
|
||||
|
||||
2009-09-25 Ankit Jain <[email protected]>
|
||||
|
||||
* FindAppConfigFile.cs: New.
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace Microsoft.Build.Tasks {
|
||||
string stdErrEncoding;
|
||||
string stdOutEncoding;
|
||||
string workingDirectory;
|
||||
string scriptFile;
|
||||
|
||||
public Exec ()
|
||||
{
|
||||
@@ -56,11 +57,15 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
protected internal override void AddCommandLineCommands (CommandLineBuilderExtension commandLine)
|
||||
{
|
||||
if (IsRunningOnWindows)
|
||||
commandLine.AppendSwitch ("/c");
|
||||
|
||||
if (!String.IsNullOrEmpty (command)) {
|
||||
string[] commandTable = command.Split (null, 2);
|
||||
string arguments = String.Empty;
|
||||
if (commandTable.Length == 2)
|
||||
commandLine.AppendSwitch (commandTable [1]);
|
||||
scriptFile = Path.GetTempFileName ();
|
||||
using (StreamWriter sw = new StreamWriter (scriptFile)) {
|
||||
sw.Write (command);
|
||||
}
|
||||
commandLine.AppendFileNameIfNotNull (scriptFile);
|
||||
}
|
||||
base.AddCommandLineCommands (commandLine);
|
||||
}
|
||||
@@ -69,13 +74,18 @@ namespace Microsoft.Build.Tasks {
|
||||
string responseFileCommands,
|
||||
string commandLineCommands)
|
||||
{
|
||||
return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
|
||||
try {
|
||||
return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
|
||||
} finally {
|
||||
if (scriptFile != null)
|
||||
File.Delete (scriptFile);
|
||||
}
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected override string GenerateFullPathToTool ()
|
||||
{
|
||||
return command.Split (null, 2) [0];
|
||||
return IsRunningOnWindows ? "cmd.exe" : "sh";
|
||||
}
|
||||
|
||||
protected override string GetWorkingDirectory ()
|
||||
@@ -97,6 +107,7 @@ namespace Microsoft.Build.Tasks {
|
||||
[MonoTODO]
|
||||
protected override void LogToolCommand (string message)
|
||||
{
|
||||
Log.LogMessage (MessageImportance.Normal, "Executing: " + command);
|
||||
}
|
||||
|
||||
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
|
||||
@@ -166,6 +177,14 @@ namespace Microsoft.Build.Tasks {
|
||||
get { return workingDirectory; }
|
||||
set { workingDirectory = value; }
|
||||
}
|
||||
|
||||
static bool IsRunningOnWindows {
|
||||
get {
|
||||
PlatformID pid = Environment.OSVersion.Platform;
|
||||
return ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace Microsoft.Build.Tasks {
|
||||
{
|
||||
try {
|
||||
streamWriter = new StreamWriter (file.GetMetadata ("FullPath"), !overwrite);
|
||||
foreach (ITaskItem line in lines) {
|
||||
streamWriter.WriteLine (line);
|
||||
}
|
||||
if (lines != null)
|
||||
foreach (ITaskItem line in lines)
|
||||
streamWriter.WriteLine (line);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace Microsoft.Build.Utilities
|
||||
}
|
||||
set {
|
||||
buildEngine = value;
|
||||
log = new TaskLoggingHelper (this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
2009-10-02 Ankit Jain <[email protected]>
|
||||
|
||||
* AppDomainIsolatedTask.cs (BuildEngine): Init 'log'.
|
||||
|
||||
2009-09-29 Ankit Jain <[email protected]>
|
||||
|
||||
* ToolTask.cs (ExecuteTool): Use LogToolCommand, instead of
|
||||
directly logging.
|
||||
(LogToolCommand): Implement.
|
||||
|
||||
2009-09-28 Ankit Jain <[email protected]>
|
||||
|
||||
* ToolTask.cs (ProcessOuputTool): Move logging of tool
|
||||
output from here to ..
|
||||
(ExecuteTool): .. here. As, ProcessOuputTool can be
|
||||
overridden.
|
||||
|
||||
2009-09-24 Ankit Jain <[email protected]>
|
||||
|
||||
* ToolTask.cs (HasLoggedErrors): Add missing property.
|
||||
|
||||
@@ -138,8 +138,8 @@ namespace Microsoft.Build.Utilities
|
||||
arguments = arguments + " " + GetResponseFileSwitch (responseFileName);
|
||||
}
|
||||
|
||||
Log.LogMessage (MessageImportance.Normal, "Tool {0} execution started with arguments: {1} {2}",
|
||||
pathToTool, commandLineCommands, responseFileCommands);
|
||||
LogToolCommand (String.Format ("Tool {0} execution started with arguments: {1} {2}",
|
||||
pathToTool, commandLineCommands, responseFileCommands));
|
||||
|
||||
output = Path.GetTempFileName ();
|
||||
error = Path.GetTempFileName ();
|
||||
@@ -210,6 +210,7 @@ namespace Microsoft.Build.Utilities
|
||||
Log.LogError (output_str);
|
||||
}
|
||||
|
||||
toolOutput.AppendLine (line);
|
||||
LogEventsFromTextOutput (line, importance);
|
||||
}
|
||||
}
|
||||
@@ -217,8 +218,6 @@ namespace Microsoft.Build.Utilities
|
||||
|
||||
protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
|
||||
{
|
||||
toolOutput.AppendLine (singleLine);
|
||||
|
||||
singleLine = singleLine.Trim ();
|
||||
if (singleLine.Length == 0)
|
||||
return;
|
||||
@@ -346,6 +345,7 @@ namespace Microsoft.Build.Utilities
|
||||
[MonoTODO]
|
||||
protected virtual void LogToolCommand (string message)
|
||||
{
|
||||
Log.LogMessage (MessageImportance.Normal, message);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2009-09-26 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
** Fixes part of #427769 - Patch by John Lenz <[email protected]>
|
||||
* DataSet.cs: XML serialization improvements to be compatible with MS impl.
|
||||
|
||||
2009-09-15 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
** Fixes #536194 - Patch by Andrew Kurochk <[email protected]>
|
||||
|
||||
@@ -95,6 +95,17 @@ namespace System.Data
|
||||
protected DataSet (SerializationInfo info, StreamingContext context)
|
||||
: this ()
|
||||
{
|
||||
#if NET_2_0
|
||||
if (IsBinarySerialized (info, context)) {
|
||||
BinaryDeserialize (info);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
string s = info.GetValue ("XmlSchema", typeof (String)) as String;
|
||||
XmlTextReader reader = new XmlTextReader (new StringReader (s));
|
||||
ReadXmlSchema (reader);
|
||||
reader.Close ();
|
||||
|
||||
GetSerializationData (info, context);
|
||||
}
|
||||
|
||||
@@ -1132,6 +1143,7 @@ namespace System.Data
|
||||
{
|
||||
#if NET_2_0
|
||||
if (RemotingFormat == SerializationFormat.Xml) {
|
||||
info.AddValue ("SchemaSerializationMode.DataSet", this.SchemaSerializationMode);
|
||||
#endif
|
||||
StringWriter sw = new StringWriter ();
|
||||
XmlTextWriter writer = new XmlTextWriter (sw);
|
||||
@@ -1155,19 +1167,8 @@ namespace System.Data
|
||||
#region Protected Methods
|
||||
protected void GetSerializationData (SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
#if NET_2_0
|
||||
if (IsBinarySerialized (info, context)) {
|
||||
BinaryDeserialize (info);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
string s = info.GetValue ("XmlSchema", typeof (String)) as String;
|
||||
string s = info.GetValue ("XmlDiffGram", typeof (String)) as String;
|
||||
XmlTextReader reader = new XmlTextReader (new StringReader (s));
|
||||
ReadXmlSchema (reader);
|
||||
reader.Close ();
|
||||
|
||||
s = info.GetValue ("XmlDiffGram", typeof (String)) as String;
|
||||
reader = new XmlTextReader (new StringReader (s));
|
||||
ReadXml (reader, XmlReadMode.DiffGram);
|
||||
reader.Close ();
|
||||
}
|
||||
@@ -1547,10 +1548,26 @@ namespace System.Data
|
||||
private bool dataSetInitialized = true;
|
||||
public event EventHandler Initialized;
|
||||
|
||||
[MonoTODO]
|
||||
protected DataSet (SerializationInfo info, StreamingContext context, bool constructSchema)
|
||||
: this (info, context)
|
||||
: this ()
|
||||
{
|
||||
if (DetermineSchemaSerializationMode (info, context) == SchemaSerializationMode.ExcludeSchema) {
|
||||
InitializeDerivedDataSet ();
|
||||
}
|
||||
|
||||
if (IsBinarySerialized (info, context)) {
|
||||
BinaryDeserialize (info);
|
||||
return;
|
||||
}
|
||||
|
||||
if (constructSchema) {
|
||||
string s = info.GetValue ("XmlSchema", typeof (String)) as String;
|
||||
XmlTextReader reader = new XmlTextReader (new StringReader (s));
|
||||
ReadXmlSchema (reader);
|
||||
reader.Close ();
|
||||
|
||||
GetSerializationData (info, context);
|
||||
}
|
||||
}
|
||||
|
||||
SerializationFormat remotingFormat = SerializationFormat.Xml;
|
||||
@@ -1751,10 +1768,8 @@ namespace System.Data
|
||||
OnDataSetInitialized (e);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected virtual void InitializeDerivedDataSet ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
protected SchemaSerializationMode DetermineSchemaSerializationMode (XmlReader reader)
|
||||
@@ -1764,6 +1779,13 @@ namespace System.Data
|
||||
|
||||
protected SchemaSerializationMode DetermineSchemaSerializationMode (SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
SerializationInfoEnumerator e = info.GetEnumerator ();
|
||||
while (e.MoveNext ()) {
|
||||
if (e.Name == "SchemaSerializationMode.DataSet") {
|
||||
return (SchemaSerializationMode) e.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return SchemaSerializationMode.IncludeSchema;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
2009-09-26 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* DataSetTest2.cs: Don't run the test for Bug#536194 in 1.x
|
||||
profile. Makes build bot go all green on Sys.Data.
|
||||
|
||||
2009-09-26 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* DataSetTypedDataSet.cs: Test for #427769. Patch by
|
||||
John Lenz <[email protected]>.
|
||||
|
||||
2009-09-24 Veerapuram Varadhan <[email protected]>
|
||||
|
||||
* DataSetTest2.cs (MergeTest_SameDataSet_536194): Added new.
|
||||
* DataSetTest2.cs (MergeTest_SameDataSet_536194): Added new.
|
||||
|
||||
2009-01-16 Atsushi Enomoto <[email protected]>
|
||||
|
||||
|
||||
@@ -3467,6 +3467,7 @@ namespace MonoTests_System.Data
|
||||
Assert.AreEqual (typeof (string), ds.Tables [0].Columns [0].DataType, "#5");
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
public void MergeTest_SameDataSet_536194 ()
|
||||
{
|
||||
@@ -3479,6 +3480,7 @@ namespace MonoTests_System.Data
|
||||
dataSet.Merge(dataTable);
|
||||
Assert.AreEqual (1, dataSet.Tables.Count, "1");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
|
||||
@@ -196,6 +196,58 @@ namespace MonoTests.System.Data
|
||||
myTypedDataSet.Order_DetailsRow[] drArr1 = ds.Orders[0].GetOrder_DetailsRows();
|
||||
DataRow[] drArr2 = ds.Orders[0].GetChildRows(ds.Relations[0]);
|
||||
Assert.AreEqual(drArr1 ,drArr2,"TDS25");
|
||||
|
||||
#if NET_2_0
|
||||
//now test serialization of a typed dataset generated by microsoft's xsd.exe
|
||||
DataSet1 ds1 = new DataSet1();
|
||||
ds1.DataTable1.AddDataTable1Row("test");
|
||||
ds1.DataTable1.AddDataTable1Row("test2");
|
||||
|
||||
global::System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
|
||||
new global::System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
|
||||
MemoryStream stream = new MemoryStream();
|
||||
|
||||
formatter.Serialize(stream, ds1);
|
||||
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
DataSet1 ds1load = (DataSet1) formatter.Deserialize(stream);
|
||||
|
||||
Assert.IsTrue(ds1load.Tables.Contains("DataTable1"));
|
||||
Assert.AreEqual("DataTable1DataTable", ds1load.Tables["DataTable1"].GetType().Name);
|
||||
Assert.AreEqual(2, ds1load.DataTable1.Rows.Count);
|
||||
Assert.AreEqual("DataTable1Row", ds1load.DataTable1[0].GetType().Name);
|
||||
if (ds1load.DataTable1[0].Column1 == "test") {
|
||||
Assert.AreEqual("test2", ds1load.DataTable1[1].Column1);
|
||||
} else if (ds1load.DataTable1[0].Column1 == "test2") {
|
||||
Assert.AreEqual("test", ds1load.DataTable1[1].Column1);
|
||||
} else {
|
||||
Assert.Fail("Invalid entry for Column1");
|
||||
}
|
||||
|
||||
//now test when the mode is exclude schema
|
||||
ds1.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.ExcludeSchema;
|
||||
|
||||
stream = new MemoryStream();
|
||||
|
||||
formatter.Serialize(stream, ds1);
|
||||
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
ds1load = (DataSet1) formatter.Deserialize(stream);
|
||||
|
||||
Assert.IsTrue(ds1load.Tables.Contains("DataTable1"));
|
||||
Assert.AreEqual("DataTable1DataTable", ds1load.Tables["DataTable1"].GetType().Name);
|
||||
Assert.AreEqual(2, ds1load.DataTable1.Rows.Count);
|
||||
Assert.AreEqual("DataTable1Row", ds1load.DataTable1[0].GetType().Name);
|
||||
if (ds1load.DataTable1[0].Column1 == "test") {
|
||||
Assert.AreEqual("test2", ds1load.DataTable1[1].Column1);
|
||||
} else if (ds1load.DataTable1[0].Column1 == "test2") {
|
||||
Assert.AreEqual("test", ds1load.DataTable1[1].Column1);
|
||||
} else {
|
||||
Assert.Fail("Invalid entry for Column1");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected void T_Changing(object sender, myTypedDataSet.OrdersRowChangeEvent e)
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2009-09-29 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* net_2_1_raw_System.Net.dll.sources: Remove Timer_2_1.cs and
|
||||
related classes from System.dll - they are not required anymore
|
||||
since Gonzalo's changes on Socket.Close(int)
|
||||
[Backport r142851]
|
||||
|
||||
2009-09-27 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* net_2_1_raw_System.Net.dll.sources: Add Timer_2_1.cs and
|
||||
related classes from System.dll
|
||||
[Backport of r142720]
|
||||
|
||||
2009-09-24 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* net_2_1_raw_System.Net.dll.sources: Substitute System.dll Dns
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
2009-09-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SerializationMap.cs :
|
||||
There were some places that ignored possible whitespace nodes.
|
||||
Fixed sorting of ordered members so that it does not give
|
||||
incomplete sorting among base/derived types. (should fix #539563.)
|
||||
Give xml error details in some places.
|
||||
|
||||
2009-09-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* KnownTypeCollection.cs : (the previous one didn't fix #539563.)
|
||||
Consider attempts to register the same collection type as it did
|
||||
before.
|
||||
|
||||
2009-09-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SerializationMap.cs, KnownTypeCollection.cs : nested use of type
|
||||
in its members resulted in infinite loop. This hopefully fixes
|
||||
bug #539563.
|
||||
|
||||
2009-09-07 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* IgnoreDataMemberAttribute.cs : add missing type.
|
||||
|
||||
+9
-4
@@ -666,8 +666,13 @@ namespace System.Runtime.Serialization
|
||||
|
||||
QName qname = GetCollectionQName (element);
|
||||
|
||||
if (FindUserMap (qname) != null)
|
||||
throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
|
||||
var map = FindUserMap (qname);
|
||||
if (map != null) {
|
||||
var cmap = map as CollectionTypeMap;
|
||||
if (cmap == null || cmap.RuntimeType != type)
|
||||
throw new InvalidOperationException (String.Format ("Failed to add type {0} to known type collection. There already is a registered type for XML name {1}", type, qname));
|
||||
return cmap;
|
||||
}
|
||||
|
||||
CollectionTypeMap ret =
|
||||
new CollectionTypeMap (type, element, qname, this);
|
||||
@@ -746,9 +751,9 @@ namespace System.Runtime.Serialization
|
||||
if (FindUserMap (qname) != null)
|
||||
throw new InvalidOperationException (String.Format ("There is already a registered type for XML name {0}", qname));
|
||||
|
||||
SharedContractMap ret =
|
||||
new SharedContractMap (type, qname, this);
|
||||
SharedContractMap ret = new SharedContractMap (type, qname, this);
|
||||
contracts.Add (ret);
|
||||
ret.Initialize ();
|
||||
|
||||
object [] attrs = type.GetCustomAttributes (typeof (KnownTypeAttribute), true);
|
||||
for (int i = 0; i < attrs.Length; i++) {
|
||||
|
||||
+31
-17
@@ -353,8 +353,15 @@ namespace System.Runtime.Serialization
|
||||
reader.MoveToContent ();
|
||||
if (!isEmpty && reader.NodeType == XmlNodeType.EndElement)
|
||||
reader.ReadEndElement ();
|
||||
else if (!isEmpty && reader.NodeType != XmlNodeType.None)
|
||||
throw new SerializationException (String.Format ("Deserializing type '{3}'. Expecting state 'EndElement'. Encountered state '{0}' with name '{1}' with namespace '{2}'.", reader.NodeType, reader.Name, reader.NamespaceURI, RuntimeType.FullName));
|
||||
else if (!isEmpty && reader.NodeType != XmlNodeType.None) {
|
||||
var li = reader as IXmlLineInfo;
|
||||
throw new SerializationException (String.Format ("Deserializing type '{3}'. Expecting state 'EndElement'. Encountered state '{0}' with name '{1}' with namespace '{2}'.{4}",
|
||||
reader.NodeType,
|
||||
reader.Name,
|
||||
reader.NamespaceURI,
|
||||
RuntimeType.FullName,
|
||||
li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : String.Empty));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -378,7 +385,7 @@ namespace System.Runtime.Serialization
|
||||
object instance = FormatterServices.GetUninitializedObject (RuntimeType);
|
||||
int depth = reader.NodeType == XmlNodeType.None ? reader.Depth : reader.Depth - 1;
|
||||
bool [] filled = new bool [Members.Count];
|
||||
int memberInd = -1;
|
||||
int memberInd = -1, ordered = -1;
|
||||
while (!empty && reader.NodeType == XmlNodeType.Element && reader.Depth > depth) {
|
||||
DataMemberInfo dmi = null;
|
||||
int i = 0;
|
||||
@@ -392,12 +399,13 @@ namespace System.Runtime.Serialization
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; i < Members.Count; i++) { // ordered
|
||||
for (i = Math.Max (i, ordered); i < Members.Count; i++) { // ordered
|
||||
if (dmi != null)
|
||||
break;
|
||||
if (reader.LocalName == Members [i].XmlName &&
|
||||
reader.NamespaceURI == Members [i].XmlRootNamespace) {
|
||||
memberInd = i;
|
||||
ordered = i;
|
||||
dmi = Members [i];
|
||||
break;
|
||||
}
|
||||
@@ -409,6 +417,7 @@ namespace System.Runtime.Serialization
|
||||
}
|
||||
SetValue (dmi, instance, deserializer.Deserialize (dmi.MemberType, reader));
|
||||
filled [memberInd] = true;
|
||||
reader.MoveToContent ();
|
||||
}
|
||||
for (int i = 0; i < Members.Count; i++)
|
||||
if (!filled [i] && Members [i].IsRequired)
|
||||
@@ -420,7 +429,11 @@ namespace System.Runtime.Serialization
|
||||
// For now it could be private.
|
||||
protected Exception MissingRequiredMember (DataMemberInfo dmi, XmlReader reader)
|
||||
{
|
||||
return new ArgumentException (String.Format ("Data contract member {0} is required, but missing in the input XML.", new QName (dmi.XmlName, dmi.XmlNamespace)));
|
||||
var li = reader as IXmlLineInfo;
|
||||
return new ArgumentException (String.Format ("Data contract member {0} for the type {1} is required, but missing in the input XML.{2}",
|
||||
new QName (dmi.XmlName, dmi.XmlNamespace),
|
||||
RuntimeType,
|
||||
li != null && li.HasLineInfo () ? String.Format (" {0}({1},{2})", reader.BaseURI, li.LineNumber, li.LinePosition) : null));
|
||||
}
|
||||
|
||||
// For now it could be private.
|
||||
@@ -487,14 +500,18 @@ namespace System.Runtime.Serialization
|
||||
Type type, QName qname, KnownTypeCollection knownTypes)
|
||||
: base (type, qname, knownTypes)
|
||||
{
|
||||
Type baseType = type;
|
||||
}
|
||||
|
||||
internal void Initialize ()
|
||||
{
|
||||
Type baseType = RuntimeType;
|
||||
List <DataMemberInfo> members = new List <DataMemberInfo> ();
|
||||
object [] atts = type.GetCustomAttributes (
|
||||
object [] atts = baseType.GetCustomAttributes (
|
||||
typeof (DataContractAttribute), false);
|
||||
IsReference = atts.Length > 0 ? (((DataContractAttribute) atts [0]).IsReference) : false;
|
||||
|
||||
while (baseType != null) {
|
||||
QName bqname = knownTypes.GetQName (baseType);
|
||||
QName bqname = KnownTypes.GetQName (baseType);
|
||||
|
||||
members = GetMembers (baseType, bqname, true);
|
||||
Members.InsertRange (0, members);
|
||||
@@ -503,10 +520,7 @@ namespace System.Runtime.Serialization
|
||||
baseType = baseType.BaseType;
|
||||
}
|
||||
|
||||
// Members.Sort (delegate (
|
||||
// DataMemberInfo d1, DataMemberInfo d2) {
|
||||
// return d1.Order - d2.Order;
|
||||
// });
|
||||
Members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
|
||||
}
|
||||
|
||||
List<DataMemberInfo> GetMembers (Type type, QName qname, bool declared_only)
|
||||
@@ -540,14 +554,12 @@ namespace System.Runtime.Serialization
|
||||
data_members.Add (CreateDataMemberInfo (dma, fi, fi.FieldType));
|
||||
}
|
||||
|
||||
data_members.Sort (DataMemberInfo.DataMemberInfoComparer.Instance);
|
||||
|
||||
return data_members;
|
||||
}
|
||||
|
||||
public override List<DataMemberInfo> GetMembers ()
|
||||
{
|
||||
return GetMembers (RuntimeType, XmlName, true);
|
||||
return Members;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,6 +704,7 @@ namespace System.Runtime.Serialization
|
||||
add_method.Invoke (instance, new object [] {elem});
|
||||
else
|
||||
throw new NotImplementedException (String.Format ("Type {0} is not supported", RuntimeType));
|
||||
reader.MoveToContent ();
|
||||
}
|
||||
if (RuntimeType.IsArray)
|
||||
return ((ArrayList)instance).ToArray (element_type);
|
||||
@@ -967,7 +980,8 @@ namespace System.Runtime.Serialization
|
||||
// Does this make sense? I doubt.
|
||||
public override List<DataMemberInfo> GetMembers ()
|
||||
{
|
||||
return GetMembers (RuntimeType, XmlName, true);
|
||||
return Members;
|
||||
//return GetMembers (RuntimeType, XmlName, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1141,7 +1155,7 @@ namespace System.Runtime.Serialization
|
||||
|
||||
public int Compare (DataMemberInfo d1, DataMemberInfo d2)
|
||||
{
|
||||
if (d1.Order == -1 || d2.Order == -1)
|
||||
if (d1.Order == d2.Order)
|
||||
return String.CompareOrdinal (d1.XmlName, d2.XmlName);
|
||||
|
||||
return d1.Order - d2.Order;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
2009-09-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XsdDataContractExporterTest.cs : disable some tests that started
|
||||
to fail due to correctly sorted fields while xsd exporter has
|
||||
some bugs that emits duplicate fields (hence ambiguity occurs).
|
||||
|
||||
2009-09-28 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlObjectSerializerTest.cs : Test nested type serialization type
|
||||
initialization.
|
||||
|
||||
2009-09-07 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* XmlObjectSerializerTest.cs : fix (here too) bad serialization-
|
||||
|
||||
+15
@@ -1262,6 +1262,12 @@ namespace MonoTests.System.Runtime.Serialization
|
||||
new DataContractSerializer(typeof (AsxEntryInfo)).ReadObject (reader);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bug539563 ()
|
||||
{
|
||||
new DataContractSerializer (typeof (NestedContractType));
|
||||
}
|
||||
|
||||
private T Deserialize<T> (string xml)
|
||||
{
|
||||
return Deserialize<T> (xml, typeof (T));
|
||||
@@ -1604,6 +1610,15 @@ namespace MonoTests.System.Runtime.Serialization
|
||||
[DataMember]
|
||||
public IList<int> Array { get; set; }
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
public class NestedContractType
|
||||
{
|
||||
[DataMember]
|
||||
public NestedContractType Nested;
|
||||
[DataMember]
|
||||
public string X = "x";
|
||||
}
|
||||
}
|
||||
|
||||
[DataContract]
|
||||
|
||||
+2
@@ -136,6 +136,7 @@ namespace MonoTests.System.Runtime.Serialization
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotWorking")]
|
||||
public void Dc3Test ()
|
||||
{
|
||||
//Check for duplicate dc2 ?
|
||||
@@ -145,6 +146,7 @@ namespace MonoTests.System.Runtime.Serialization
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotWorking")]
|
||||
public void Dc3Test2 ()
|
||||
{
|
||||
//Check for duplicate dc2 ?
|
||||
|
||||
+3
-3
@@ -106,9 +106,9 @@ namespace System.ServiceModel.Syndication
|
||||
|
||||
protected virtual SyndicationItem ReadItem (XmlReader reader, SyndicationFeed feed)
|
||||
{
|
||||
SyndicationItem item = feed.CreateItem ();
|
||||
new Atom10ItemFormatter (item).ReadFrom (reader);
|
||||
return item;
|
||||
Atom10ItemFormatter formatter = new Atom10ItemFormatter ();
|
||||
formatter.ReadFrom (reader);
|
||||
return formatter.Item;
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<SyndicationItem> ReadItems (XmlReader reader, SyndicationFeed feed, out bool areAllItemsRead)
|
||||
|
||||
+2
-6
@@ -184,9 +184,7 @@ namespace System.ServiceModel.Syndication
|
||||
Item.Links.Add (l);
|
||||
continue;
|
||||
case "published":
|
||||
// FIXME: somehow DateTimeOffset causes the runtime crash.
|
||||
reader.ReadElementContentAsString ();
|
||||
// Item.PublishDate = XmlConvert.ToDateTimeOffset (reader.ReadElementContentAsString ());
|
||||
Item.PublishDate = XmlConvert.ToDateTimeOffset (reader.ReadElementContentAsString ());
|
||||
continue;
|
||||
case "rights":
|
||||
Item.Copyright = ReadTextSyndicationContent (reader);
|
||||
@@ -201,9 +199,7 @@ namespace System.ServiceModel.Syndication
|
||||
Item.Title = ReadTextSyndicationContent (reader);
|
||||
continue;
|
||||
case "updated":
|
||||
// FIXME: somehow DateTimeOffset causes the runtime crash.
|
||||
reader.ReadElementContentAsString ();
|
||||
// Item.LastUpdatedTime = XmlConvert.ToDateTimeOffset (reader.ReadElementContentAsString ());
|
||||
Item.LastUpdatedTime = XmlConvert.ToDateTimeOffset (reader.ReadElementContentAsString ());
|
||||
continue;
|
||||
|
||||
// Atom 1.0 does not specify "content" element, but it is required to distinguish Content property from extension elements.
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2009-10-05 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Atom10FeedFormatter.cs : do not use Atom10ItemFormatter(item)
|
||||
at ReadItem(). It is only for writing. Patch by David Mitchell.
|
||||
|
||||
2009-10-05 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Atom10ItemFormatter.cs : enable XmlConvert.ToDateTimeOffset(),
|
||||
patch by David Mitchell.
|
||||
|
||||
2009-09-15 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* SyndicationElementExtension.cs : make it ready for 2.1 build.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2009-10-07 Astushi Enomoto <[email protected]>
|
||||
|
||||
* net_2_1_System.ServiceModel.dll.sources :
|
||||
add IHttpCookieContainer.cs.
|
||||
|
||||
2009-09-15 Astushi Enomoto <[email protected]>
|
||||
|
||||
* System.ServiceModel.dll.sources: remove WebServiceHelper.cs.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2009-09-30 Jb Evain <[email protected]>
|
||||
|
||||
* HttpRequestChannel.cs: When compiling for MonoTouch, avoid
|
||||
to use any of the remoting features.
|
||||
|
||||
2009-09-14 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* MessageProperties.cs : fix CopyProperties() behavior to not
|
||||
|
||||
@@ -333,10 +333,18 @@ w.Close ();
|
||||
public void WaitEnd ()
|
||||
{
|
||||
if (!IsCompleted) {
|
||||
|
||||
const bool exit_context =
|
||||
#if MONOTOUCH
|
||||
false; // MonoTouch doesn't support any remoting feature
|
||||
#else
|
||||
true;
|
||||
#endif
|
||||
|
||||
// FIXME: Do we need to use the timeout? If so, what happens when the timeout is reached.
|
||||
// Is the current request cancelled and an exception thrown? If so we need to pass the
|
||||
// exception to the Complete () method and allow the result to complete 'normally'.
|
||||
if (!wait.WaitOne (Timeout, true))
|
||||
if (!wait.WaitOne (Timeout, exit_context))
|
||||
throw new TimeoutException ();
|
||||
}
|
||||
if (error != null)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace System.ServiceModel.Channels
|
||||
{
|
||||
// SL-only interface.
|
||||
public interface IHttpCookieContainer
|
||||
{
|
||||
CookieContainer CookieContainer { get; set; }
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -195,8 +195,16 @@ namespace System.ServiceModel.Description
|
||||
static MethodInfo [] GetAllMethods (Type type)
|
||||
{
|
||||
var l = new List<MethodInfo> ();
|
||||
foreach (var t in GetAllInterfaceTypes (type))
|
||||
foreach (var t in GetAllInterfaceTypes (type)) {
|
||||
#if MONOTOUCH
|
||||
// The MethodBase[] from t.GetMethods () is cast to a IEnumerable <MethodInfo>
|
||||
// when passed to List<MethodInfo>.AddRange, which in turn casts it to
|
||||
// ICollection <MethodInfo>. The full-aot compiler has no idea of this, so
|
||||
// we're going to make it aware.
|
||||
int c = ((ICollection <MethodInfo>) t.GetMethods ()).Count;
|
||||
#endif
|
||||
l.AddRange (t.GetMethods ());
|
||||
}
|
||||
return l.ToArray ();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2009-10-07 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* OperationContext.cs: Use [ThreadStatic] instead of Thread.
|
||||
GetNamedDataSlot with Thread.[Get|Set]Data since it offers type
|
||||
safety and don't require keeping extra API inside Moonlight
|
||||
[Backport r143620]
|
||||
|
||||
2009-09-17 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* DuplexClientRuntimeChannel.cs : reflecting EndpointDispatcher change.
|
||||
|
||||
@@ -38,13 +38,13 @@ namespace System.ServiceModel
|
||||
{
|
||||
[MonoTODO ("It somehow rejects classes, but dunno how we can do that besides our code wise.")]
|
||||
public abstract class ClientBase<TChannel> :
|
||||
#if !NET_2_1
|
||||
#if !NET_2_1 || MONOTOUCH
|
||||
IDisposable,
|
||||
#endif
|
||||
ICommunicationObject where TChannel : class
|
||||
{
|
||||
static InstanceContext initialContxt = new InstanceContext (null);
|
||||
#if NET_2_1
|
||||
#if NET_2_1 && !MONOTOUCH
|
||||
static readonly PropertyInfo dispatcher_main_property;
|
||||
static readonly MethodInfo dispatcher_begin_invoke_method;
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace System.ServiceModel
|
||||
|
||||
void RunCompletedCallback (SendOrPostCallback callback, InvokeAsyncCompletedEventArgs args)
|
||||
{
|
||||
#if !NET_2_1
|
||||
#if !NET_2_1 || MONOTOUCH
|
||||
callback (args);
|
||||
#else
|
||||
object dispatcher = dispatcher_main_property.GetValue (null, null);
|
||||
@@ -277,7 +277,7 @@ namespace System.ServiceModel
|
||||
}
|
||||
IAsyncResult begin_async_result;
|
||||
|
||||
#if !NET_2_1
|
||||
#if !NET_2_1 || MONOTOUCH
|
||||
void IDisposable.Dispose ()
|
||||
{
|
||||
Close ();
|
||||
@@ -403,7 +403,7 @@ namespace System.ServiceModel
|
||||
}
|
||||
}
|
||||
|
||||
#if !NET_2_1
|
||||
#if !NET_2_1 || MONOTOUCH
|
||||
public object Invoke (string methodName, object [] args)
|
||||
{
|
||||
var cd = endpoint.Contract;
|
||||
|
||||
@@ -36,15 +36,15 @@ namespace System.ServiceModel
|
||||
{
|
||||
public sealed class OperationContext : IExtensibleObject<OperationContext>
|
||||
{
|
||||
// generated guid (no special meaning)
|
||||
const string operation_context_name = "c15795e2-bb44-4cfb-a89c-8529feb170cb";
|
||||
Message incoming_message;
|
||||
[ThreadStatic]
|
||||
static OperationContext current;
|
||||
|
||||
public static OperationContext Current {
|
||||
get { return Thread.GetData (Thread.GetNamedDataSlot (operation_context_name)) as OperationContext; }
|
||||
set { Thread.SetData (Thread.GetNamedDataSlot (operation_context_name), value); }
|
||||
get { return current; }
|
||||
set { current = value; }
|
||||
}
|
||||
|
||||
Message incoming_message;
|
||||
#if !NET_2_1
|
||||
EndpointDispatcher dispatcher;
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2009-10-07 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* OperationContextTest.cs: Add test case for OperationContext.Current
|
||||
[Backport r143620]
|
||||
|
||||
2009-09-04 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* ServiceHostBaseTest.cs : a few more base address test.
|
||||
|
||||
@@ -84,5 +84,21 @@ namespace MonoTests.System.ServiceModel
|
||||
interface IFooChannel : IFoo, IClientChannel
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Current ()
|
||||
{
|
||||
Assert.IsNull (OperationContext.Current, "Current-1");
|
||||
|
||||
try {
|
||||
var ch = ChannelFactory<IFooChannel>.CreateChannel (new BasicHttpBinding (), new EndpointAddress ("http://localhost:37564"));
|
||||
OperationContext.Current = new OperationContext (ch);
|
||||
Assert.IsNotNull (OperationContext.Current, "Current-2");
|
||||
}
|
||||
finally {
|
||||
OperationContext.Current = null;
|
||||
Assert.IsNull (OperationContext.Current, "Current-3");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
#include net_2_1_raw_System.ServiceModel.dll.sources
|
||||
@@ -79,6 +79,7 @@ System.ServiceModel.Channels/IChannelFactory.cs
|
||||
System.ServiceModel.Channels/IDuplexChannel.cs
|
||||
System.ServiceModel.Channels/IDuplexSession.cs
|
||||
System.ServiceModel.Channels/IDuplexSessionChannel.cs
|
||||
System.ServiceModel.Channels/IHttpCookieContainer.cs
|
||||
System.ServiceModel.Channels/IInputChannel.cs
|
||||
System.ServiceModel.Channels/IInputSession.cs
|
||||
System.ServiceModel.Channels/IInputSessionChannel.cs
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2009-09-28 Marek Habersack <[email protected]>
|
||||
|
||||
* UpdatePanel.cs: RenderChildren stores the alternative writer in
|
||||
a private property, for the benefit of nested child panels. Fixes
|
||||
bug #542441
|
||||
|
||||
* ScriptManager.cs: don't render invisible panel IDs during async
|
||||
request. Fixes bug #542533
|
||||
|
||||
2009-05-26 Marek Habersack <[email protected]>
|
||||
|
||||
* ScriptReferenceBase.cs: implemented (3.5 SP1)
|
||||
|
||||
@@ -1061,9 +1061,18 @@ namespace System.Web.UI
|
||||
writer.WriteLine ("//<![CDATA[");
|
||||
writer.WriteLine ("Sys.WebForms.PageRequestManager._initialize('{0}', document.getElementById('{1}'));", UniqueID, Page.Form.ClientID);
|
||||
if (IsMultiForm)
|
||||
writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance($get(\"{0}\"))._updateControls([{1}], [{2}], [{3}], {4});", Page.Form.ClientID, FormatUpdatePanelIDs (_updatePanels, true), FormatListIDs (_asyncPostBackControls, true), FormatListIDs (_postBackControls, true), AsyncPostBackTimeout);
|
||||
writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance($get(\"{0}\"))._updateControls([{1}], [{2}], [{3}], {4});",
|
||||
Page.Form.ClientID,
|
||||
FormatUpdatePanelIDs (_updatePanels, true),
|
||||
FormatListIDs (_asyncPostBackControls, true, false),
|
||||
FormatListIDs (_postBackControls, true, false),
|
||||
AsyncPostBackTimeout);
|
||||
else
|
||||
writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance()._updateControls([{0}], [{1}], [{2}], {3});", FormatUpdatePanelIDs (_updatePanels, true), FormatListIDs (_asyncPostBackControls, true), FormatListIDs (_postBackControls, true), AsyncPostBackTimeout);
|
||||
writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance()._updateControls([{0}], [{1}], [{2}], {3});",
|
||||
FormatUpdatePanelIDs (_updatePanels, true),
|
||||
FormatListIDs (_asyncPostBackControls, true, false),
|
||||
FormatListIDs (_postBackControls, true, false),
|
||||
AsyncPostBackTimeout);
|
||||
writer.WriteLine ("//]]");
|
||||
writer.WriteLine ("</script>");
|
||||
}
|
||||
@@ -1075,21 +1084,29 @@ namespace System.Web.UI
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
for (int i = 0; i < list.Count; i++) {
|
||||
sb.AppendFormat ("{0}{1}{2}{0},", useSingleQuote ? "'" : String.Empty, list [i].ChildrenAsTriggers ? "t" : "f", list [i].UniqueID);
|
||||
foreach (UpdatePanel panel in list) {
|
||||
if (!panel.Visible)
|
||||
continue;
|
||||
|
||||
sb.AppendFormat ("{0}{1}{2}{0},", useSingleQuote ? "'" : String.Empty, panel.ChildrenAsTriggers ? "t" : "f", panel.UniqueID);
|
||||
}
|
||||
|
||||
if (sb.Length > 0)
|
||||
sb.Length--;
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
static string FormatListIDs<T> (List<T> list, bool useSingleQuote) where T : Control {
|
||||
static string FormatListIDs<T> (List<T> list, bool useSingleQuote, bool skipInvisible) where T : Control
|
||||
{
|
||||
if (list == null || list.Count == 0)
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
for (int i = 0; i < list.Count; i++) {
|
||||
if (skipInvisible && !list [i].Visible)
|
||||
continue;
|
||||
|
||||
sb.AppendFormat ("{0}{1}{0},", useSingleQuote ? "'" : String.Empty, list [i].UniqueID);
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
@@ -1255,7 +1272,7 @@ namespace System.Web.UI
|
||||
needsUpdate = true;
|
||||
else
|
||||
needsUpdate = false;
|
||||
|
||||
|
||||
if (needsUpdate == false) {
|
||||
Control parent = panel.Parent;
|
||||
UpdatePanel parentPanel;
|
||||
@@ -1270,7 +1287,7 @@ namespace System.Web.UI
|
||||
parent = parent.Parent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
panel.SetInPartialRendering (needsUpdate);
|
||||
if (needsUpdate)
|
||||
RegisterPanelForRefresh (panel);
|
||||
@@ -1286,11 +1303,11 @@ namespace System.Web.UI
|
||||
foreach (KeyValuePair <string, string> kvp in pageHiddenFields)
|
||||
WriteCallbackOutput (output, hiddenField, kvp.Key, kvp.Value);
|
||||
|
||||
WriteCallbackOutput (output, asyncPostBackControlIDs, null, FormatListIDs (_asyncPostBackControls, false));
|
||||
WriteCallbackOutput (output, postBackControlIDs, null, FormatListIDs (_postBackControls, false));
|
||||
WriteCallbackOutput (output, asyncPostBackControlIDs, null, FormatListIDs (_asyncPostBackControls, false, false));
|
||||
WriteCallbackOutput (output, postBackControlIDs, null, FormatListIDs (_postBackControls, false, false));
|
||||
WriteCallbackOutput (output, updatePanelIDs, null, FormatUpdatePanelIDs (_updatePanels, false));
|
||||
WriteCallbackOutput (output, childUpdatePanelIDs, null, FormatListIDs (_childUpdatePanels, false));
|
||||
WriteCallbackOutput (output, panelsToRefreshIDs, null, FormatListIDs (_panelsToRefresh, false));
|
||||
WriteCallbackOutput (output, childUpdatePanelIDs, null, FormatListIDs (_childUpdatePanels, false, true));
|
||||
WriteCallbackOutput (output, panelsToRefreshIDs, null, FormatListIDs (_panelsToRefresh, false, true));
|
||||
WriteCallbackOutput (output, asyncPostBackTimeout, null, AsyncPostBackTimeout.ToString ());
|
||||
if (!IsMultiForm)
|
||||
WriteCallbackOutput (output, pageTitle, null, Page.Title);
|
||||
@@ -1433,10 +1450,10 @@ namespace System.Web.UI
|
||||
output = ((HtmlTextParser) output).ResponseOutput;
|
||||
HtmlForm form = (HtmlForm) container;
|
||||
HtmlTextWriter writer = new HtmlDropWriter (output);
|
||||
|
||||
if (form.HasControls ()) {
|
||||
for (int i = 0; i < form.Controls.Count; i++) {
|
||||
form.Controls [i].RenderControl (writer);
|
||||
}
|
||||
foreach (Control control in form.Controls)
|
||||
control.RenderControl (writer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +200,9 @@ namespace System.Web.UI
|
||||
_updateMode = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Used by nested panels (see bug #542441)
|
||||
ScriptManager.AlternativeHtmlTextWriter RenderChildrenWriter { get; set; }
|
||||
|
||||
protected virtual Control CreateContentTemplateContainer ()
|
||||
{
|
||||
@@ -257,22 +260,50 @@ namespace System.Web.UI
|
||||
writer.RenderEndTag ();
|
||||
}
|
||||
|
||||
UpdatePanel FindParentPanel ()
|
||||
{
|
||||
Control parent = Parent;
|
||||
while (parent != null) {
|
||||
UpdatePanel panel = parent as UpdatePanel;
|
||||
if (panel != null)
|
||||
return panel;
|
||||
|
||||
parent = parent.Parent;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void RenderChildren (HtmlTextWriter writer)
|
||||
{
|
||||
RenderChildrenWriter = null;
|
||||
|
||||
if (IsInPartialRendering) {
|
||||
ScriptManager.AlternativeHtmlTextWriter altWriter = writer as ScriptManager.AlternativeHtmlTextWriter;
|
||||
if (altWriter == null)
|
||||
altWriter = writer.InnerWriter as ScriptManager.AlternativeHtmlTextWriter;
|
||||
|
||||
if (altWriter == null) {
|
||||
UpdatePanel parentPanel = FindParentPanel ();
|
||||
if (parentPanel != null)
|
||||
altWriter = parentPanel.RenderChildrenWriter;
|
||||
}
|
||||
|
||||
if (altWriter == null)
|
||||
throw new InvalidOperationException ("Internal error. Invalid writer object.");
|
||||
|
||||
HtmlTextWriter responseOutput = altWriter.ResponseOutput;
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
HtmlTextWriter w = new HtmlTextWriter (new StringWriter (sb));
|
||||
base.RenderChildren (w);
|
||||
w.Flush ();
|
||||
|
||||
ScriptManager.WriteCallbackPanel (responseOutput, this, sb);
|
||||
|
||||
// Used by nested panels (see bug #542441)
|
||||
RenderChildrenWriter = altWriter;
|
||||
try {
|
||||
HtmlTextWriter responseOutput = altWriter.ResponseOutput;
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
HtmlTextWriter w = new HtmlTextWriter (new StringWriter (sb));
|
||||
base.RenderChildren (w);
|
||||
w.Flush ();
|
||||
ScriptManager.WriteCallbackPanel (responseOutput, this, sb);
|
||||
} finally {
|
||||
RenderChildrenWriter = null;
|
||||
}
|
||||
} else
|
||||
base.RenderChildren (writer);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,16 @@ SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
LIBRARY = System.Web.Services.dll
|
||||
ifeq (monotouch, $(PROFILE))
|
||||
LIB_MCS_FLAGS = \
|
||||
-nowarn:649 -nowarn:169 \
|
||||
-r:$(corlib) \
|
||||
-r:System.dll \
|
||||
-r:System.Xml.dll \
|
||||
-resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd \
|
||||
-resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd \
|
||||
-resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd
|
||||
else
|
||||
LIB_MCS_FLAGS = \
|
||||
-nowarn:649 -nowarn:169 \
|
||||
-r:$(corlib) \
|
||||
@@ -18,6 +28,7 @@ LIB_MCS_FLAGS += \
|
||||
-resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd \
|
||||
-resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd
|
||||
endif
|
||||
endif
|
||||
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618
|
||||
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2009-09-30 Miguel de Icaza <[email protected]>
|
||||
|
||||
* ExtensionManager.cs: Initialize the NET_2_0 pieces with
|
||||
MonoTouch, but do not register any of the System.Configuration
|
||||
depending extensions.
|
||||
|
||||
BuildExtensionImporters, BuildExtensionReflectors: empty methods
|
||||
for MOnoTouch.
|
||||
|
||||
* ServiceDescriptionImporter.cs, WebReference.cs: Remove
|
||||
codegeneration features for MonoTouch
|
||||
|
||||
2008-12-18 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* BasicProfileChecker.cs : /definitions/message/part could omit
|
||||
|
||||
@@ -71,14 +71,22 @@ namespace System.Web.Services.Description
|
||||
RegisterExtensionType (typeof (Soap12FaultBinding));
|
||||
RegisterExtensionType (typeof (Soap12HeaderBinding));
|
||||
RegisterExtensionType (typeof (Soap12OperationBinding));
|
||||
#endif
|
||||
|
||||
#if !MONOTOUCH
|
||||
/*
|
||||
* Currently, the MonoTouch build has not support for
|
||||
* System.Configuration, so there are no external modules
|
||||
* defined
|
||||
*/
|
||||
#if NET_2_0
|
||||
foreach (TypeElement el in WebServicesSection.Current.ServiceDescriptionFormatExtensionTypes)
|
||||
RegisterExtensionType (el.Type);
|
||||
#else
|
||||
foreach (Type type in WSConfig.Instance.FormatExtensionTypes)
|
||||
RegisterExtensionType (type);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
CreateExtensionSerializers ();
|
||||
}
|
||||
|
||||
@@ -159,7 +167,22 @@ namespace System.Web.Services.Description
|
||||
throw new InvalidOperationException ("XmlFormatExtensionPointAttribute: Member " + at.MemberName + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* MonoTouch lacks support for configuration
|
||||
*/
|
||||
#if MONOTOUCH
|
||||
public static ArrayList BuildExtensionImporters ()
|
||||
{
|
||||
return new ArrayList (0);
|
||||
}
|
||||
|
||||
public static ArrayList BuildExtensionReflectors ()
|
||||
{
|
||||
return new ArrayList (0);
|
||||
}
|
||||
|
||||
#else
|
||||
public static ArrayList BuildExtensionImporters ()
|
||||
{
|
||||
#if NET_2_0
|
||||
@@ -177,7 +200,7 @@ namespace System.Web.Services.Description
|
||||
return BuildExtensionList (WSConfig.Instance.ExtensionReflectorTypes);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if NET_2_0
|
||||
public static ArrayList BuildExtensionList (TypeElementCollection exts)
|
||||
#else
|
||||
@@ -188,7 +211,7 @@ namespace System.Web.Services.Description
|
||||
|
||||
if (exts != null)
|
||||
{
|
||||
#if NET_2_0
|
||||
#if NET_2_0
|
||||
foreach (TypeElement econf in exts)
|
||||
{
|
||||
extensionTypes.Add (econf);
|
||||
@@ -221,6 +244,7 @@ namespace System.Web.Services.Description
|
||||
|
||||
return extensions;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
internal class ExtensionInfo
|
||||
|
||||
+9
-4
@@ -41,7 +41,10 @@ using System.Xml.Schema;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
|
||||
#if !MONOTOUCH
|
||||
using Microsoft.CSharp;
|
||||
#endif
|
||||
|
||||
namespace System.Web.Services.Description {
|
||||
public class ServiceDescriptionImporter {
|
||||
@@ -53,7 +56,7 @@ namespace System.Web.Services.Description {
|
||||
ServiceDescriptionCollection serviceDescriptions;
|
||||
ServiceDescriptionImportStyle style;
|
||||
|
||||
#if NET_2_0
|
||||
#if NET_2_0 && !MONOTOUCH
|
||||
CodeGenerationOptions options;
|
||||
CodeDomProvider codeGenerator = new CSharpCodeProvider ();
|
||||
ImportContext context;
|
||||
@@ -97,7 +100,7 @@ namespace System.Web.Services.Description {
|
||||
set { style = value; }
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
#if NET_2_0 && !MONOTOUCH
|
||||
[System.Runtime.InteropServices.ComVisible(false)]
|
||||
public CodeGenerationOptions CodeGenerationOptions {
|
||||
get { return options; }
|
||||
@@ -139,6 +142,7 @@ namespace System.Web.Services.Description {
|
||||
schemas.Add (serviceDescription.Types.Schemas);
|
||||
}
|
||||
|
||||
#if !MONOTOUCH
|
||||
public ServiceDescriptionImportWarnings Import (CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)
|
||||
{
|
||||
foreach (ProtocolImporter importer in GetSupportedImporters ()) {
|
||||
@@ -154,15 +158,16 @@ namespace System.Web.Services.Description {
|
||||
{
|
||||
ArrayList list = new ArrayList ();
|
||||
list.Add (new SoapProtocolImporter ());
|
||||
#if NET_2_0
|
||||
#if NET_2_0
|
||||
list.Add (new Soap12ProtocolImporter ());
|
||||
#endif
|
||||
list.Add (new HttpGetProtocolImporter ());
|
||||
list.Add (new HttpPostProtocolImporter ());
|
||||
return list;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_2_0
|
||||
#if NET_2_0 && !MONOTOUCH
|
||||
|
||||
[MonoTODO] // where to use Verbose and Extensions in options?
|
||||
public static StringCollection GenerateWebReferences (
|
||||
|
||||
@@ -42,16 +42,16 @@ namespace System.Web.Services.Description
|
||||
sealed class WebReference
|
||||
{
|
||||
DiscoveryClientDocumentCollection _documents;
|
||||
#if !TARGET_J2EE
|
||||
#if !TARGET_J2EE && !MONOTOUCH
|
||||
CodeNamespace _proxyCode;
|
||||
#endif
|
||||
ServiceDescriptionImportWarnings _warnings;
|
||||
#endif
|
||||
string _protocolName;
|
||||
string _appSettingUrlKey;
|
||||
string _appSettingBaseUrl;
|
||||
StringCollection _validationWarnings;
|
||||
|
||||
#if !TARGET_J2EE
|
||||
#if !TARGET_J2EE && !MONOTOUCH
|
||||
public WebReference (DiscoveryClientDocumentCollection documents, CodeNamespace proxyCode)
|
||||
{
|
||||
if (documents == null) throw new ArgumentNullException ("documents");
|
||||
@@ -94,10 +94,15 @@ namespace System.Web.Services.Description
|
||||
get { return _protocolName; }
|
||||
set { _protocolName = value; }
|
||||
}
|
||||
#if !TARGET_J2EE
|
||||
#if !TARGET_J2EE && !MONOTOUCH
|
||||
public CodeNamespace ProxyCode {
|
||||
get { return _proxyCode; }
|
||||
}
|
||||
|
||||
public ServiceDescriptionImportWarnings Warnings {
|
||||
get { return _warnings; }
|
||||
set { _warnings = value; }
|
||||
}
|
||||
#endif
|
||||
public StringCollection ValidationWarnings {
|
||||
get {
|
||||
@@ -106,11 +111,6 @@ namespace System.Web.Services.Description
|
||||
}
|
||||
}
|
||||
|
||||
public ServiceDescriptionImportWarnings Warnings {
|
||||
get { return _warnings; }
|
||||
set { _warnings = value; }
|
||||
}
|
||||
|
||||
internal void SetValidationWarnings (StringCollection col)
|
||||
{
|
||||
_validationWarnings = col;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2009-09-30 Miguel de Icaza <[email protected]>
|
||||
|
||||
* Methods.cs: Empty extensions for MonoTouch for now.
|
||||
|
||||
* ServerType.cs: On MonoTouch, we do not support HttpGet or
|
||||
HttpPost variations yet.
|
||||
|
||||
* SoapExtension.cs: Avoid System.Configuration features.
|
||||
|
||||
2009-08-24 Marek Habersack <[email protected]>
|
||||
|
||||
* SoapDocumentationHandler.cs: get rid of the ugly fake virtual
|
||||
|
||||
@@ -491,7 +491,11 @@ namespace System.Web.Services.Protocols {
|
||||
xmlImporter.IncludeTypes (Type);
|
||||
soapImporter.IncludeTypes (Type);
|
||||
|
||||
#if MONOTOUCH
|
||||
SoapExtensions = new SoapExtensionRuntimeConfig [2][];
|
||||
#else
|
||||
SoapExtensions = SoapExtension.GetTypeExtensions (Type);
|
||||
#endif
|
||||
}
|
||||
|
||||
internal SoapServiceRoutingStyle RoutingStyle {
|
||||
|
||||
@@ -201,7 +201,32 @@ namespace System.Web.Services.Protocols
|
||||
{
|
||||
get { return logicalMethods; }
|
||||
}
|
||||
|
||||
|
||||
#if MONOTOUCH
|
||||
internal TypeStubInfo GetTypeStub (string protocolName)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
switch (protocolName)
|
||||
{
|
||||
case "Soap":
|
||||
if (soapProtocol == null){
|
||||
soapProtocol = new SoapTypeStubInfo (this);
|
||||
soapProtocol.Initialize ();
|
||||
}
|
||||
return soapProtocol;
|
||||
|
||||
case "Soap12":
|
||||
if (soap12Protocol == null){
|
||||
soap12Protocol = new Soap12TypeStubInfo (this);
|
||||
soap12Protocol.Initialize ();
|
||||
}
|
||||
return soap12Protocol;
|
||||
}
|
||||
throw new InvalidOperationException ("Protocol " + protocolName + " not supported");
|
||||
}
|
||||
}
|
||||
#else
|
||||
internal TypeStubInfo GetTypeStub (string protocolName)
|
||||
{
|
||||
lock (this)
|
||||
@@ -226,7 +251,8 @@ namespace System.Web.Services.Protocols
|
||||
}
|
||||
throw new InvalidOperationException ("Protocol " + protocolName + " not supported");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TypeStubInfo CreateTypeStubInfo (Type type)
|
||||
{
|
||||
TypeStubInfo tsi = (TypeStubInfo) Activator.CreateInstance (type, new object[] {this});
|
||||
|
||||
@@ -111,11 +111,11 @@ namespace System.Web.Services.Protocols {
|
||||
return pos;
|
||||
}
|
||||
|
||||
#if !MONOTOUCH
|
||||
static void InitializeGlobalExtensions ()
|
||||
{
|
||||
globalExtensions = new ArrayList[2];
|
||||
|
||||
#if NET_2_0
|
||||
#if NET_2_0
|
||||
if (WebServicesSection.Current == null) return;
|
||||
|
||||
SoapExtensionTypeElementCollection exts = WebServicesSection.Current.SoapExtensionTypes;
|
||||
@@ -173,7 +173,8 @@ namespace System.Web.Services.Protocols {
|
||||
}
|
||||
return exts;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
internal static SoapExtensionRuntimeConfig[] GetMethodExtensions (LogicalMethodInfo method)
|
||||
{
|
||||
object[] ats = method.GetCustomAttributes (typeof (SoapExtensionAttribute));
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !TARGET_J2EE
|
||||
#if !TARGET_J2EE && !MONOTOUCH
|
||||
using System.EnterpriseServices;
|
||||
#endif
|
||||
|
||||
namespace System.Web.Services {
|
||||
|
||||
#if TARGET_J2EE
|
||||
#if TARGET_J2EE || MONOTOUCH
|
||||
public enum TransactionOption {Disabled , NotSupported , Required , RequiresNew , Supported }
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
System.Web.Services/WebServiceBindingAttribute.cs
|
||||
System.Web.Services/WebServiceAttribute.cs
|
||||
System.Web.Services.Protocols/SoapHttpClientProtocol.cs
|
||||
System.Web.Services.Protocols/HttpWebClientProtocol.cs
|
||||
System.Web.Services.Protocols/WebClientAsyncResult.cs
|
||||
System.Web.Services.Protocols/WebClientProtocol.cs
|
||||
System.Web.Services.Protocols/Methods.cs
|
||||
System.Web.Services.Protocols/TypeStubManager.cs
|
||||
System.Web.Services.Protocols/SoapClientMessage.cs
|
||||
System.Web.Services.Protocols/SoapExtension.cs
|
||||
System.Web.Services.Protocols/LogicalMethodInfo.cs
|
||||
System.Web.Services.Protocols/SoapMessage.cs
|
||||
System.Web.Services/WebMethodAttribute.cs
|
||||
System.Web.Services.Protocols/SoapParameterStyle.cs
|
||||
System.Web.Services.Description/SoapBindingUse.cs
|
||||
System.Web.Services.Protocols/SoapHeaderMapping.cs
|
||||
System.Web.Services.Protocols/SoapHeaderDirection.cs
|
||||
System.Web.Services.Protocols/SoapHeaderCollection.cs
|
||||
System.Web.Services.Description/SoapBindingStyle.cs
|
||||
System.Web.Services.Protocols/SoapServiceRoutingStyle.cs
|
||||
System.Web.Services.Protocols/SoapExtensionAttribute.cs
|
||||
System.Web.Services.Protocols/SoapException.cs
|
||||
System.Web.Services.Protocols/SoapHeader.cs
|
||||
System.Web.Services.Protocols/SoapMessageStage.cs
|
||||
System.Web.Services.Protocols/SoapHeaderAttribute.cs
|
||||
System.Web.Services.Protocols/ServerType.cs
|
||||
System.Web.Services.Protocols/LogicalMethodTypes.cs
|
||||
System.Web.Services/WebServicesDescriptionAttribute.cs
|
||||
System.Web.Services.Protocols/WebServiceHelper.cs
|
||||
System.Web.Services.Protocols/SoapDocumentMethodAttribute.cs
|
||||
System.Web.Services.Protocols/SoapDocumentServiceAttribute.cs
|
||||
System.Web.Services.Protocols/SoapRpcMethodAttribute.cs
|
||||
System.Web.Services.Protocols/SoapRpcServiceAttribute.cs
|
||||
System.Web.Services.Discovery/DiscoveryClientProtocol.cs
|
||||
System.Web.Services.Discovery/DiscoveryClientDocumentCollection.cs
|
||||
System.Web.Services.Discovery/DiscoveryDocument.cs
|
||||
System.Web.Services.Discovery/DiscoveryClientResultCollection.cs
|
||||
System.Web.Services.Discovery/DiscoveryClientResult.cs
|
||||
System.Web.Services.Discovery/DiscoveryExceptionDictionary.cs
|
||||
System.Web.Services.Discovery/DiscoveryClientReferenceCollection.cs
|
||||
System.Web.Services.Discovery/DiscoveryReference.cs
|
||||
System.Web.Services.Discovery/SoapBinding.cs
|
||||
System.Web.Services.Protocols/Fault.cs
|
||||
System.Web.Services.Protocols/InvokeCompletedEventArgs.cs
|
||||
System.Web.Services.Protocols/InvokeCompletedEventHandler.cs
|
||||
System.Web.Services.Protocols/SoapUnknownHeader.cs
|
||||
System.Web.Services/WsiProfiles.cs
|
||||
System.Web.Services.Protocols/SoapProtocolVersion.cs
|
||||
System.Web.Services.Protocols/SoapFaultSubcode.cs
|
||||
System.Web.Services.Protocols/Soap12FaultCodes.cs
|
||||
System.Web.Services.Protocols/Fault12.cs
|
||||
System.Web.Services.Protocols/MimeFormatter.cs
|
||||
System.Web.Services.Description/ServiceDescription.cs
|
||||
System.Web.Services.Description/NamedItem.cs
|
||||
System.Web.Services.Description/DocumentableItem.cs
|
||||
System.Web.Services.Description/ServiceDescriptionCollection.cs
|
||||
System.Web.Services.Description/ServiceCollection.cs
|
||||
System.Web.Services.Description/ServiceDescriptionBaseCollection.cs
|
||||
System.Web.Services.Description/ServiceDescriptionFormatExtension.cs
|
||||
System.Web.Services.Description/ServiceDescriptionFormatExtensionCollection.cs
|
||||
System.Web.Services.Description/Service.cs
|
||||
System.Web.Services.Description/Binding.cs
|
||||
System.Web.Services.Description/Port.cs
|
||||
System.Web.Services.Description/PortCollection.cs
|
||||
System.Web.Services.Description/MessageCollection.cs
|
||||
System.Web.Services.Description/Message.cs
|
||||
System.Web.Services.Description/MessagePart.cs
|
||||
System.Web.Services.Description/MessagePartCollection.cs
|
||||
System.Web.Services.Configuration/XmlFormatExtensionAttribute.cs
|
||||
System.Web.Services.Configuration/XmlFormatExtensionPointAttribute.cs
|
||||
System.Web.Services.Configuration/XmlFormatExtensionPrefixAttribute.cs
|
||||
System.Web.Services.Description/BindingCollection.cs
|
||||
System.Web.Services.Description/Import.cs
|
||||
System.Web.Services.Description/ImportCollection.cs
|
||||
System.Web.Services.Description/PortType.cs
|
||||
System.Web.Services.Description/PortTypeCollection.cs
|
||||
System.Web.Services.Description/OperationBinding.cs
|
||||
System.Web.Services.Description/OperationBindingCollection.cs
|
||||
System.Web.Services.Description/InputBinding.cs
|
||||
System.Web.Services.Description/OutputBinding.cs
|
||||
System.Web.Services.Description/MessageBinding.cs
|
||||
System.Web.Services.Description/FaultBindingCollection.cs
|
||||
System.Web.Services.Description/FaultBinding.cs
|
||||
System.Web.Services.Description/OperationCollection.cs
|
||||
System.Web.Services.Description/Operation.cs
|
||||
System.Web.Services.Description/Types.cs
|
||||
System.Web.Services.Description/OperationFault.cs
|
||||
System.Web.Services.Description/OperationFaultCollection.cs
|
||||
System.Web.Services.Description/OperationMessage.cs
|
||||
System.Web.Services.Description/OperationMessageCollection.cs
|
||||
System.Web.Services.Description/OperationFlow.cs
|
||||
System.Web.Services.Description/OperationInput.cs
|
||||
System.Web.Services.Description/OperationOutput.cs
|
||||
System.Web.Services.Description/ServiceDescriptionImporter.cs
|
||||
System.Web.Services.Description/WebReference.cs
|
||||
System.Web.Services.Description/ServiceDescriptionImportStyle.cs
|
||||
System.Web.Services.Discovery/DiscoveryDocumentReference.cs
|
||||
System.Web.Services.Discovery/ContractReference.cs
|
||||
System.Web.Services.Discovery/SchemaReference.cs
|
||||
System.Web.Services.Discovery/DiscoveryDocumentSerializer.cs
|
||||
|
||||
System.Web.Services.Discovery/ContractSearchPattern.cs
|
||||
System.Web.Services.Discovery/DiscoveryDocumentLinksPattern.cs
|
||||
System.Web.Services.Discovery/DiscoveryDocumentSearchPattern.cs
|
||||
System.Web.Services.Discovery/DiscoveryReferenceCollection.cs
|
||||
System.Web.Services.Discovery/DiscoverySearchPattern.cs
|
||||
System.Web.Services.Discovery/DynamicDiscoveryDocument.cs
|
||||
System.Web.Services.Discovery/ExcludePathInfo.cs
|
||||
System.Web.Services.Discovery/XmlSchemaSearchPattern.cs
|
||||
|
||||
System.Web.Services.Protocols/Fault12Serializer.cs
|
||||
System.Web.Services.Protocols/HttpMethodAttribute.cs
|
||||
System.Web.Services.Protocols/NopReturnReader.cs
|
||||
System.Web.Services.Protocols/MimeReturnReader.cs
|
||||
System.Web.Services.Protocols/XmlReturnReader.cs
|
||||
System.Web.Services.Protocols/UrlParameterWriter.cs
|
||||
System.Web.Services.Protocols/UrlEncodedParameterWriter.cs
|
||||
System.Web.Services.Protocols/MimeParameterWriter.cs
|
||||
System.Web.Services.Description/SoapBinding.cs
|
||||
System.Web.Services.Description/Soap12Binding.cs
|
||||
System.Web.Services.Description/HttpBinding.cs
|
||||
System.Web.Services.Description/MimeContentBinding.cs
|
||||
System.Web.Services.Description/MimeTextBinding.cs
|
||||
System.Web.Services.Description/MimeTextMatch.cs
|
||||
System.Web.Services.Description/MimeTextMatchCollection.cs
|
||||
System.Web.Services.Description/ExtensionManager.cs
|
||||
System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs
|
||||
../System.Web/System.Web/HttpUtility.cs
|
||||
System.Web.Services.Description/MimePart.cs
|
||||
System.Web.Services.Description/MimePartCollection.cs
|
||||
System.Web.Services.Description/HttpAddressBinding.cs
|
||||
System.Web.Services.Description/HttpOperationBinding.cs
|
||||
System.Web.Services.Description/HttpUrlEncodedBinding.cs
|
||||
System.Web.Services.Description/HttpUrlReplacementBinding.cs
|
||||
System.Web.Services.Description/MimeMultipartRelatedBinding.cs
|
||||
System.Web.Services.Description/MimeXmlBinding.cs
|
||||
System.Web.Services.Description/SoapAddressBinding.cs
|
||||
System.Web.Services.Description/SoapBodyBinding.cs
|
||||
System.Web.Services.Description/SoapFaultBinding.cs
|
||||
System.Web.Services.Description/SoapHeaderBinding.cs
|
||||
System.Web.Services.Description/SoapOperationBinding.cs
|
||||
System.Web.Services.Description/Soap12AddressBinding.cs
|
||||
System.Web.Services.Description/Soap12BodyBinding.cs
|
||||
System.Web.Services.Description/Soap12FaultBinding.cs
|
||||
System.Web.Services.Description/Soap12HeaderBinding.cs
|
||||
System.Web.Services.Description/Soap12OperationBinding.cs
|
||||
System.Web.Services.Description/SoapHeaderFaultBinding.cs
|
||||
@@ -1,3 +1,7 @@
|
||||
2009-10-05 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile ($(build_lib)): fixed a typo in dependency macro
|
||||
|
||||
2009-09-07 Marek Habersack <[email protected]>
|
||||
|
||||
* Makefile (TEST_RESOURCE_FILES): added
|
||||
|
||||
@@ -275,7 +275,7 @@ ifdef DEVEL
|
||||
LIB_MCS_FLAGS += -define:DEVEL
|
||||
endif
|
||||
|
||||
$(build_lib): $(RESX_RES) $(RESOURCE_FILES2) $(RESOURCE_FILES_1)
|
||||
$(build_lib): $(RESX_RES) $(RESOURCE_FILES_2) $(RESOURCE_FILES_1)
|
||||
|
||||
$(RESX_RES): %.resources: %.resx
|
||||
$(RESGEN) `echo $< | $(PLATFORM_CHANGE_SEPARATOR_CMD)`
|
||||
|
||||
@@ -212,7 +212,13 @@ namespace System.Web.Caching
|
||||
|
||||
ci.LastChange = DateTime.Now;
|
||||
if (ci.AbsoluteExpiration != NoAbsoluteExpiration) {
|
||||
int remaining = Math.Max (0, (int)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
|
||||
long remaining = Math.Max (0, (long)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
|
||||
if (remaining > 4294967294L)
|
||||
// Maximum due time for timer
|
||||
// Item will expire properly anyway, as the timer will be
|
||||
// rescheduled for the item's expiration time once that item is
|
||||
// bubbled to the top of the priority queue.
|
||||
remaining = 4294967294L;
|
||||
ci.Timer = new Timer (new TimerCallback (ItemExpired), ci, remaining, Timeout.Infinite);
|
||||
}
|
||||
} finally {
|
||||
@@ -319,10 +325,18 @@ namespace System.Web.Caching
|
||||
|
||||
void ItemExpired(object cacheItem) {
|
||||
CacheItem ci = (CacheItem)cacheItem;
|
||||
ci.Timer.Dispose();
|
||||
ci.Timer = null;
|
||||
long remaining = Math.Max (0, (long)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
|
||||
if (remaining > 4294967294L)
|
||||
remaining = 4294967294L;
|
||||
|
||||
Remove (ci.Key, CacheItemRemovedReason.Expired, true);
|
||||
if (remaining <= 0) {
|
||||
ci.Timer.Dispose();
|
||||
ci.Timer = null;
|
||||
|
||||
Remove (ci.Key, CacheItemRemovedReason.Expired, true);
|
||||
}
|
||||
|
||||
ci.Timer.Change (remaining, Timeout.Infinite);
|
||||
}
|
||||
|
||||
internal void CheckDependencies ()
|
||||
|
||||
@@ -33,6 +33,7 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Caching {
|
||||
|
||||
@@ -81,7 +82,7 @@ namespace System.Web.Caching {
|
||||
// FIXME: QueryString might contain a null key if a page gets called like this: page.aspx?arg (w/out the "=")
|
||||
if (p == null) continue;
|
||||
builder.Append ("VPQ:");
|
||||
builder.Append (p.ToLower (CultureInfo.InvariantCulture));
|
||||
builder.Append (p.ToLower (Helpers.InvariantCulture));
|
||||
builder.Append ('=');
|
||||
builder.Append (request.QueryString [p]);
|
||||
builder.Append (newLine);
|
||||
@@ -90,7 +91,7 @@ namespace System.Web.Caching {
|
||||
// FIXME: can this be null, too?
|
||||
if (p == null) continue;
|
||||
builder.Append ("VPF:");
|
||||
builder.Append (p.ToLower (CultureInfo.InvariantCulture));
|
||||
builder.Append (p.ToLower (Helpers.InvariantCulture));
|
||||
builder.Append ('=');
|
||||
builder.Append (request.Form [p]);
|
||||
builder.Append (newLine);
|
||||
@@ -99,14 +100,14 @@ namespace System.Web.Caching {
|
||||
for (int i=0; i<prms.Length; i++) {
|
||||
if (request.QueryString [prms [i]] != null) {
|
||||
builder.Append ("VPQ:");
|
||||
builder.Append (prms [i].ToLower (CultureInfo.InvariantCulture));
|
||||
builder.Append (prms [i].ToLower (Helpers.InvariantCulture));
|
||||
builder.Append ('=');
|
||||
builder.Append (request.QueryString [prms [i]]);
|
||||
builder.Append (newLine);
|
||||
}
|
||||
if (request.Form [prms [i]] != null) {
|
||||
builder.Append ("VPF:");
|
||||
builder.Append (prms [i].ToLower (CultureInfo.InvariantCulture));
|
||||
builder.Append (prms [i].ToLower (Helpers.InvariantCulture));
|
||||
builder.Append ('=');
|
||||
builder.Append (request.Form [prms [i]]);
|
||||
builder.Append (newLine);
|
||||
@@ -117,7 +118,7 @@ namespace System.Web.Caching {
|
||||
if (headers != null) {
|
||||
for (int i=0; i<headers.Length; i++) {
|
||||
builder.Append ("VH:");
|
||||
builder.Append (headers [i].ToLower (CultureInfo.InvariantCulture));
|
||||
builder.Append (headers [i].ToLower (Helpers.InvariantCulture));
|
||||
builder.Append ('=');
|
||||
builder.Append (request.Headers [headers [i]]);
|
||||
builder.Append (newLine);
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2009-10-05 Marek Habersack <[email protected]>
|
||||
|
||||
* Cache.cs: if item expiration time exceeds the maximum value
|
||||
Timer accepts, use the latter - item will expire properly anyway,
|
||||
as the timer will be rescheduled for the item's expiration time
|
||||
once that item is bubbled to the top of the priority queue. Fixes
|
||||
bug #544171
|
||||
|
||||
2009-03-03 Marek Habersack <[email protected]>
|
||||
|
||||
* CachedRawResponse.cs: headers are stored in NameValueCollection
|
||||
|
||||
@@ -32,6 +32,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Compilation
|
||||
{
|
||||
@@ -156,7 +157,7 @@ namespace System.Web.Compilation
|
||||
|
||||
bool Acceptable (string extension, out AppResourceFileKind kind)
|
||||
{
|
||||
switch (extension.ToLower (CultureInfo.InvariantCulture))
|
||||
switch (extension.ToLower (Helpers.InvariantCulture))
|
||||
{
|
||||
default:
|
||||
kind = AppResourceFileKind.NotResource;
|
||||
|
||||
@@ -29,8 +29,10 @@
|
||||
//
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Web.Util;
|
||||
|
||||
#if NET_2_0
|
||||
using System.Collections.Generic;
|
||||
@@ -349,7 +351,7 @@ namespace System.Web.Compilation
|
||||
{
|
||||
source = null;
|
||||
ns = null;
|
||||
if (0 != String.Compare (componentName, tagName, true))
|
||||
if (0 != String.Compare (componentName, tagName, true, Helpers.InvariantCulture))
|
||||
return null;
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace System.Web.Compilation
|
||||
if (tags.Count == 0)
|
||||
return false;
|
||||
|
||||
return 0 == String.Compare (tagid, (string) tags.Peek (), true, CultureInfo.InvariantCulture);
|
||||
return 0 == String.Compare (tagid, (string) tags.Peek (), true, Helpers.InvariantCulture);
|
||||
}
|
||||
|
||||
public int Count {
|
||||
@@ -384,7 +384,7 @@ namespace System.Web.Compilation
|
||||
if (matches == null || matches.Count == 0)
|
||||
return null;
|
||||
|
||||
string wantedDirectiveName = tparser.DefaultDirectiveName.ToLower ();
|
||||
string wantedDirectiveName = tparser.DefaultDirectiveName.ToLower (Helpers.InvariantCulture);
|
||||
string directiveName;
|
||||
GroupCollection groups;
|
||||
CaptureCollection ccNames;
|
||||
@@ -399,7 +399,7 @@ namespace System.Web.Compilation
|
||||
if (String.IsNullOrEmpty (directiveName))
|
||||
continue;
|
||||
|
||||
if (String.Compare (directiveName.ToLower (), wantedDirectiveName, StringComparison.Ordinal) != 0)
|
||||
if (String.Compare (directiveName.ToLower (Helpers.InvariantCulture), wantedDirectiveName, StringComparison.Ordinal) != 0)
|
||||
continue;
|
||||
|
||||
var loc = new Location (null);
|
||||
@@ -937,7 +937,7 @@ namespace System.Web.Compilation
|
||||
if (text.Length != 0)
|
||||
FlushText (lastTag == TagType.CodeRender);
|
||||
|
||||
if (0 == String.Compare (tagid, "script", true, CultureInfo.InvariantCulture)) {
|
||||
if (0 == String.Compare (tagid, "script", true, Helpers.InvariantCulture)) {
|
||||
bool in_script = (inScript || ignore_text);
|
||||
if (in_script) {
|
||||
if (ProcessScript (tagtype, attributes))
|
||||
@@ -1050,7 +1050,7 @@ namespace System.Web.Compilation
|
||||
|
||||
for (int idx = otags.Count - 1; idx >= 0; idx--) {
|
||||
string otagid = (string) otags [idx];
|
||||
if (0 == String.Compare (tagid, otagid, true, CultureInfo.InvariantCulture)) {
|
||||
if (0 == String.Compare (tagid, otagid, true, Helpers.InvariantCulture)) {
|
||||
do {
|
||||
otags.RemoveAt (idx);
|
||||
} while (otags.Count - 1 >= idx);
|
||||
@@ -1294,15 +1294,15 @@ namespace System.Web.Compilation
|
||||
{
|
||||
ignored = false;
|
||||
if (isApplication) {
|
||||
if (String.Compare (tagid, "object", true, CultureInfo.InvariantCulture) != 0)
|
||||
if (String.Compare (tagid, "object", true, Helpers.InvariantCulture) != 0)
|
||||
throw new ParseException (location, "Invalid tag for application file.");
|
||||
}
|
||||
|
||||
ControlBuilder parent = stack.Builder;
|
||||
ControlBuilder builder = null;
|
||||
if (parent != null && parent.ControlType == typeof (HtmlTable) &&
|
||||
(String.Compare (tagid, "thead", true, CultureInfo.InvariantCulture) == 0 ||
|
||||
String.Compare (tagid, "tbody", true, CultureInfo.InvariantCulture) == 0)) {
|
||||
(String.Compare (tagid, "thead", true, Helpers.InvariantCulture) == 0 ||
|
||||
String.Compare (tagid, "tbody", true, Helpers.InvariantCulture) == 0)) {
|
||||
ignored = true;
|
||||
return true;
|
||||
}
|
||||
@@ -1464,8 +1464,8 @@ namespace System.Web.Compilation
|
||||
{
|
||||
ControlBuilder current = stack.Builder;
|
||||
string btag = current.OriginalTagName;
|
||||
if (String.Compare (btag, "tbody", true, CultureInfo.InvariantCulture) != 0 &&
|
||||
String.Compare (tagid, "tbody", true, CultureInfo.InvariantCulture) == 0) {
|
||||
if (String.Compare (btag, "tbody", true, Helpers.InvariantCulture) != 0 &&
|
||||
String.Compare (tagid, "tbody", true, Helpers.InvariantCulture) == 0) {
|
||||
if (!current.ChildrenAsProperties) {
|
||||
try {
|
||||
TextParsed (location, location.PlainText);
|
||||
@@ -1475,10 +1475,10 @@ namespace System.Web.Compilation
|
||||
return true;
|
||||
}
|
||||
|
||||
if (current.ControlType == typeof (HtmlTable) && String.Compare (tagid, "thead", true, CultureInfo.InvariantCulture) == 0)
|
||||
if (current.ControlType == typeof (HtmlTable) && String.Compare (tagid, "thead", true, Helpers.InvariantCulture) == 0)
|
||||
return true;
|
||||
|
||||
if (0 != String.Compare (tagid, btag, true, CultureInfo.InvariantCulture))
|
||||
if (0 != String.Compare (tagid, btag, true, Helpers.InvariantCulture))
|
||||
return false;
|
||||
|
||||
// if (current is TemplateBuilder)
|
||||
@@ -1561,7 +1561,7 @@ namespace System.Web.Compilation
|
||||
if (lang == null || lang == "")
|
||||
return;
|
||||
|
||||
if (String.Compare (lang, tparser.Language, true, CultureInfo.InvariantCulture) == 0)
|
||||
if (String.Compare (lang, tparser.Language, true, Helpers.InvariantCulture) == 0)
|
||||
return;
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -524,14 +524,14 @@ namespace System.Web.Compilation
|
||||
token = tokenizer.get_token ();
|
||||
}
|
||||
|
||||
end = end.ToLower (CultureInfo.InvariantCulture);
|
||||
end = end.ToLower (Helpers.InvariantCulture);
|
||||
int repeated = 0;
|
||||
for (int k = 0; k < end.Length; k++)
|
||||
if (end [0] == end [k])
|
||||
repeated++;
|
||||
|
||||
while (token != Token.EOF){
|
||||
if (Char.ToLower ((char) token, CultureInfo.InvariantCulture) == end [i]){
|
||||
if (Char.ToLower ((char) token, Helpers.InvariantCulture) == end [i]){
|
||||
if (++i >= end.Length)
|
||||
break;
|
||||
tmp.Append ((char) token);
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace System.Web.Compilation {
|
||||
string filename = GetTempFilePhysicalPath (extension);
|
||||
ICodePragmaGenerator pragmaGenerator;
|
||||
|
||||
switch (extension.ToLower ()) {
|
||||
switch (extension.ToLowerInvariant ()) {
|
||||
case "cs":
|
||||
pragmaGenerator = new CSharpCodePragmaGenerator ();
|
||||
break;
|
||||
|
||||
@@ -67,6 +67,19 @@ namespace System.Web.Compilation
|
||||
protected CodeTypeReferenceExpression mainClassExpr;
|
||||
protected static CodeThisReferenceExpression thisRef = new CodeThisReferenceExpression ();
|
||||
|
||||
#if NET_2_0
|
||||
VirtualPath inputVirtualPath;
|
||||
|
||||
public VirtualPath InputVirtualPath {
|
||||
get {
|
||||
if (inputVirtualPath == null)
|
||||
inputVirtualPath = new VirtualPath (VirtualPathUtility.Combine (parser.BaseVirtualDir, Path.GetFileName (parser.InputFile)));
|
||||
|
||||
return inputVirtualPath;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
protected BaseCompiler (TemplateParser parser)
|
||||
{
|
||||
this.parser = parser;
|
||||
@@ -328,11 +341,7 @@ namespace System.Web.Compilation
|
||||
return;
|
||||
if (!baseType.IsSubclassOf (typeof (System.Web.UI.TemplateControl)))
|
||||
return;
|
||||
|
||||
string arvp = Path.Combine (parser.BaseVirtualDir, Path.GetFileName (parser.InputFile));
|
||||
if (VirtualPathUtility.IsAbsolute (arvp))
|
||||
arvp = VirtualPathUtility.ToAppRelative (arvp);
|
||||
|
||||
|
||||
CodeTypeReference baseTypeRef = new CodeTypeReference (baseType.FullName);
|
||||
if (parser.BaseTypeIsGlobal)
|
||||
baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
|
||||
@@ -341,7 +350,7 @@ namespace System.Web.Compilation
|
||||
CodePropertyReferenceExpression arvpProp = new CodePropertyReferenceExpression (cast, "AppRelativeVirtualPath");
|
||||
CodeAssignStatement arvpAssign = new CodeAssignStatement ();
|
||||
arvpAssign.Left = arvpProp;
|
||||
arvpAssign.Right = new CodePrimitiveExpression (VirtualPathUtility.RemoveTrailingSlash (arvp));
|
||||
arvpAssign.Right = new CodePrimitiveExpression (VirtualPathUtility.RemoveTrailingSlash (InputVirtualPath.AppRelative));
|
||||
ctor.Statements.Add (arvpAssign);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -233,9 +233,13 @@ namespace System.Web.Compilation {
|
||||
// 3 -> ascx, aspx
|
||||
// 6 -> app_code - nothing to do here
|
||||
// 8 -> global.asax
|
||||
// 9 -> App_GlobalResources - nothing to do?
|
||||
// 9 -> App_GlobalResources - set the assembly for HttpContext
|
||||
if (reader.Name == "resultType" && (val == "2" || val == "3" || val == "8"))
|
||||
LoadPageData (reader);
|
||||
LoadPageData (reader, true);
|
||||
else if (val == "9") {
|
||||
PreCompilationData pd = LoadPageData (reader, false);
|
||||
HttpContext.AppGlobalResourcesAssembly = Assembly.Load (pd.AssemblyFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,22 +251,25 @@ namespace System.Web.Compilation {
|
||||
public Type Type;
|
||||
}
|
||||
|
||||
static void LoadPageData (XmlTextReader reader)
|
||||
static PreCompilationData LoadPageData (XmlTextReader reader, bool store)
|
||||
{
|
||||
PreCompilationData pc_data = new PreCompilationData ();
|
||||
|
||||
while (reader.MoveToNextAttribute ()) {
|
||||
string name = reader.Name;
|
||||
if (name == "virtualPath")
|
||||
pc_data.VirtualPath = reader.Value;
|
||||
pc_data.VirtualPath = VirtualPathUtility.RemoveTrailingSlash (reader.Value);
|
||||
else if (name == "assembly")
|
||||
pc_data.AssemblyFileName = reader.Value;
|
||||
else if (name == "type")
|
||||
pc_data.TypeName = reader.Value;
|
||||
}
|
||||
if (precompiled == null)
|
||||
precompiled = new Dictionary<string, PreCompilationData> (comparer);
|
||||
precompiled.Add (pc_data.VirtualPath, pc_data);
|
||||
if (store) {
|
||||
if (precompiled == null)
|
||||
precompiled = new Dictionary<string, PreCompilationData> (comparer);
|
||||
precompiled.Add (pc_data.VirtualPath, pc_data);
|
||||
}
|
||||
return pc_data;
|
||||
}
|
||||
|
||||
static void AddAssembly (Assembly asm, List <Assembly> al)
|
||||
@@ -720,7 +727,6 @@ namespace System.Web.Compilation {
|
||||
}
|
||||
return pc_data.Type;
|
||||
}
|
||||
//Console.WriteLine ("VPath not precompiled: {0}", virtualPath);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
2009-09-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* BuildManager.cs: load/set the global resources assembly for
|
||||
precompiled and merged sites correctly.
|
||||
|
||||
2009-09-30 Marek Habersack <[email protected]>
|
||||
|
||||
* BuildManager.cs: if precompilation file contains virtual path
|
||||
with trailing slash (e.g. for themes), remove the slash. Fixes bug
|
||||
#541271
|
||||
|
||||
2009-09-28 Marek Habersack <[email protected]>
|
||||
|
||||
* TemplateControlCompiler.cs: ResourceProviderHasObject calls
|
||||
HttpContext.GetResourceProvider with the current file's path, not
|
||||
current request's. Fixes situations when localized control lives
|
||||
in a master page or user control. Fixes bug #542484
|
||||
|
||||
* BaseCompiler.cs: introduced a helper property InputVirtualPath
|
||||
which returns a VirtualPath object for the current control's
|
||||
virtual path.
|
||||
|
||||
2009-09-22 Marek Habersack <[email protected]>
|
||||
|
||||
* TemplateControlCompiler.cs: ResourceProviderHasObject needs to
|
||||
|
||||
@@ -39,6 +39,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Compilation {
|
||||
public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
|
||||
@@ -110,14 +111,14 @@ namespace System.Web.Compilation {
|
||||
if (app_id != null)
|
||||
hashcode ^= Int32.Parse (app_id);
|
||||
|
||||
app_id = hashcode.ToString (CultureInfo.InvariantCulture);
|
||||
app_id = hashcode.ToString (Helpers.InvariantCulture);
|
||||
host = manager.CreateHostWithCheck (app_id, virt_dir, phys_src_dir);
|
||||
cache_path = "";
|
||||
//cache_path = Path.Combine (Path.GetTempPath (),
|
||||
//String.Format ("{0}-temp-aspnet-{1:x}", Environment.UserName, i));
|
||||
|
||||
int hash = virt_dir.GetHashCode () << 5 + phys_src_dir.GetHashCode ();
|
||||
cache_path = Path.Combine (cache_path, hash.ToString (CultureInfo.InvariantCulture));
|
||||
cache_path = Path.Combine (cache_path, hash.ToString (Helpers.InvariantCulture));
|
||||
Directory.CreateDirectory (cache_path);
|
||||
OnAppDomainStarted ();
|
||||
return host;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Compilation
|
||||
{
|
||||
@@ -86,8 +87,8 @@ namespace System.Web.Compilation
|
||||
StringComparer comparer = StringComparer.InvariantCultureIgnoreCase;
|
||||
directivesHash = new Hashtable (comparer);
|
||||
#else
|
||||
CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider (CultureInfo.InvariantCulture);
|
||||
CaseInsensitiveComparer comparer = new CaseInsensitiveComparer (CultureInfo.InvariantCulture);
|
||||
CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider (Helpers.InvariantCulture);
|
||||
CaseInsensitiveComparer comparer = new CaseInsensitiveComparer (Helpers.InvariantCulture);
|
||||
|
||||
directivesHash = new Hashtable (provider, comparer);
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Web.UI;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Compilation
|
||||
{
|
||||
@@ -81,11 +82,11 @@ namespace System.Web.Compilation
|
||||
continue;
|
||||
}
|
||||
|
||||
if (String.Compare (tag.Scope, "session", true, CultureInfo.InvariantCulture) == 0) {
|
||||
if (String.Compare (tag.Scope, "session", true, Helpers.InvariantCulture) == 0) {
|
||||
sessionObjectTags.Add (tag);
|
||||
CreateApplicationOrSessionPropertyForObject (tag.Type, tag.ObjectID,
|
||||
false, false);
|
||||
} else if (String.Compare (tag.Scope, "application", true, CultureInfo.InvariantCulture) == 0) {
|
||||
} else if (String.Compare (tag.Scope, "application", true, Helpers.InvariantCulture) == 0) {
|
||||
applicationObjectTags.Add (tag);
|
||||
CreateFieldForObject (tag.Type, tag.ObjectID);
|
||||
CreateApplicationOrSessionPropertyForObject (tag.Type, tag.ObjectID,
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Web.Util;
|
||||
|
||||
@@ -75,7 +76,7 @@ namespace System.Web.Compilation
|
||||
public void Add (object key, object value)
|
||||
{
|
||||
if (key != null && value != null &&
|
||||
0 == String.Compare ((string) key, "runat", true)) {
|
||||
0 == String.Compare ((string) key, "runat", true, Helpers.InvariantCulture)) {
|
||||
if (0 != String.Compare ((string) value, "server", true))
|
||||
throw new HttpException ("runat attribute must have a 'server' value");
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace System.Web.Compilation
|
||||
{
|
||||
// Hope not to have many attributes when the tag is not a server tag...
|
||||
for (int i = 0; i < keys.Count; i++){
|
||||
if (0 == String.Compare ((string) keys [i], key, true))
|
||||
if (0 == String.Compare ((string) keys [i], key, true, Helpers.InvariantCulture))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
@@ -172,7 +173,7 @@ namespace System.Web.Compilation
|
||||
|
||||
tmp_hash.Clear ();
|
||||
for (int i = keys.Count - 1; i >= 0; i--)
|
||||
if (key == null || String.Compare (key, (string) keys [i], true) == 0)
|
||||
if (key == null || String.Compare (key, (string) keys [i], true, Helpers.InvariantCulture) == 0)
|
||||
tmp_hash [keys [i]] = values [i];
|
||||
|
||||
return tmp_hash;
|
||||
|
||||
@@ -659,13 +659,13 @@ namespace System.Web.Compilation
|
||||
/*
|
||||
static bool InvariantCompare (string a, string b)
|
||||
{
|
||||
return (0 == String.Compare (a, b, false, CultureInfo.InvariantCulture));
|
||||
return (0 == String.Compare (a, b, false, Helpers.InvariantCulture));
|
||||
}
|
||||
*/
|
||||
|
||||
static bool InvariantCompareNoCase (string a, string b)
|
||||
{
|
||||
return (0 == String.Compare (a, b, true, CultureInfo.InvariantCulture));
|
||||
return (0 == String.Compare (a, b, true, Helpers.InvariantCulture));
|
||||
}
|
||||
|
||||
static MemberInfo GetFieldOrProperty (Type type, string name)
|
||||
@@ -855,7 +855,7 @@ namespace System.Web.Compilation
|
||||
|
||||
bool ResourceProviderHasObject (string key)
|
||||
{
|
||||
IResourceProvider rp = HttpContext.GetResourceProvider (key, true);
|
||||
IResourceProvider rp = HttpContext.GetResourceProvider (InputVirtualPath.Absolute, true);
|
||||
if (rp == null)
|
||||
return false;
|
||||
|
||||
@@ -977,7 +977,7 @@ namespace System.Web.Compilation
|
||||
Type type = builder.ControlType;
|
||||
|
||||
string attvalue = builder.GetAttribute (id);
|
||||
if (id.Length > 2 && id.Substring (0, 2).ToUpper () == "ON"){
|
||||
if (id.Length > 2 && String.Compare (id.Substring (0, 2), "ON", true, Helpers.InvariantCulture) == 0){
|
||||
if (ev_info == null)
|
||||
ev_info = type.GetEvents ();
|
||||
|
||||
@@ -997,7 +997,7 @@ namespace System.Web.Compilation
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
if (id.ToLower () == "meta:resourcekey") {
|
||||
if (String.Compare (id, "meta:resourcekey", StringComparison.OrdinalIgnoreCase) == 0) {
|
||||
AssignPropertiesFromResources (builder, attvalue);
|
||||
return;
|
||||
}
|
||||
@@ -1967,7 +1967,7 @@ namespace System.Web.Compilation
|
||||
return CreateNullableExpression (originalType,
|
||||
new CodePrimitiveExpression (
|
||||
Convert.ChangeType (preConverted ? convertedFromAttr : str,
|
||||
type, CultureInfo.InvariantCulture)),
|
||||
type, Helpers.InvariantCulture)),
|
||||
wasNullable);
|
||||
|
||||
if (type == typeof (string [])) {
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Configuration;
|
||||
using System.ComponentModel;
|
||||
using System.Xml;
|
||||
using System.Globalization;
|
||||
using System.Web.Util;
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -223,7 +224,7 @@ namespace System.Web.Configuration {
|
||||
internal bool CheckVerb (string verb)
|
||||
{
|
||||
foreach (string v in Verbs) {
|
||||
if (String.Compare (v, verb, true, CultureInfo.InvariantCulture) == 0)
|
||||
if (String.Compare (v, verb, true, Helpers.InvariantCulture) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -232,7 +233,7 @@ namespace System.Web.Configuration {
|
||||
internal bool CheckUser (string user)
|
||||
{
|
||||
foreach (string u in Users) {
|
||||
if (String.Compare (u, user, true, CultureInfo.InvariantCulture) == 0 ||
|
||||
if (String.Compare (u, user, true, Helpers.InvariantCulture) == 0 ||
|
||||
u == "*" ||
|
||||
(u == "?" && user == ""))
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2009-10-07 Marek Habersack <[email protected]>
|
||||
|
||||
* WebConfigurationManager.cs: GetSection doesn't perform string +
|
||||
char + string concatenation to generate section cache key (by
|
||||
Gonzalo Paniagua Javier) which gives an enormous performance boost
|
||||
(processing time for mojoportal's default.aspx went down from
|
||||
2.65s to 107ms on average). The key generation is performed
|
||||
without any kind of string operation right now (except for
|
||||
GetHashCode on 3 strings).
|
||||
GetSectionCacheKey is called only once and sectionCache became a
|
||||
dictionary.
|
||||
|
||||
2009-08-20 Marek Habersack <[email protected]>
|
||||
|
||||
* WebConfigurationManager.cs: GetSection does not use
|
||||
|
||||
@@ -34,6 +34,7 @@ using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Web.Util;
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -209,7 +210,7 @@ namespace System.Web.Configuration {
|
||||
auto = true;
|
||||
if (culture.Length > 5 && culture[4] == ':')
|
||||
return new CultureInfo (culture.Substring (5));
|
||||
return CultureInfo.InvariantCulture;// (0x007f);
|
||||
return Helpers.InvariantCulture;// (0x007f);
|
||||
}
|
||||
|
||||
return new CultureInfo (culture);
|
||||
@@ -258,7 +259,7 @@ namespace System.Web.Configuration {
|
||||
Encoding encoding = (Encoding)encodingHash [prop];
|
||||
if (encoding == null || encoding.EncodingName != cached_encoding_name) {
|
||||
try {
|
||||
switch (cached_encoding_name.ToLower (CultureInfo.InvariantCulture)) {
|
||||
switch (cached_encoding_name.ToLower (Helpers.InvariantCulture)) {
|
||||
case "utf-16le":
|
||||
case "utf-16":
|
||||
case "ucs-2":
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace System.Web.Configuration {
|
||||
#if !TARGET_J2EE
|
||||
static IInternalConfigConfigurationFactory configFactory;
|
||||
static Hashtable configurations = Hashtable.Synchronized (new Hashtable ());
|
||||
static Hashtable sectionCache = new Hashtable ();
|
||||
static Dictionary <int, object> sectionCache = new Dictionary <int, object> ();
|
||||
static Hashtable configPaths = Hashtable.Synchronized (new Hashtable ());
|
||||
static bool suppressAppReload;
|
||||
#else
|
||||
@@ -109,13 +109,13 @@ namespace System.Web.Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
static Hashtable sectionCache
|
||||
static Dictionary <int, object> sectionCache
|
||||
{
|
||||
get
|
||||
{
|
||||
Hashtable sectionCache = (Hashtable) AppDomain.CurrentDomain.GetData ("sectionCache");
|
||||
Dictionary <int, object> sectionCache = AppDomain.CurrentDomain.GetData ("sectionCache") as Dictionary <int, object>;
|
||||
if (sectionCache == null) {
|
||||
sectionCache = new Hashtable (StringComparer.OrdinalIgnoreCase);
|
||||
sectionCache = new Dictionary <int, object> ();
|
||||
AppDomain.CurrentDomain.SetData ("sectionCache", sectionCache);
|
||||
}
|
||||
return sectionCache;
|
||||
@@ -402,8 +402,9 @@ namespace System.Web.Configuration {
|
||||
if (String.IsNullOrEmpty (config_vdir))
|
||||
config_vdir = "/";
|
||||
|
||||
object cachedSection = sectionCache [GetSectionCacheKey (sectionName, path + '@' + config_vdir)];
|
||||
if (cachedSection != null)
|
||||
int sectionCacheKey = GetSectionCacheKey (sectionName, path, config_vdir);
|
||||
object cachedSection;
|
||||
if (sectionCache.TryGetValue (sectionCacheKey, out cachedSection) && cachedSection != null)
|
||||
return cachedSection;
|
||||
|
||||
HttpRequest req = context != null ? context.Request : null;
|
||||
@@ -426,7 +427,7 @@ namespace System.Web.Configuration {
|
||||
value = collection;
|
||||
}
|
||||
|
||||
AddSectionToCache (GetSectionCacheKey (sectionName, config_vdir), value);
|
||||
AddSectionToCache (sectionCacheKey, value);
|
||||
return value;
|
||||
#else
|
||||
#if MONOWEB_DEP
|
||||
@@ -434,7 +435,7 @@ namespace System.Web.Configuration {
|
||||
#else
|
||||
object value = null;
|
||||
#endif
|
||||
AddSectionToCache (GetSectionCacheKey (sectionName, config_vdir), value);
|
||||
AddSectionToCache (sectionCacheKey, value);
|
||||
return value;
|
||||
#endif
|
||||
}
|
||||
@@ -570,20 +571,24 @@ namespace System.Web.Configuration {
|
||||
|
||||
static void AddSectionToCache (int key, object section)
|
||||
{
|
||||
if (sectionCache [key] != null)
|
||||
object cachedSection;
|
||||
if (sectionCache.TryGetValue (key, out cachedSection) && cachedSection != null)
|
||||
return;
|
||||
|
||||
Hashtable tmpTable = (Hashtable) sectionCache.Clone ();
|
||||
if (tmpTable.Contains (key))
|
||||
// Not sure if it wouldn't be better to just use a lock here
|
||||
var tmpTable = new Dictionary <int, object> (sectionCache);
|
||||
if (tmpTable.ContainsKey (key))
|
||||
return;
|
||||
|
||||
tmpTable.Add (key, section);
|
||||
sectionCache = tmpTable;
|
||||
}
|
||||
|
||||
static int GetSectionCacheKey (string sectionName, string path)
|
||||
static int GetSectionCacheKey (string sectionName, string path, string vdir)
|
||||
{
|
||||
return (sectionName != null ? sectionName.GetHashCode () : 0) ^ ((path != null ? path.GetHashCode () : 0) + 37);
|
||||
return (sectionName != null ? sectionName.GetHashCode () : 0) ^
|
||||
((path != null ? path.GetHashCode () : 0) + 37) ^
|
||||
((vdir != null ? vdir.GetHashCode () : 0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Handlers {
|
||||
#if SYSTEM_WEB_EXTENSIONS
|
||||
@@ -139,7 +140,7 @@ namespace System.Web.Handlers {
|
||||
result = GetHexString (encryptor.TransformFinalBlock (bytes, 0, bytes.Length));
|
||||
bytes = null;
|
||||
|
||||
return String.Concat ("d=", result.ToLower (CultureInfo.InvariantCulture));
|
||||
return String.Concat ("d=", result.ToLower (Helpers.InvariantCulture));
|
||||
}
|
||||
|
||||
static void DecryptAssemblyResource (string val, out string asmName, out string resName)
|
||||
|
||||
@@ -40,6 +40,7 @@ using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web.Security;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.Profile
|
||||
{
|
||||
@@ -487,8 +488,8 @@ namespace System.Web.Profile
|
||||
if (pp == null)
|
||||
continue;
|
||||
|
||||
int pos = Int32.Parse (names [i + 2], CultureInfo.InvariantCulture);
|
||||
int len = Int32.Parse (names [i + 3], CultureInfo.InvariantCulture);
|
||||
int pos = Int32.Parse (names [i + 2], Helpers.InvariantCulture);
|
||||
int len = Int32.Parse (names [i + 3], Helpers.InvariantCulture);
|
||||
|
||||
if (len == -1 && !pp.Property.PropertyType.IsValueType) {
|
||||
pp.PropertyValue = null;
|
||||
@@ -544,7 +545,7 @@ namespace System.Web.Profile
|
||||
}
|
||||
}
|
||||
|
||||
names.Append (pp.Name + ":" + ((propValue != null) ? "S" : "B") + ":" + pos.ToString (CultureInfo.InvariantCulture) + ":" + len.ToString (CultureInfo.InvariantCulture) + ":");
|
||||
names.Append (pp.Name + ":" + ((propValue != null) ? "S" : "B") + ":" + pos.ToString (Helpers.InvariantCulture) + ":" + len.ToString (Helpers.InvariantCulture) + ":");
|
||||
|
||||
if (propValue != null)
|
||||
values.Append (propValue);
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace System.Web.Security
|
||||
if (context == null)
|
||||
throw new HttpException ("Context is null!");
|
||||
|
||||
name = name.ToLower ();
|
||||
name = name.ToLower (Helpers.InvariantCulture);
|
||||
#if NET_2_0
|
||||
AuthenticationSection section = (AuthenticationSection) WebConfigurationManager.GetSection (authConfigPath);
|
||||
FormsAuthenticationCredentials config = section.Forms.Credentials;
|
||||
@@ -496,9 +496,9 @@ namespace System.Web.Security
|
||||
throw new ArgumentNullException ("passwordFormat");
|
||||
|
||||
byte [] bytes;
|
||||
if (String.Compare (passwordFormat, "MD5", true, CultureInfo.InvariantCulture) == 0) {
|
||||
if (String.Compare (passwordFormat, "MD5", true, Helpers.InvariantCulture) == 0) {
|
||||
bytes = MD5.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
|
||||
} else if (String.Compare (passwordFormat, "SHA1", true, CultureInfo.InvariantCulture) == 0) {
|
||||
} else if (String.Compare (passwordFormat, "SHA1", true, Helpers.InvariantCulture) == 0) {
|
||||
bytes = SHA1.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
|
||||
} else {
|
||||
throw new ArgumentException ("The format must be either MD5 or SHA1", "passwordFormat");
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace System.Web.Security
|
||||
loginPath = context.Request.MapPath (loginPage);
|
||||
} catch {} // ignore
|
||||
|
||||
context.SkipAuthorization = String.Compare (reqPath, loginPath, HttpRuntime.CaseInsensitive, CultureInfo.InvariantCulture) == 0;
|
||||
context.SkipAuthorization = String.Compare (reqPath, loginPath, HttpRuntime.CaseInsensitive, Helpers.InvariantCulture) == 0;
|
||||
|
||||
#if NET_2_0
|
||||
//TODO: need to check that the handler is System.Web.Handlers.AssemblyResourceLoader type
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2009-09-30 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* HtmlSelectBuilder.cs: <option> allows the value of the 'selected'
|
||||
attribute to be a boolean or the string "selected", which is treated
|
||||
as "true".
|
||||
|
||||
2009-06-16 Marek Habersack <[email protected]>
|
||||
|
||||
* HtmlHeadBuilder.cs: use faster String.Compare overloads.
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Security.Permissions;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.UI.HtmlControls
|
||||
{
|
||||
@@ -110,7 +111,7 @@ namespace System.Web.UI.HtmlControls
|
||||
if (border == null) {
|
||||
return (-1);
|
||||
} else {
|
||||
return (Int32.Parse (border, CultureInfo.InvariantCulture));
|
||||
return (Int32.Parse (border, Helpers.InvariantCulture));
|
||||
}
|
||||
}
|
||||
set {
|
||||
@@ -134,7 +135,7 @@ namespace System.Web.UI.HtmlControls
|
||||
if (height == null) {
|
||||
return (-1);
|
||||
} else {
|
||||
return (Int32.Parse (height, CultureInfo.InvariantCulture));
|
||||
return (Int32.Parse (height, Helpers.InvariantCulture));
|
||||
}
|
||||
}
|
||||
set {
|
||||
@@ -186,7 +187,7 @@ namespace System.Web.UI.HtmlControls
|
||||
return (-1);
|
||||
}
|
||||
else {
|
||||
return (Int32.Parse (width, CultureInfo.InvariantCulture));
|
||||
return (Int32.Parse (width, Helpers.InvariantCulture));
|
||||
}
|
||||
}
|
||||
set {
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Security.Permissions;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.UI.HtmlControls {
|
||||
|
||||
@@ -109,7 +110,7 @@ namespace System.Web.UI.HtmlControls {
|
||||
#endif
|
||||
}
|
||||
|
||||
if (String.Compare (Type, "reset", true, CultureInfo.InvariantCulture) != 0)
|
||||
if (String.Compare (Type, "reset", true, Helpers.InvariantCulture) != 0)
|
||||
OnServerClick (EventArgs.Empty);
|
||||
else
|
||||
ResetForm (FindForm ());
|
||||
@@ -254,7 +255,7 @@ namespace System.Web.UI.HtmlControls {
|
||||
if (Page == null || !CausesValidation)
|
||||
return false;
|
||||
|
||||
CultureInfo inv = CultureInfo.InvariantCulture;
|
||||
CultureInfo inv = Helpers.InvariantCulture;
|
||||
string input_type = Type;
|
||||
if (0 == String.Compare (input_type, "submit", true, inv) &&
|
||||
Page.Validators.Count > 0)
|
||||
@@ -271,7 +272,7 @@ namespace System.Web.UI.HtmlControls {
|
||||
protected override void RenderAttributes (HtmlTextWriter writer)
|
||||
{
|
||||
#if NET_2_0
|
||||
CultureInfo inv = CultureInfo.InvariantCulture;
|
||||
CultureInfo inv = Helpers.InvariantCulture;
|
||||
string input_type = Type;
|
||||
if (0 != String.Compare (input_type, "reset", true, inv) &&
|
||||
((0 == String.Compare (input_type, "submit", true, inv)) ||
|
||||
@@ -327,7 +328,7 @@ namespace System.Web.UI.HtmlControls {
|
||||
options.ActionUrl = null;
|
||||
options.Argument = String.Empty;
|
||||
options.RequiresJavaScriptProtocol = false;
|
||||
options.ClientSubmit = (0 != String.Compare (Type, "submit", true, CultureInfo.InvariantCulture));
|
||||
options.ClientSubmit = (0 != String.Compare (Type, "submit", true, Helpers.InvariantCulture));
|
||||
options.PerformValidation = CausesValidation && Page != null && Page.Validators.Count > 0;
|
||||
if (options.PerformValidation)
|
||||
options.ValidationGroup = ValidationGroup;
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Globalization;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Security.Permissions;
|
||||
using System.Web.Util;
|
||||
|
||||
namespace System.Web.UI.HtmlControls {
|
||||
|
||||
@@ -120,14 +121,14 @@ namespace System.Web.UI.HtmlControls {
|
||||
string border = Attributes ["border"];
|
||||
if (border == null)
|
||||
return -1;
|
||||
return Int32.Parse (border, CultureInfo.InvariantCulture);
|
||||
return Int32.Parse (border, Helpers.InvariantCulture);
|
||||
}
|
||||
set {
|
||||
if (value == -1) {
|
||||
Attributes.Remove ("border");
|
||||
return;
|
||||
}
|
||||
Attributes ["border"] = value.ToString (CultureInfo.InvariantCulture);
|
||||
Attributes ["border"] = value.ToString (Helpers.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,8 +139,8 @@ namespace System.Web.UI.HtmlControls {
|
||||
|
||||
if (x != null && x.Length != 0 &&
|
||||
y != null && y.Length != 0) {
|
||||
clicked_x = Int32.Parse (x, CultureInfo.InvariantCulture);
|
||||
clicked_y = Int32.Parse (y, CultureInfo.InvariantCulture);
|
||||
clicked_x = Int32.Parse (x, Helpers.InvariantCulture);
|
||||
clicked_y = Int32.Parse (y, Helpers.InvariantCulture);
|
||||
Page.RegisterRequiresRaiseEvent (this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace System.Web.UI.HtmlControls {
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO ("why our own version?")]
|
||||
void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
|
||||
{
|
||||
base.RaisePostBackEvent (eventArgument);
|
||||
|
||||
Loaded 100 of 255 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user