Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / SchemaDeclBase.cs / 1305376 / SchemaDeclBase.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System.Collections.Generic; using System.Diagnostics; internal abstract class SchemaDeclBase { internal enum Use { Default, Required, Implied, Fixed, RequiredFixed }; protected XmlQualifiedName name = XmlQualifiedName.Empty; protected string prefix; protected bool isDeclaredInExternal = false; protected Use presence; // the presence, such as fixed, implied, etc #if !SILVERLIGHT protected XmlSchemaType schemaType; protected XmlSchemaDatatype datatype; protected string defaultValueRaw; // default value in its original form protected object defaultValueTyped; protected long maxLength; // dt:maxLength protected long minLength; // dt:minLength protected Listvalues; // array of values for enumerated and notation types #endif protected SchemaDeclBase(XmlQualifiedName name, string prefix) { this.name = name; this.prefix = prefix; #if !SILVERLIGHT maxLength = -1; minLength = -1; #endif } #if !SILVERLIGHT protected SchemaDeclBase() { } #endif internal XmlQualifiedName Name { get { return name;} set { name = value;} } internal string Prefix { get { return(prefix == null) ? string.Empty : prefix;} set { prefix = value;} } internal bool IsDeclaredInExternal { get { return isDeclaredInExternal;} set { isDeclaredInExternal = value;} } internal Use Presence { get { return presence; } set { presence = value; } } #if !SILVERLIGHT internal long MaxLength { get { return maxLength;} set { maxLength = value;} } internal long MinLength { get { return minLength;} set { minLength = value;} } internal XmlSchemaType SchemaType { get { return schemaType;} set { schemaType = value;} } internal XmlSchemaDatatype Datatype { get { return datatype;} set { datatype = value;} } internal void AddValue(string value) { if (values == null) { values = new List (); } values.Add(value); } internal List Values { get { return values; } set { values = value; } } internal string DefaultValueRaw { get { return(defaultValueRaw != null) ? defaultValueRaw : string.Empty;} set { defaultValueRaw = value;} } internal object DefaultValueTyped { get { return defaultValueTyped;} set { defaultValueTyped = value;} } internal bool CheckEnumeration(object pVal) { return (datatype.TokenizedType != XmlTokenizedType.NOTATION && datatype.TokenizedType != XmlTokenizedType.ENUMERATION) || values.Contains(pVal.ToString()); } internal bool CheckValue(Object pVal) { return (presence != Use.Fixed && presence != Use.RequiredFixed) || (defaultValueTyped != null && datatype.IsEqual(pVal, defaultValueTyped)); } #endif }; } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PlanCompilerUtil.cs
- LineBreak.cs
- DataBoundLiteralControl.cs
- ItemCollection.cs
- X509ThumbprintKeyIdentifierClause.cs
- EventMappingSettings.cs
- ProbeMatchesApril2005.cs
- GroupBoxRenderer.cs
- _NegoStream.cs
- SchemaNamespaceManager.cs
- DrawingGroup.cs
- MemberPath.cs
- CapiNative.cs
- AmbientProperties.cs
- TextHidden.cs
- Clipboard.cs
- ReverseComparer.cs
- FlowThrottle.cs
- FileAuthorizationModule.cs
- StatusBar.cs
- SiteMapDataSourceView.cs
- QuadraticEase.cs
- IIS7WorkerRequest.cs
- XmlDataImplementation.cs
- PropertyMapper.cs
- VirtualPathUtility.cs
- SystemNetworkInterface.cs
- MailFileEditor.cs
- MenuScrollingVisibilityConverter.cs
- PresentationAppDomainManager.cs
- XmlTextEncoder.cs
- DockingAttribute.cs
- TransformationRules.cs
- SqlDeflator.cs
- AsyncDataRequest.cs
- DeleteHelper.cs
- HandleCollector.cs
- ByteStreamGeometryContext.cs
- HtmlInputReset.cs
- LinkedResource.cs
- DBSchemaTable.cs
- XmlText.cs
- ToolStripManager.cs
- TableLayoutStyle.cs
- GeometryHitTestResult.cs
- AndMessageFilter.cs
- RoleManagerSection.cs
- SmtpNtlmAuthenticationModule.cs
- QilReference.cs
- WebPartConnectionsDisconnectVerb.cs
- ReliableInputConnection.cs
- LookupBindingPropertiesAttribute.cs
- RequestCachePolicy.cs
- ResourceExpressionBuilder.cs
- LinkedDataMemberFieldEditor.cs
- MediaCommands.cs
- SQLDoubleStorage.cs
- TypefaceCollection.cs
- RoleService.cs
- NavigatingCancelEventArgs.cs
- SafeSecurityHandles.cs
- DataStreamFromComStream.cs
- MetadataItemEmitter.cs
- WMIInterop.cs
- AudioLevelUpdatedEventArgs.cs
- UmAlQuraCalendar.cs
- PopOutPanel.cs
- WpfPayload.cs
- LocationFactory.cs
- NumericPagerField.cs
- VScrollProperties.cs
- CqlParserHelpers.cs
- TableSectionStyle.cs
- ProvidePropertyAttribute.cs
- FilterRepeater.cs
- XmlExtensionFunction.cs
- ConditionCollection.cs
- ModifierKeysConverter.cs
- XmlQueryCardinality.cs
- DataGridViewCellValueEventArgs.cs
- JsonServiceDocumentSerializer.cs
- BasicExpressionVisitor.cs
- CacheModeConverter.cs
- WebConfigurationFileMap.cs
- Itemizer.cs
- PaperSource.cs
- ConfigurationManagerHelperFactory.cs
- TypeInfo.cs
- AutoResizedEvent.cs
- UpdatePanelTriggerCollection.cs
- XPathDocument.cs
- UserControlBuildProvider.cs
- EntityDataSourceChangingEventArgs.cs
- ByteStorage.cs
- GAC.cs
- ToolStripContainer.cs
- EventData.cs
- ComponentEditorForm.cs
- Geometry.cs
- PrintControllerWithStatusDialog.cs