-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2002-07-24 Tim Coleman <tim@timcoleman.com>
* CodeIdentifier.cs: * IXmlSerializable.cs: * XmlSerializationCollectionFixupCallback.cs: * XmlSerializationFixupCallback.cs: * XmlSerializationReadCallback.cs: * XmlSerializationReader.cs: * XmlSerializationWriteCallback.cs: Add new classes. * XmlSchemas.cs * CodeIdentifiers.cs: Implement some of these classes * XmlCodeExporter.cs: Fix return type of a function svn path=/trunk/mcs/; revision=6157
- Loading branch information
Tim Coleman
committed
Jul 24, 2002
1 parent
e1acf0f
commit 52a614c
Showing
11 changed files
with
639 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// System.Xml.Serialization.CodeIdentifier.cs | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) Tim Coleman, 2002 | ||
// | ||
|
||
using System; | ||
|
||
namespace System.Xml.Serialization { | ||
public class CodeIdentifier { | ||
|
||
public CodeIdentifier () | ||
{ | ||
} | ||
|
||
public static string MakeCamel (string identifier) | ||
{ | ||
string validIdentifier = MakeValid (identifier); | ||
return (Char.ToLower (validIdentifier[0]) + validIdentifier.Substring (1)); | ||
} | ||
|
||
public static string MakePascal (string identifier) | ||
{ | ||
string validIdentifier = MakeValid (identifier); | ||
return (Char.ToUpper (validIdentifier[0]) + validIdentifier.Substring (1)); | ||
} | ||
|
||
public static string MakeValid (string identifier) | ||
{ | ||
if (identifier == null) | ||
throw new NullReferenceException (); | ||
if (identifier.Length == 0) | ||
return identifier; | ||
|
||
string output; | ||
|
||
if (Char.IsNumber (identifier[0])) | ||
output = "Item"; | ||
|
||
foreach (char c in identifier) | ||
if (Char.IsLetterOrDigit (c) || c == '_') | ||
output += c; | ||
|
||
return output; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
mcs/class/System.XML/System.Xml.Serialization/IXmlSerializable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// System.Xml.Serialization.IXmlSerializable.cs | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) Tim Coleman, 2002 | ||
// | ||
|
||
using System.Xml.Schema; | ||
|
||
namespace System.Xml.Serialization { | ||
public interface IXmlSerializable { | ||
|
||
XmlSchema GetSchema (); | ||
void ReadXml (XmlReader reader); | ||
void WriteXml (XmlWriter writer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationCollectionFixupCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// System.Xml.Serialization.XmlSerializationCollectionFixupCallback.cs: | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) Tim Coleman, 2002 | ||
// | ||
|
||
using System; | ||
|
||
namespace System.Xml.Serialization { | ||
|
||
[Serializable] | ||
public delegate void XmlSerializationCollectionFixupCallback (object collection, object collectionItems); | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationFixupCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// System.Xml.Serialization.XmlSerializationFixupCallback.cs: | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) Tim Coleman, 2002 | ||
// | ||
|
||
using System; | ||
|
||
namespace System.Xml.Serialization { | ||
|
||
[Serializable] | ||
public delegate void XmlSerializationFixupCallback (object fixup); | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReadCallback.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// System.Xml.Serialization.XmlSerializationReadCallback.cs: | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) Tim Coleman, 2002 | ||
// | ||
|
||
using System; | ||
|
||
namespace System.Xml.Serialization { | ||
|
||
[Serializable] | ||
public delegate object XmlSerializationReadCallback (); | ||
} | ||
|
Oops, something went wrong.