Author: miguel
Date: 2007-06-01 01:10:24 -0400 (Fri, 01 Jun 2007)
New Revision: 78396
Added:
trunk/olive/AUTHORS
Modified:
trunk/olive/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs
trunk/olive/class/PresentationFramework/System.Windows.Serialization/Exceptions.cs
trunk/olive/class/agclr/System.Windows.Markup/XamlParseException.cs
Log:
Add Authors file
Added: trunk/olive/AUTHORS
===================================================================
--- trunk/olive/AUTHORS 2007-06-01 05:08:17 UTC (rev 78395)
+++ trunk/olive/AUTHORS 2007-06-01 05:10:24 UTC (rev 78396)
@@ -0,0 +1,29 @@
+Atsushi Enomoto ([EMAIL PROTECTED])
+ Communications Foundation
+ ServiceModel
+ IdentityModel/
+ IdentityModel.Selectors
+ Runtime.Serialization/
+
+ System.Xml.Xlinq
+
+Chris Toshok ([EMAIL PROTECTED])
+ PresentationCore
+
+Ian McCoy ([EMAIL PROTECTED])
+ XAML Parser in
+
+Antonello Provenzano <[EMAIL PROTECTED]
+ System.Data.Linq
+
+Ankit Jain
+ System.Runtime.Serialization
+
+Jordi Mas
+ Workflow Foundation
+
+Joel Reed ([EMAIL PROTECTED])
+ System.Syndication
+
+Stephen A Jazdzewski ([EMAIL PROTECTED])
+ System.Syndmication
Modified:
trunk/olive/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs
===================================================================
---
trunk/olive/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs
2007-06-01 05:08:17 UTC (rev 78395)
+++
trunk/olive/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs
2007-06-01 05:10:24 UTC (rev 78396)
@@ -106,7 +106,8 @@
while (reader.Read()) {
Debug.WriteLine("XamlParser: NOW PARSING: " +
reader.NodeType + "; " + reader.Name + "; " + reader.Value);
if (goneTooFar())
- throw new XamlParseException("Too far:
" + reader.NodeType + ", " + reader.Name);
+ throw new
XamlParseException(reader.LineNumber, reader.LinePosition,
+ "Too far:
" + reader.NodeType + ", " + reader.Name);
if (currentState() != null &&
currentState().type == CurrentType.Code)
{
processElementInCodeState();
@@ -130,7 +131,7 @@
// skip whitespace and comments
break;
default:
- throw new XamlParseException("Unknown
element type " + reader.NodeType);
+ throw new
XamlParseException(reader.LineNumber, reader.LinePosition, "Unknown element
type " + reader.NodeType);
}
if (nodeQueue.Count != 0) {
XamlNode x = (XamlNode)nodeQueue[0];
@@ -147,7 +148,7 @@
reader.NamespaceURI == XAML_NAMESPACE) {
parseEndElement();
} else if (reader.NodeType != XmlNodeType.CDATA &&
reader.NodeType != XmlNodeType.Text) {
- throw new XamlParseException("Code element
children must be either text or CDATA nodes.");
+ throw new XamlParseException(reader.LineNumber,
reader.LinePosition, "Code element children must be either text or CDATA
nodes.");
} else {
currentState().obj = (string)currentState().obj
+ reader.Value;
}
@@ -167,14 +168,15 @@
void parsePI()
{
if (reader.Name != "Mapping")
- throw new XamlParseException("Unknown
processing instruction.");
+ throw new XamlParseException(reader.LineNumber,
reader.LinePosition,
+ "Unknown
processing instruction.");
mapper.AddMappingProcessingInstruction(reader.Value);
}
void parseElement()
{
if (reader.NamespaceURI == "")
- throw new XamlParseException("No xml namespace
specified.");
+ throw new XamlParseException(reader.LineNumber,
reader.LinePosition, "No xml namespace specified.");
if (reader.LocalName == "Code" && reader.NamespaceURI
== XAML_NAMESPACE) {
parseCodeElement();
return;
@@ -260,10 +262,10 @@
void abortIfNotAddChild(string thing)
{
if (!isAddChild((Type)currentState().obj))
- throw new XamlParseException("Cannot add " +
thing +
- " to instance of '" +
- ((Type)currentState().obj) +
- "'.");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ String.Format ("Cannot add {0} to
instance of {1}.", thing,
+
((Type)currentState().obj)));
}
void parseNormalPropertyElement(string propertyName)
@@ -273,7 +275,9 @@
PropertyInfo prop =
currentType.GetProperty(propertyName);
if (prop == null) {
- throw new XamlParseException("Property '" +
propertyName + "' not found on '" + currentType.Name + "'.");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "Property '" + propertyName + "' not
found on '" + currentType.Name + "'.");
}
@@ -294,7 +298,8 @@
push(CurrentType.Property, prop);
if (reader.HasAttributes) {
- throw new XamlParseException("Property node
should not have attributes.");
+ throw new XamlParseException(reader.LineNumber,
reader.LinePosition,
+ "Property node
should not have attributes.");
}
}
@@ -336,7 +341,8 @@
parent = mapper.GetType(reader.NamespaceURI,
reader.Name);
if (parent == null)
- throw new XamlParseException("Class '" +
reader.Name + "' not found.");
+ throw new XamlParseException(reader.LineNumber,
reader.LinePosition,
+ "Class '" +
reader.Name + "' not found.");
// whichever of these functions runs will push something
if (currentState() == null) {
@@ -356,10 +362,14 @@
void parseTopLevelObjectElement(Type parent)
{
if (reader.GetAttribute("Name", XAML_NAMESPACE) != null)
- throw new XamlParseException("The XAML Name
attribute can not be applied to top level elements\n"+
- "Do you mean the Class
attribute?");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "The XAML Name attribute can not be
applied to top level elements\n"+
+ "Do you mean the Class attribute?");
if (reader.GetAttribute("Key", XAML_NAMESPACE) != null)
- throw new XamlParseException("The XAML Key
attribute can not be applied to top level elements.");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "The XAML Key attribute can not be
applied to top level elements.");
begun = true;
createTopLevel(parent.AssemblyQualifiedName,
reader.GetAttribute("Class", XAML_NAMESPACE));
}
@@ -367,8 +377,10 @@
void parseChildObjectElement(Type parent)
{
if (reader.GetAttribute("Class", XAML_NAMESPACE) !=
null)
- throw new XamlParseException("The XAML Class
attribute can not be applied to child elements\n"+
- "Do you mean the Name
attribute?");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "The XAML Class attribute can not be
applied to child elements\n"+
+ "Do you mean the Name attribute?");
string name = reader.GetAttribute("Name",
XAML_NAMESPACE);
if (name == null)
name = reader.GetAttribute("Name",
reader.NamespaceURI);
@@ -531,7 +543,9 @@
if (parsedAsEventProperty(currentType, propertyName))
return;
if (prop == null)
- throw new XamlParseException ("Property '" +
propertyName + "' not found on '" + currentType.Name + "'.");
+ throw new XamlParseException (
+ reader.LineNumber, reader.LinePosition,
+ "Property '" + propertyName + "' not
found on '" + currentType.Name + "'.");
nodeQueue.Add(new XamlPropertyNode(
reader.LineNumber,
reader.LinePosition,
@@ -602,8 +616,10 @@
void ensureDependencyObject(Type currentType)
{
if
(!currentType.IsSubclassOf(typeof(System.Windows.DependencyObject)))
- throw new
XamlParseException("Dependency properties can only be set on "+
- "DependencyObjects (not
" + currentType.Name + ")");
+ throw new XamlParseException(
+ reader.LineNumber,
reader.LinePosition,
+ "Dependency properties can only
be set on "+
+ "DependencyObjects (not " +
currentType.Name + ")");
}
Type findTypeToAttachTo(string attachedTo, string propertyName)
{
@@ -618,7 +634,9 @@
}
}
if (typeAttachedTo == null)
- throw new XamlParseException("Nothing to attach
to: " + attachedTo + "." + propertyName);
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "Nothing to attach to: " + attachedTo +
"." + propertyName);
return typeAttachedTo;
}
@@ -626,7 +644,9 @@
{
FieldInfo propField =
typeAttachedTo.GetField(propertyName + "Property");
if (propField == null)
- throw new XamlParseException("Property '" +
propertyName + "' does not exist on '" + typeAttachedTo.Name + "'.");
+ throw new XamlParseException(
+ reader.LineNumber, reader.LinePosition,
+ "Property '" + propertyName + "' does
not exist on '" + typeAttachedTo.Name + "'.");
return (DependencyProperty)propField.GetValue(null);
}
Modified:
trunk/olive/class/PresentationFramework/System.Windows.Serialization/Exceptions.cs
===================================================================
---
trunk/olive/class/PresentationFramework/System.Windows.Serialization/Exceptions.cs
2007-06-01 05:08:17 UTC (rev 78395)
+++
trunk/olive/class/PresentationFramework/System.Windows.Serialization/Exceptions.cs
2007-06-01 05:10:24 UTC (rev 78396)
@@ -3,5 +3,10 @@
public XamlParseException(string message) : base(message)
{
}
+
+ public XamlParseException(int line, int pos, string message)
+ : base(String.Format ("({0},{1}):{2}", line, pos,
message))
+ {
+ }
}
}
Modified: trunk/olive/class/agclr/System.Windows.Markup/XamlParseException.cs
===================================================================
--- trunk/olive/class/agclr/System.Windows.Markup/XamlParseException.cs
2007-06-01 05:08:17 UTC (rev 78395)
+++ trunk/olive/class/agclr/System.Windows.Markup/XamlParseException.cs
2007-06-01 05:10:24 UTC (rev 78396)
@@ -48,6 +48,13 @@
this.line = line;
this.col = col;
}
+
+ internal XamlParseException (int line, int col, string msg)
+ : base (String.Format ("({0},{1}): {2}", line, col,
msg))
+ {
+ this.line = (uint) line;
+ this.col = (uint) col;
+ }
public uint LineNumber {
get { return line; }
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches