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
- WinEventTracker.cs
- FlatButtonAppearance.cs
- StoragePropertyMapping.cs
- ScriptControlManager.cs
- WindowsIPAddress.cs
- ControlCollection.cs
- BufferedWebEventProvider.cs
- PromptEventArgs.cs
- StorageAssociationSetMapping.cs
- ToolboxDataAttribute.cs
- SqlTriggerAttribute.cs
- LabelEditEvent.cs
- TokenizerHelper.cs
- ButtonFlatAdapter.cs
- Win32SafeHandles.cs
- IntSumAggregationOperator.cs
- TextServicesCompartmentEventSink.cs
- SingleKeyFrameCollection.cs
- DataSourceNameHandler.cs
- StorageModelBuildProvider.cs
- AssociationSet.cs
- AspCompat.cs
- HttpAsyncResult.cs
- TextDecoration.cs
- VariantWrapper.cs
- AsymmetricCryptoHandle.cs
- SystemIPv6InterfaceProperties.cs
- HtmlElement.cs
- LessThan.cs
- VerifyHashRequest.cs
- activationcontext.cs
- StatusBarDrawItemEvent.cs
- FileIOPermission.cs
- Zone.cs
- CodeEventReferenceExpression.cs
- FontUnitConverter.cs
- WebException.cs
- OutputCacheSection.cs
- MaskedTextProvider.cs
- TreeNodeClickEventArgs.cs
- AutoGeneratedField.cs
- WebPartConnectionsConfigureVerb.cs
- MenuAutomationPeer.cs
- VisualBrush.cs
- PersistenceTypeAttribute.cs
- StylusPointDescription.cs
- OleDbInfoMessageEvent.cs
- ObsoleteAttribute.cs
- PageParser.cs
- WebColorConverter.cs
- ServiceInfo.cs
- XmlSchemaCollection.cs
- Executor.cs
- NavigationFailedEventArgs.cs
- DoubleAnimationBase.cs
- VersionedStreamOwner.cs
- KeyInstance.cs
- DesignerDataTable.cs
- ListBoxAutomationPeer.cs
- Style.cs
- KeyGesture.cs
- CertificateElement.cs
- ToolStripPanelDesigner.cs
- OleDbEnumerator.cs
- ConstraintManager.cs
- Fault.cs
- UnitControl.cs
- BuildProvidersCompiler.cs
- LateBoundBitmapDecoder.cs
- MutexSecurity.cs
- WmlLabelAdapter.cs
- BeginEvent.cs
- DefaultTextStoreTextComposition.cs
- PreservationFileWriter.cs
- XsltLoader.cs
- BindingContext.cs
- CompositeKey.cs
- TextSpanModifier.cs
- X509Certificate.cs
- TemplateKeyConverter.cs
- ListBoxItemWrapperAutomationPeer.cs
- RbTree.cs
- ManifestSignatureInformation.cs
- ImageAutomationPeer.cs
- TableSectionStyle.cs
- EntityClientCacheKey.cs
- RawMouseInputReport.cs
- MissingFieldException.cs
- FontSizeConverter.cs
- CopyAttributesAction.cs
- TypeContext.cs
- SelectionItemPattern.cs
- SoundPlayerAction.cs
- HttpCookie.cs
- CodeTypeOfExpression.cs
- VScrollProperties.cs
- CreateUserErrorEventArgs.cs
- ProjectionPlan.cs
- CheckableControlBaseAdapter.cs
- Registry.cs