Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- PolyLineSegmentFigureLogic.cs
- TextTreeNode.cs
- DES.cs
- SelectionEditor.cs
- COM2ExtendedTypeConverter.cs
- Int32Rect.cs
- XamlInt32CollectionSerializer.cs
- XmlSchemaElement.cs
- PeerEndPoint.cs
- HtmlInputFile.cs
- WebPartZone.cs
- AssemblyResourceLoader.cs
- WorkItem.cs
- ToolstripProfessionalRenderer.cs
- TransformCollection.cs
- SpecialFolderEnumConverter.cs
- BuildProviderCollection.cs
- Roles.cs
- SafeEventHandle.cs
- DefaultObjectSerializer.cs
- BitStack.cs
- SerialErrors.cs
- DatasetMethodGenerator.cs
- WebPartZoneBaseDesigner.cs
- TableLayoutPanel.cs
- CodeParameterDeclarationExpressionCollection.cs
- DebugController.cs
- SerialStream.cs
- RefType.cs
- ExpressionParser.cs
- RuntimeHandles.cs
- DrawingImage.cs
- CounterSampleCalculator.cs
- ReadOnlyDictionary.cs
- MemoryPressure.cs
- StyleCollection.cs
- OperationExecutionFault.cs
- VideoDrawing.cs
- METAHEADER.cs
- ClassDataContract.cs
- ClientTarget.cs
- ActivityAction.cs
- RemotingAttributes.cs
- GridViewEditEventArgs.cs
- NotSupportedException.cs
- RsaSecurityTokenAuthenticator.cs
- ByeOperation11AsyncResult.cs
- DataGridViewControlCollection.cs
- UInt16.cs
- RelationshipNavigation.cs
- mediaeventargs.cs
- BaseParser.cs
- ConfigDefinitionUpdates.cs
- SafeFileHandle.cs
- ValueUnavailableException.cs
- autovalidator.cs
- FixUp.cs
- User.cs
- ValidatedMobileControlConverter.cs
- ArcSegment.cs
- DelegateSerializationHolder.cs
- SqlInternalConnectionSmi.cs
- x509utils.cs
- Comparer.cs
- HierarchicalDataTemplate.cs
- Helpers.cs
- Internal.cs
- XmlIgnoreAttribute.cs
- ResourcePermissionBaseEntry.cs
- DataGridViewColumnHeaderCell.cs
- ReservationCollection.cs
- DropShadowEffect.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ParameterModifier.cs
- ExecutionContext.cs
- CodePageEncoding.cs
- DashStyle.cs
- MimeMultiPart.cs
- UITypeEditor.cs
- HelloOperation11AsyncResult.cs
- XslCompiledTransform.cs
- FreezableOperations.cs
- ResXResourceReader.cs
- FormViewAutoFormat.cs
- ImageListImageEditor.cs
- ThicknessAnimationBase.cs
- DbConnectionFactory.cs
- RadioButton.cs
- PriorityItem.cs
- ContractTypeNameElement.cs
- ScaleTransform.cs
- ParamArrayAttribute.cs
- DataGridColumnCollection.cs
- CollectionChangeEventArgs.cs
- CompositeFontInfo.cs
- MenuItemAutomationPeer.cs
- DrawingContext.cs
- SapiRecognizer.cs
- SBCSCodePageEncoding.cs
- UncommonField.cs