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
- FileUpload.cs
- Soap12ProtocolReflector.cs
- IpcClientChannel.cs
- XmlDocument.cs
- ModifiableIteratorCollection.cs
- XmlObjectSerializerContext.cs
- CompiledRegexRunnerFactory.cs
- DesignerCategoryAttribute.cs
- JavaScriptSerializer.cs
- Vector3DConverter.cs
- BitmapMetadataBlob.cs
- Timer.cs
- CompoundFileReference.cs
- X509Extension.cs
- DuplexChannelBinder.cs
- XmlSchemaExternal.cs
- ScalarType.cs
- SqlDataSourceConfigureFilterForm.cs
- CustomValidator.cs
- TimeSpanConverter.cs
- ToolBarTray.cs
- InkCanvasAutomationPeer.cs
- SpeakProgressEventArgs.cs
- AbandonedMutexException.cs
- DataContractJsonSerializerOperationFormatter.cs
- HostingEnvironmentWrapper.cs
- StrokeNodeData.cs
- Dynamic.cs
- MenuItemAutomationPeer.cs
- DirtyTextRange.cs
- XmlReaderSettings.cs
- _HeaderInfoTable.cs
- MetaTable.cs
- RequestCachePolicy.cs
- RuleSetCollection.cs
- DocumentViewerAutomationPeer.cs
- ForeignKeyConstraint.cs
- SoapElementAttribute.cs
- CodeDOMProvider.cs
- Image.cs
- securitycriticaldataformultiplegetandset.cs
- TemporaryBitmapFile.cs
- StrongName.cs
- TypeExtensionSerializer.cs
- WorkflowStateRollbackService.cs
- CultureTable.cs
- DoubleCollectionValueSerializer.cs
- unsafeIndexingFilterStream.cs
- FaultException.cs
- _CommandStream.cs
- InvokeHandlers.cs
- CollectionChangedEventManager.cs
- BitmapEffectInputData.cs
- DragDeltaEventArgs.cs
- HttpModulesSection.cs
- ListBoxChrome.cs
- Binding.cs
- ByeOperation11AsyncResult.cs
- BitStack.cs
- CompositeControl.cs
- QuotedPairReader.cs
- DynamicValidator.cs
- ValidatedControlConverter.cs
- InfiniteTimeSpanConverter.cs
- ValidationHelpers.cs
- RegexGroup.cs
- ArcSegment.cs
- BridgeDataRecord.cs
- Reference.cs
- FormParameter.cs
- FixedSOMPageElement.cs
- ToolbarAUtomationPeer.cs
- SafePEFileHandle.cs
- RectAnimation.cs
- QuadraticBezierSegment.cs
- InternalPermissions.cs
- UriSection.cs
- SqlParameter.cs
- DataGridViewSelectedCellCollection.cs
- TargetConverter.cs
- TextCharacters.cs
- AuthenticationManager.cs
- DayRenderEvent.cs
- BooleanStorage.cs
- EventHandlerList.cs
- ImageListUtils.cs
- CommandEventArgs.cs
- ServiceObjectContainer.cs
- Debugger.cs
- NativeMethods.cs
- FileInfo.cs
- DataGridCellInfo.cs
- DoubleCollectionConverter.cs
- System.Data_BID.cs
- XPathQueryGenerator.cs
- XmlCollation.cs
- SwitchElementsCollection.cs
- AssemblyAttributesGoHere.cs
- DataAccessException.cs
- CallContext.cs