XmlSchemaObject.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Author: Dwivedi, Ajay kumar
  2. // [email protected]
  3. using System;
  4. using System.Collections;
  5. using System.Xml.Serialization;
  6. using System.Xml;
  7. namespace System.Xml.Schema
  8. {
  9. /// <summary>
  10. /// Summary description for XmlSchemaObject.
  11. /// </summary>
  12. public abstract class XmlSchemaObject
  13. {
  14. private int lineNumber;
  15. private int linePosition;
  16. private string sourceUri;
  17. private XmlSerializerNamespaces namespaces;
  18. internal ArrayList unhandledAttributeList ;
  19. internal bool isCompiled = false;
  20. internal int errorCount = 0;
  21. internal Guid CompilationId;
  22. protected XmlSchemaObject()
  23. {
  24. namespaces = new XmlSerializerNamespaces();
  25. unhandledAttributeList = null;
  26. }
  27. [XmlIgnore]
  28. public int LineNumber
  29. {
  30. get{ return lineNumber; }
  31. set{ lineNumber = value; }
  32. }
  33. [XmlIgnore]
  34. public int LinePosition
  35. {
  36. get{ return linePosition; }
  37. set{ linePosition = value; }
  38. }
  39. [XmlIgnore]
  40. public string SourceUri
  41. {
  42. get{ return sourceUri; }
  43. set{ sourceUri = value; }
  44. }
  45. // Undocumented Property
  46. [XmlNamespaceDeclarations]
  47. public XmlSerializerNamespaces Namespaces
  48. {
  49. get{ return namespaces; }
  50. set{ namespaces = value; }
  51. }
  52. internal void error(ValidationEventHandler handle,string message)
  53. {
  54. errorCount++;
  55. ValidationHandler.RaiseValidationError(handle,this,message);
  56. }
  57. internal void warn(ValidationEventHandler handle,string message)
  58. {
  59. errorCount++;
  60. ValidationHandler.RaiseValidationWarning(handle,this,message);
  61. }
  62. internal static void error(ValidationEventHandler handle, string message, Exception innerException)
  63. {
  64. ValidationHandler.RaiseValidationError(handle,message, innerException);
  65. }
  66. internal static void warn(ValidationEventHandler handle, string message, Exception innerException)
  67. {
  68. ValidationHandler.RaiseValidationWarning(handle,message, innerException);
  69. }
  70. internal bool IsComplied (Guid CompilationId)
  71. {
  72. return this.CompilationId == CompilationId;
  73. }
  74. }
  75. }