Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- GroupBox.cs
- StatusBar.cs
- ConfigurationStrings.cs
- Contracts.cs
- ReadOnlyDataSourceView.cs
- EntryIndex.cs
- PanelStyle.cs
- SafeUserTokenHandle.cs
- ArcSegment.cs
- Socket.cs
- PolyBezierSegmentFigureLogic.cs
- SoundPlayerAction.cs
- HashMembershipCondition.cs
- DefaultEvaluationContext.cs
- AspNetHostingPermission.cs
- PolicyUnit.cs
- MultiDataTrigger.cs
- SignatureConfirmationElement.cs
- HostSecurityManager.cs
- PersistenceTypeAttribute.cs
- ReferenceEqualityComparer.cs
- MouseWheelEventArgs.cs
- AmbientLight.cs
- XmlCountingReader.cs
- SqlTransaction.cs
- StreamUpgradeBindingElement.cs
- UnsafeNativeMethods.cs
- ModulesEntry.cs
- RuntimeIdentifierPropertyAttribute.cs
- RelatedPropertyManager.cs
- DbgCompiler.cs
- WebPartCloseVerb.cs
- VariantWrapper.cs
- UnaryNode.cs
- NameTable.cs
- Scene3D.cs
- UIElement3D.cs
- COM2PropertyDescriptor.cs
- HttpException.cs
- FileSystemInfo.cs
- ConsoleEntryPoint.cs
- cookiecollection.cs
- IsolatedStorageFileStream.cs
- EmptyEnumerable.cs
- XPathAncestorIterator.cs
- XPathSingletonIterator.cs
- SqlCrossApplyToCrossJoin.cs
- HttpProfileGroupBase.cs
- WebPartDesigner.cs
- _ConnectStream.cs
- HttpCapabilitiesSectionHandler.cs
- InitializingNewItemEventArgs.cs
- ToolStripComboBox.cs
- HttpHandlerAction.cs
- ConfigPathUtility.cs
- FormViewPagerRow.cs
- ValueSerializer.cs
- FixedSOMElement.cs
- CanonicalFontFamilyReference.cs
- SchemaCollectionPreprocessor.cs
- StreamingContext.cs
- _CacheStreams.cs
- FamilyTypeface.cs
- Pair.cs
- IteratorFilter.cs
- PromptBuilder.cs
- InputBindingCollection.cs
- LocalizabilityAttribute.cs
- OuterGlowBitmapEffect.cs
- TemporaryBitmapFile.cs
- AttributeData.cs
- Condition.cs
- Line.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ImageButton.cs
- PropertyRecord.cs
- PathFigureCollectionConverter.cs
- PersonalizationProviderHelper.cs
- WebPartDisplayModeCancelEventArgs.cs
- PageStatePersister.cs
- EmissiveMaterial.cs
- XmlEntity.cs
- LocatorBase.cs
- HandlerFactoryCache.cs
- CustomAttributeSerializer.cs
- RuntimeConfigLKG.cs
- ClickablePoint.cs
- CodeTypeReference.cs
- OletxResourceManager.cs
- TextParagraphProperties.cs
- WinEventWrap.cs
- Internal.cs
- QuaternionAnimationBase.cs
- UserControl.cs
- DbDeleteCommandTree.cs
- SrgsRuleRef.cs
- WebUtil.cs
- DataGridViewRowHeaderCell.cs
- Viewport2DVisual3D.cs
- ProjectionCamera.cs