Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / schema / CompiledIdentityConstraint.cs / 1305376 / CompiledIdentityConstraint.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System.Text; using System.Collections; using System.Diagnostics; using System.Xml.XPath; using MS.Internal.Xml.XPath; internal class CompiledIdentityConstraint { internal XmlQualifiedName name = XmlQualifiedName.Empty; private ConstraintRole role; private Asttree selector; private Asttree[] fields; internal XmlQualifiedName refer = XmlQualifiedName.Empty; public enum ConstraintRole { Unique, Key, Keyref } public ConstraintRole Role { get { return this.role; } } public Asttree Selector { get { return this.selector; } } public Asttree[] Fields { get { return this.fields; } } public static readonly CompiledIdentityConstraint Empty = new CompiledIdentityConstraint(); private CompiledIdentityConstraint() {} public CompiledIdentityConstraint(XmlSchemaIdentityConstraint constraint, XmlNamespaceManager nsmgr) { this.name = constraint.QualifiedName; //public Asttree (string xPath, bool isField, XmlNamespaceManager nsmgr) try { this.selector = new Asttree(constraint.Selector.XPath, false, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Selector); throw e; } XmlSchemaObjectCollection fields = constraint.Fields; Debug.Assert(fields.Count > 0); this.fields = new Asttree[fields.Count]; for(int idxField = 0; idxField < fields.Count; idxField ++) { try { this.fields[idxField] = new Asttree(((XmlSchemaXPath)fields[idxField]).XPath, true, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Fields[idxField]); throw e; } } if (constraint is XmlSchemaUnique) { this.role = ConstraintRole.Unique; } else if (constraint is XmlSchemaKey) { this.role = ConstraintRole.Key; } else { // XmlSchemaKeyref this.role = ConstraintRole.Keyref; this.refer = ((XmlSchemaKeyref)constraint).Refer; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System.Text; using System.Collections; using System.Diagnostics; using System.Xml.XPath; using MS.Internal.Xml.XPath; internal class CompiledIdentityConstraint { internal XmlQualifiedName name = XmlQualifiedName.Empty; private ConstraintRole role; private Asttree selector; private Asttree[] fields; internal XmlQualifiedName refer = XmlQualifiedName.Empty; public enum ConstraintRole { Unique, Key, Keyref } public ConstraintRole Role { get { return this.role; } } public Asttree Selector { get { return this.selector; } } public Asttree[] Fields { get { return this.fields; } } public static readonly CompiledIdentityConstraint Empty = new CompiledIdentityConstraint(); private CompiledIdentityConstraint() {} public CompiledIdentityConstraint(XmlSchemaIdentityConstraint constraint, XmlNamespaceManager nsmgr) { this.name = constraint.QualifiedName; //public Asttree (string xPath, bool isField, XmlNamespaceManager nsmgr) try { this.selector = new Asttree(constraint.Selector.XPath, false, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Selector); throw e; } XmlSchemaObjectCollection fields = constraint.Fields; Debug.Assert(fields.Count > 0); this.fields = new Asttree[fields.Count]; for(int idxField = 0; idxField < fields.Count; idxField ++) { try { this.fields[idxField] = new Asttree(((XmlSchemaXPath)fields[idxField]).XPath, true, nsmgr); } catch (XmlSchemaException e) { e.SetSource(constraint.Fields[idxField]); throw e; } } if (constraint is XmlSchemaUnique) { this.role = ConstraintRole.Unique; } else if (constraint is XmlSchemaKey) { this.role = ConstraintRole.Key; } else { // XmlSchemaKeyref this.role = ConstraintRole.Keyref; this.refer = ((XmlSchemaKeyref)constraint).Refer; } } } } // 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
- MappingItemCollection.cs
- ColorAnimationBase.cs
- Application.cs
- PartialCachingAttribute.cs
- EntityClientCacheKey.cs
- NamespaceQuery.cs
- Array.cs
- ConnectionPointConverter.cs
- PermissionSet.cs
- Point4DValueSerializer.cs
- SafeFindHandle.cs
- TypeReference.cs
- SafeSecurityHelper.cs
- ButtonField.cs
- TableLayoutSettings.cs
- Bitmap.cs
- SystemColorTracker.cs
- RowSpanVector.cs
- StatusBarDrawItemEvent.cs
- AuthorizationRuleCollection.cs
- CombinedHttpChannel.cs
- WebPartsPersonalizationAuthorization.cs
- DocumentOrderQuery.cs
- ClientBuildManagerCallback.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- NetSectionGroup.cs
- UrlAuthFailedErrorFormatter.cs
- PolyLineSegment.cs
- DecimalKeyFrameCollection.cs
- ErrorTolerantObjectWriter.cs
- NavigateEvent.cs
- AppDomainManager.cs
- EventLogStatus.cs
- SqlGatherConsumedAliases.cs
- AttributeCollection.cs
- HtmlElementEventArgs.cs
- ExternalCalls.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- JsonStringDataContract.cs
- PackageFilter.cs
- TableCellAutomationPeer.cs
- SystemResources.cs
- EndpointConfigContainer.cs
- TrackBarRenderer.cs
- SqlRemoveConstantOrderBy.cs
- InvalidDataException.cs
- CodeEntryPointMethod.cs
- RepeatBehavior.cs
- Base64Decoder.cs
- EntityDataSourceQueryBuilder.cs
- PictureBoxDesigner.cs
- StatusStrip.cs
- SemanticResultValue.cs
- CodeNamespace.cs
- DbUpdateCommandTree.cs
- DataTableNameHandler.cs
- DataGridSortCommandEventArgs.cs
- CompilerCollection.cs
- BaseDataListPage.cs
- AttachedAnnotation.cs
- Panel.cs
- IntegerValidator.cs
- SchemaImporter.cs
- FrameworkElementAutomationPeer.cs
- EngineSiteSapi.cs
- SoapProtocolImporter.cs
- OpenFileDialog.cs
- HttpModuleActionCollection.cs
- LocalizabilityAttribute.cs
- CoTaskMemSafeHandle.cs
- _Win32.cs
- formatter.cs
- AspCompat.cs
- ColorPalette.cs
- MILUtilities.cs
- Attributes.cs
- DataSourceCacheDurationConverter.cs
- DataRowIndexBuffer.cs
- CommandBindingCollection.cs
- ControlBuilderAttribute.cs
- SpotLight.cs
- CustomAssemblyResolver.cs
- RestClientProxyHandler.cs
- ImageCodecInfoPrivate.cs
- DataGridTable.cs
- WebPartHelpVerb.cs
- ViewGenerator.cs
- ConfigurationStrings.cs
- BamlReader.cs
- ModelItemCollectionImpl.cs
- Exceptions.cs
- EncryptedPackage.cs
- AttributeQuery.cs
- EndOfStreamException.cs
- MediaScriptCommandRoutedEventArgs.cs
- XmlHierarchicalDataSourceView.cs
- BuildProviderUtils.cs
- RuleRef.cs
- TabControlCancelEvent.cs
- ModelServiceImpl.cs