Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- LookupBindingPropertiesAttribute.cs
- WindowsListViewSubItem.cs
- MultiView.cs
- ShutDownListener.cs
- SoapFault.cs
- XmlSerializerAssemblyAttribute.cs
- ControlValuePropertyAttribute.cs
- MouseActionValueSerializer.cs
- Point3DConverter.cs
- GeneralTransformCollection.cs
- ControlValuePropertyAttribute.cs
- SafeLibraryHandle.cs
- Int64Converter.cs
- SqlUserDefinedAggregateAttribute.cs
- connectionpool.cs
- HttpRequestCacheValidator.cs
- GridEntry.cs
- DbProviderFactory.cs
- NavigationWindow.cs
- StrokeCollectionDefaultValueFactory.cs
- PreviewPageInfo.cs
- Page.cs
- FormatterConverter.cs
- IList.cs
- ByteFacetDescriptionElement.cs
- TreeViewItem.cs
- ServiceDescription.cs
- DesignBindingPicker.cs
- HttpInputStream.cs
- EditorAttribute.cs
- FixedSOMLineCollection.cs
- TriggerAction.cs
- GeneratedView.cs
- UriSectionData.cs
- EventItfInfo.cs
- Timeline.cs
- WindowAutomationPeer.cs
- IsolatedStorageException.cs
- DispatcherOperation.cs
- CellTreeNode.cs
- _SpnDictionary.cs
- GridViewColumnHeader.cs
- BufferedGraphics.cs
- ConfigXmlSignificantWhitespace.cs
- ErrorStyle.cs
- SplineQuaternionKeyFrame.cs
- KeyboardDevice.cs
- StrongNameUtility.cs
- DbDataAdapter.cs
- ToolStripItemCollection.cs
- UIPermission.cs
- DataObjectFieldAttribute.cs
- MimeMapping.cs
- HtmlControlAdapter.cs
- ProcessHostConfigUtils.cs
- SharedPersonalizationStateInfo.cs
- IResourceProvider.cs
- DataServiceContext.cs
- Timeline.cs
- BrowserCapabilitiesCompiler.cs
- DataGridColumnStyleMappingNameEditor.cs
- AnnotationObservableCollection.cs
- CompatibleIComparer.cs
- OleDbTransaction.cs
- XPathNavigatorKeyComparer.cs
- GridViewColumnHeaderAutomationPeer.cs
- NativeMethods.cs
- QuotedPairReader.cs
- GregorianCalendar.cs
- Misc.cs
- OrderedDictionary.cs
- EditorAttributeInfo.cs
- EnumValAlphaComparer.cs
- SymbolPair.cs
- Object.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- GroupItemAutomationPeer.cs
- PropertyOverridesTypeEditor.cs
- AsyncResult.cs
- Padding.cs
- JumpItem.cs
- DESCryptoServiceProvider.cs
- APCustomTypeDescriptor.cs
- DiscoveryInnerClientAdhocCD1.cs
- ListViewInsertionMark.cs
- CharacterMetrics.cs
- CompileXomlTask.cs
- TextDecorationCollection.cs
- HasCopySemanticsAttribute.cs
- RuntimeHelpers.cs
- RoutingSection.cs
- CodeIdentifier.cs
- AppAction.cs
- RelationshipEndCollection.cs
- ContentPresenter.cs
- LinkDescriptor.cs
- TdsParameterSetter.cs
- Crc32Helper.cs
- Validator.cs
- safelinkcollection.cs