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
- DataRow.cs
- RootBrowserWindowAutomationPeer.cs
- DeferredRunTextReference.cs
- KeyManager.cs
- SqlXml.cs
- PageOrientation.cs
- PeerCustomResolverSettings.cs
- _TransmitFileOverlappedAsyncResult.cs
- CursorConverter.cs
- ScrollableControlDesigner.cs
- FloaterParagraph.cs
- HandleCollector.cs
- base64Transforms.cs
- Pointer.cs
- XmlHierarchyData.cs
- _AutoWebProxyScriptEngine.cs
- DefaultValueAttribute.cs
- ToolStripContainer.cs
- SchemaCollectionCompiler.cs
- Tuple.cs
- FontCacheLogic.cs
- NamespaceEmitter.cs
- DashStyle.cs
- MatcherBuilder.cs
- RuntimeArgument.cs
- BinaryFormatterWriter.cs
- XmlSchemaSimpleContentExtension.cs
- Pair.cs
- AmbientProperties.cs
- DataGridTextBoxColumn.cs
- ListBindableAttribute.cs
- UnsafeNativeMethods.cs
- HostSecurityManager.cs
- PathGeometry.cs
- WebCategoryAttribute.cs
- CqlGenerator.cs
- ResourceCategoryAttribute.cs
- TraceListener.cs
- TeredoHelper.cs
- XmlRawWriterWrapper.cs
- DecimalMinMaxAggregationOperator.cs
- XmlTextEncoder.cs
- ExpressionEditorAttribute.cs
- Console.cs
- Message.cs
- XPathCompileException.cs
- EntityContainerAssociationSet.cs
- MatrixAnimationUsingKeyFrames.cs
- XmlSchemaCompilationSettings.cs
- TransferRequestHandler.cs
- ComboBoxItem.cs
- Rotation3D.cs
- StringComparer.cs
- BaseServiceProvider.cs
- SqlDataSourceView.cs
- DeflateStream.cs
- Method.cs
- ListSurrogate.cs
- DataServiceQueryProvider.cs
- ServiceCredentialsSecurityTokenManager.cs
- SqlVisitor.cs
- DependencyPropertyAttribute.cs
- followingsibling.cs
- PerformanceCountersElement.cs
- FamilyCollection.cs
- SqlAliasesReferenced.cs
- Timeline.cs
- XmlUtil.cs
- NeutralResourcesLanguageAttribute.cs
- PageContentCollection.cs
- ProvidePropertyAttribute.cs
- SizeFConverter.cs
- TransactionChannelFactory.cs
- HyperLinkField.cs
- ExpressionBuilderContext.cs
- ProcessModule.cs
- XmlILAnnotation.cs
- StateWorkerRequest.cs
- SessionPageStatePersister.cs
- Timeline.cs
- FlowPanelDesigner.cs
- HttpPostedFileWrapper.cs
- IncrementalCompileAnalyzer.cs
- ReflectionHelper.cs
- RuntimeArgumentHandle.cs
- UnaryNode.cs
- Triplet.cs
- IPAddress.cs
- AppDomainShutdownMonitor.cs
- FrameDimension.cs
- FrameworkReadOnlyPropertyMetadata.cs
- DrawingContextWalker.cs
- DataKey.cs
- DataColumnCollection.cs
- PropertyMap.cs
- TextBox.cs
- CollectionViewSource.cs
- UInt32.cs
- DynamicResourceExtension.cs
- XhtmlMobileTextWriter.cs