Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / schema / SchemaAttDef.cs / 1 / SchemaAttDef.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Schema {
using System.Diagnostics;
/*
* This class describes an attribute type and potential values.
* This encapsulates the information for one Attdef * in an
* Attlist in a DTD as described below:
*/
internal sealed class SchemaAttDef : SchemaDeclBase {
public enum Reserve {
None,
XmlSpace,
XmlLang
};
private Reserve reserved; // indicate the attribute type, such as xml:lang or xml:space
private String defExpanded; // default value in its expanded form
private bool hasEntityRef; // whether there is any entity reference in the default value
XmlSchemaAttribute schemaAttribute;
private bool defaultValueChecked;
int lineNum;
int linePos;
int valueLineNum;
int valueLinePos;
public static readonly SchemaAttDef Empty = new SchemaAttDef();
public SchemaAttDef(XmlQualifiedName name, String prefix) : base(name, prefix) {
reserved = Reserve.None;
}
private SchemaAttDef() {}
public SchemaAttDef Clone() {
return (SchemaAttDef) MemberwiseClone();
}
internal int LinePos {
get {
return linePos;
}
set {
linePos = value;
}
}
internal int LineNum {
get {
return lineNum;
}
set {
lineNum = value;
}
}
internal int ValueLinePos {
get {
return valueLinePos;
}
set {
valueLinePos = value;
}
}
internal int ValueLineNum {
get {
return valueLineNum;
}
set {
valueLineNum = value;
}
}
internal bool DefaultValueChecked {
get {
return defaultValueChecked;
}
}
public String DefaultValueExpanded {
get { return(defExpanded != null) ? defExpanded : String.Empty;}
set { defExpanded = value;}
}
public Reserve Reserved {
get { return reserved;}
set { reserved = value;}
}
public bool HasEntityRef {
get { return hasEntityRef;}
set { hasEntityRef = value;}
}
public XmlSchemaAttribute SchemaAttribute {
get { return schemaAttribute; }
set { schemaAttribute = value; }
}
public void CheckXmlSpace(ValidationEventHandler eventhandler) {
if (datatype.TokenizedType == XmlTokenizedType.ENUMERATION &&
(values != null) &&
(values.Count <= 2)) {
String s1 = values[0].ToString();
if (values.Count == 2) {
String s2 = values[1].ToString();
if ((s1 == "default" || s2 == "default") &&
(s1 == "preserve" || s2 == "preserve")) {
return;
}
}
else {
if (s1 == "default" || s1 == "preserve") {
return;
}
}
}
eventhandler(this, new ValidationEventArgs(new XmlSchemaException(Res.Sch_XmlSpace, string.Empty)));
}
internal void CheckDefaultValue( SchemaInfo schemaInfo, IDtdParserAdapter readerAdapter ) {
DtdValidator.CheckDefaultValue( this, schemaInfo, readerAdapter );
defaultValueChecked = true;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BindingValueChangedEventArgs.cs
- HtmlHead.cs
- ChildTable.cs
- WindowsListViewScroll.cs
- BitmapMetadataBlob.cs
- InfoCardSymmetricCrypto.cs
- XmlDataSource.cs
- Adorner.cs
- StringArrayConverter.cs
- AudioSignalProblemOccurredEventArgs.cs
- RSAPKCS1SignatureDeformatter.cs
- Graphics.cs
- TemplatePagerField.cs
- QueuePathEditor.cs
- ApplicationSecurityManager.cs
- WebPartEditorOkVerb.cs
- HScrollProperties.cs
- DrawingServices.cs
- RuleInfoComparer.cs
- UIElementIsland.cs
- DefaultTraceListener.cs
- SqlErrorCollection.cs
- ConfigXmlElement.cs
- ConstNode.cs
- PerformanceCounterCategory.cs
- dbdatarecord.cs
- ObjectStorage.cs
- RadialGradientBrush.cs
- LocatorPart.cs
- HttpException.cs
- ServiceContractGenerationContext.cs
- TreeNodeCollection.cs
- HttpFileCollection.cs
- XNameConverter.cs
- TreeNodeCollection.cs
- XPathParser.cs
- ObjectDataSourceSelectingEventArgs.cs
- LinqDataSourceView.cs
- FormsAuthenticationEventArgs.cs
- MergePropertyDescriptor.cs
- SecurityTokenResolver.cs
- TaskFileService.cs
- CancelEventArgs.cs
- AuthorizationRuleCollection.cs
- SmiRequestExecutor.cs
- ClipboardProcessor.cs
- ProfileInfo.cs
- Models.cs
- ThreadStartException.cs
- AttachmentService.cs
- HMACSHA384.cs
- Simplifier.cs
- DebugInfoExpression.cs
- SmtpDigestAuthenticationModule.cs
- HtmlInputControl.cs
- elementinformation.cs
- DescendantBaseQuery.cs
- ValidationSummary.cs
- PersonalizationProviderCollection.cs
- OleDbErrorCollection.cs
- ListItemConverter.cs
- ResourceReferenceExpression.cs
- Control.cs
- SuppressIldasmAttribute.cs
- Point3D.cs
- ClientTargetSection.cs
- OleDbCommandBuilder.cs
- GetPageCompletedEventArgs.cs
- ClientFormsAuthenticationCredentials.cs
- HostingEnvironmentException.cs
- ChtmlPageAdapter.cs
- ExtractCollection.cs
- DbgCompiler.cs
- WebPartConnectionsCancelVerb.cs
- RotateTransform3D.cs
- Quaternion.cs
- SQLDoubleStorage.cs
- ManifestResourceInfo.cs
- AssemblyBuilder.cs
- IndependentlyAnimatedPropertyMetadata.cs
- RegexCaptureCollection.cs
- EntityContainerRelationshipSetEnd.cs
- NamespaceQuery.cs
- QueryStack.cs
- WorkflowClientDeliverMessageWrapper.cs
- TableItemPatternIdentifiers.cs
- GifBitmapEncoder.cs
- PeerTransportCredentialType.cs
- FunctionDescription.cs
- Regex.cs
- WindowsFormsEditorServiceHelper.cs
- WebPartMenu.cs
- DbResourceAllocator.cs
- SqlParameterCollection.cs
- TextEditorTyping.cs
- AssociationSetEnd.cs
- HandlerFactoryWrapper.cs
- ToolStripItemCollection.cs
- TypeUtil.cs
- ActiveDocumentEvent.cs