Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / BasicKeyConstraint.cs / 1305376 / 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, MemberProjectedSlot.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 (MemberProjectedSlot 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, MemberProjectedSlot.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 (MemberProjectedSlot 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
- ValueTypeFixupInfo.cs
- RpcCryptoRequest.cs
- IriParsingElement.cs
- XPathPatternParser.cs
- XmlLinkedNode.cs
- MailWriter.cs
- CompiledXpathExpr.cs
- RemotingSurrogateSelector.cs
- GeometryCombineModeValidation.cs
- NameValueSectionHandler.cs
- HtmlFormWrapper.cs
- _LocalDataStoreMgr.cs
- SqlDataSourceConfigureSortForm.cs
- BindableAttribute.cs
- XmlQueryTypeFactory.cs
- SHA1CryptoServiceProvider.cs
- XmlBinaryWriter.cs
- BehaviorDragDropEventArgs.cs
- IsolatedStorageFile.cs
- ComponentChangingEvent.cs
- MenuBindingsEditor.cs
- SchemaImporter.cs
- HwndHostAutomationPeer.cs
- LookupNode.cs
- XmlCollation.cs
- ToolStripItemCollection.cs
- ButtonChrome.cs
- EntitySqlQueryBuilder.cs
- SafePEFileHandle.cs
- WebPartEventArgs.cs
- ProfileSection.cs
- ConsumerConnectionPoint.cs
- PropertyNames.cs
- DataGridViewCellStyleChangedEventArgs.cs
- KeyedHashAlgorithm.cs
- LiteralControl.cs
- PreApplicationStartMethodAttribute.cs
- XmlSchemaType.cs
- PasswordRecovery.cs
- DateBoldEvent.cs
- PrintPreviewGraphics.cs
- TextSchema.cs
- UnauthorizedAccessException.cs
- ContentPlaceHolderDesigner.cs
- TimeSpanHelper.cs
- InputEventArgs.cs
- AdornerPresentationContext.cs
- StylusEditingBehavior.cs
- RTLAwareMessageBox.cs
- FontFamily.cs
- DictionaryEditChange.cs
- XpsImageSerializationService.cs
- ValidationContext.cs
- CleanUpVirtualizedItemEventArgs.cs
- LayoutManager.cs
- SvcMapFileSerializer.cs
- HttpContextServiceHost.cs
- PriorityItem.cs
- CustomGrammar.cs
- FormattedText.cs
- IsolatedStorageFile.cs
- SiteMembershipCondition.cs
- Maps.cs
- PersonalizablePropertyEntry.cs
- XmlTypeMapping.cs
- SetIterators.cs
- AutomationEventArgs.cs
- ApplicationDirectory.cs
- StreamInfo.cs
- CompiledAction.cs
- ComponentGlyph.cs
- WebScriptServiceHostFactory.cs
- InlineObject.cs
- PeerEndPoint.cs
- BufferedGraphicsContext.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- XmlLinkedNode.cs
- OleDbPropertySetGuid.cs
- BulletedList.cs
- ProcessHostServerConfig.cs
- SequenceDesigner.xaml.cs
- SingleAnimation.cs
- MemberAssignmentAnalysis.cs
- WorkflowFormatterBehavior.cs
- DataGridViewCellValidatingEventArgs.cs
- ValidationResult.cs
- CrossSiteScriptingValidation.cs
- TypeSystem.cs
- FixedPageStructure.cs
- StatusBar.cs
- AxisAngleRotation3D.cs
- RMPermissions.cs
- TextDecorationCollectionConverter.cs
- BasicViewGenerator.cs
- SQLDecimal.cs
- SafeFileMapViewHandle.cs
- VerificationAttribute.cs
- Point4D.cs
- ZipIORawDataFileBlock.cs
- SQLBinary.cs