Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / BasicKeyConstraint.cs / 1 / BasicKeyConstraint.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Mapping.ViewGeneration.Structures; using System.Collections.Generic; namespace System.Data.Mapping.ViewGeneration.Validation { using BasicSchemaConstraints = SchemaConstraints; // Class representing a key constraint on the basic cell relations internal class BasicKeyConstraint : KeyConstraint { #region Constructor // Constructs a key constraint for the given relation and keyslots internal BasicKeyConstraint(BasicCellRelation relation, IEnumerable keySlots) : base(relation, keySlots, JoinTreeSlot.SpecificEqualityComparer) { } #endregion #region Methods // effects: Propagates this constraint from the basic cell relation // to the corresponding view cell relation and returns the new constraint // If all the key slots are not being projected, returns null internal ViewKeyConstraint Propagate() { ViewCellRelation viewCellRelation = CellRelation.ViewCellRelation; // If all slots appear in the projection, propagate key constraint List viewSlots = new List (); foreach (JoinTreeSlot keySlot in KeySlots) { ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot); if (viewCellSlot == null) { // Slot is missing -- no key constraint on the view relation return null; } viewSlots.Add(viewCellSlot); } // Create a key on view relation ViewKeyConstraint viewKeyConstraint = new ViewKeyConstraint(viewCellRelation, viewSlots); return viewKeyConstraint; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Mapping.ViewGeneration.Structures; using System.Collections.Generic; namespace System.Data.Mapping.ViewGeneration.Validation { using BasicSchemaConstraints = SchemaConstraints; // Class representing a key constraint on the basic cell relations internal class BasicKeyConstraint : KeyConstraint { #region Constructor // Constructs a key constraint for the given relation and keyslots internal BasicKeyConstraint(BasicCellRelation relation, IEnumerable keySlots) : base(relation, keySlots, JoinTreeSlot.SpecificEqualityComparer) { } #endregion #region Methods // effects: Propagates this constraint from the basic cell relation // to the corresponding view cell relation and returns the new constraint // If all the key slots are not being projected, returns null internal ViewKeyConstraint Propagate() { ViewCellRelation viewCellRelation = CellRelation.ViewCellRelation; // If all slots appear in the projection, propagate key constraint List viewSlots = new List (); foreach (JoinTreeSlot keySlot in KeySlots) { ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot); if (viewCellSlot == null) { // Slot is missing -- no key constraint on the view relation return null; } viewSlots.Add(viewCellSlot); } // Create a key on view relation ViewKeyConstraint viewKeyConstraint = new ViewKeyConstraint(viewCellRelation, viewSlots); return viewKeyConstraint; } #endregion } } // 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
- GPRECTF.cs
- PackageDigitalSignatureManager.cs
- DrawingVisual.cs
- MimeTypeAttribute.cs
- AppearanceEditorPart.cs
- EventListener.cs
- MDIClient.cs
- _emptywebproxy.cs
- StringWriter.cs
- RMEnrollmentPage2.cs
- PersonalizationProvider.cs
- SamlAudienceRestrictionCondition.cs
- RtfFormatStack.cs
- ButtonColumn.cs
- ParamArrayAttribute.cs
- SelectionEditor.cs
- NativeCppClassAttribute.cs
- DependencyObject.cs
- DragCompletedEventArgs.cs
- RuntimeTransactionHandle.cs
- X509CertificateCollection.cs
- SoapTypeAttribute.cs
- Propagator.JoinPropagator.cs
- Vector3DAnimationUsingKeyFrames.cs
- UdpUtility.cs
- NoClickablePointException.cs
- ObjectPersistData.cs
- NumericUpDown.cs
- DataRowChangeEvent.cs
- CodeTypeParameter.cs
- CharConverter.cs
- RectAnimationUsingKeyFrames.cs
- FileSystemInfo.cs
- SqlNotificationEventArgs.cs
- SoapConverter.cs
- CompositeActivityCodeGenerator.cs
- ParserContext.cs
- Int32Animation.cs
- MediaTimeline.cs
- AsymmetricKeyExchangeDeformatter.cs
- AnnotationHelper.cs
- NotImplementedException.cs
- DataReceivedEventArgs.cs
- PresentationAppDomainManager.cs
- OdbcEnvironmentHandle.cs
- WhitespaceRuleReader.cs
- StatusBarDesigner.cs
- ValidationUtility.cs
- StreamingContext.cs
- ALinqExpressionVisitor.cs
- SemaphoreSlim.cs
- WebPartMinimizeVerb.cs
- figurelengthconverter.cs
- PersonalizationEntry.cs
- StreamUpgradeInitiator.cs
- DiscoveryProxy.cs
- DeploymentSectionCache.cs
- WebErrorHandler.cs
- CodeMethodReturnStatement.cs
- ThreadPoolTaskScheduler.cs
- RequiredAttributeAttribute.cs
- SqlDataSourceQueryEditorForm.cs
- _BaseOverlappedAsyncResult.cs
- TextFormatterContext.cs
- Utils.cs
- altserialization.cs
- StateRuntime.cs
- RunWorkerCompletedEventArgs.cs
- CqlLexerHelpers.cs
- AttributedMetaModel.cs
- StringAttributeCollection.cs
- TextBlock.cs
- hwndwrapper.cs
- ElapsedEventArgs.cs
- DiffuseMaterial.cs
- MediaPlayerState.cs
- MethodToken.cs
- CompiledRegexRunner.cs
- PropertyChangedEventArgs.cs
- ConfigurationValidatorBase.cs
- XmlQueryType.cs
- MetadataHelper.cs
- IdleTimeoutMonitor.cs
- XslAst.cs
- Style.cs
- CqlErrorHelper.cs
- ImageField.cs
- Floater.cs
- RC2CryptoServiceProvider.cs
- Compiler.cs
- PersonalizationState.cs
- Typography.cs
- SqlStatistics.cs
- WebCategoryAttribute.cs
- WebPartConnectionsCancelEventArgs.cs
- SaveFileDialog.cs
- ValidatingCollection.cs
- KeyValueConfigurationElement.cs
- Rotation3D.cs
- Attributes.cs