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
- CaseCqlBlock.cs
- LineUtil.cs
- SourceFileBuildProvider.cs
- PointF.cs
- ScrollProviderWrapper.cs
- ResetableIterator.cs
- SchemaDeclBase.cs
- ZipIOLocalFileHeader.cs
- DataControlPagerLinkButton.cs
- LostFocusEventManager.cs
- UTF7Encoding.cs
- EntryWrittenEventArgs.cs
- UserMapPath.cs
- NamespaceImport.cs
- ListViewGroupConverter.cs
- WebBrowserHelper.cs
- WebPartAuthorizationEventArgs.cs
- CodeAttributeArgument.cs
- DataControlLinkButton.cs
- ValueTypeFixupInfo.cs
- SQLSingleStorage.cs
- DependencyObjectPropertyDescriptor.cs
- GradientBrush.cs
- SerialPort.cs
- CallbackValidatorAttribute.cs
- MulticastIPAddressInformationCollection.cs
- LineInfo.cs
- ApplicationSecurityInfo.cs
- SafeIUnknown.cs
- WebResourceAttribute.cs
- BoundColumn.cs
- CompleteWizardStep.cs
- FormViewUpdatedEventArgs.cs
- AuthorizationRuleCollection.cs
- ADMembershipUser.cs
- Light.cs
- PathFigureCollection.cs
- ChtmlImageAdapter.cs
- MetaTable.cs
- SerializeAbsoluteContext.cs
- XsltCompileContext.cs
- xmlNames.cs
- ClientTarget.cs
- Debug.cs
- NativeMethodsOther.cs
- TypeTypeConverter.cs
- WindowsStartMenu.cs
- ClaimSet.cs
- DataGridViewLinkColumn.cs
- WebServiceData.cs
- OletxDependentTransaction.cs
- UrlPropertyAttribute.cs
- HTMLTagNameToTypeMapper.cs
- SqlDependency.cs
- AmbiguousMatchException.cs
- KnownColorTable.cs
- NamespaceList.cs
- XD.cs
- XmlSerializerAssemblyAttribute.cs
- PropertyPath.cs
- SchemaComplexType.cs
- Pens.cs
- AssemblyUtil.cs
- BaseTreeIterator.cs
- ResourcePool.cs
- TypeCacheManager.cs
- Vertex.cs
- ModelItemCollection.cs
- ProviderException.cs
- XmlDigitalSignatureProcessor.cs
- InputProviderSite.cs
- QilPatternVisitor.cs
- TemplateContentLoader.cs
- SharedPersonalizationStateInfo.cs
- FileChangesMonitor.cs
- InternalConfigConfigurationFactory.cs
- FactoryId.cs
- DataViewListener.cs
- TypeForwardedFromAttribute.cs
- Rotation3D.cs
- DesignerValidatorAdapter.cs
- SuppressIldasmAttribute.cs
- User.cs
- XomlCompilerHelpers.cs
- InternalResources.cs
- SapiAttributeParser.cs
- LinqDataSource.cs
- XmlAttributeProperties.cs
- NumberAction.cs
- CreateInstanceBinder.cs
- RangeBase.cs
- LowerCaseStringConverter.cs
- RequestCacheEntry.cs
- GraphicsState.cs
- ByteKeyFrameCollection.cs
- EmptyEnumerable.cs
- CompositeCollectionView.cs
- Model3D.cs
- StringValidator.cs
- RayMeshGeometry3DHitTestResult.cs