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 / KeyConstraint.cs / 1 / KeyConstraint.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Common.Utils; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace System.Data.Mapping.ViewGeneration.Validation { // Class representing a key constraint for particular cellrelation internal class KeyConstraint: InternalBase where TCellRelation : CellRelation { #region Constructor // Constructs a key constraint for the given relation and keyslots // with comparer being the comparison operator for comparing various // keyslots in Implies, etc internal KeyConstraint(TCellRelation relation, IEnumerable keySlots, IEqualityComparer comparer) { m_relation = relation; m_keySlots = new Set (keySlots, comparer).MakeReadOnly(); Debug.Assert(m_keySlots.Count > 0, "Key constraint being created without any keyslots?"); } #endregion #region Fields private TCellRelation m_relation; private Set m_keySlots; #endregion #region Properties protected TCellRelation CellRelation { get { return m_relation; } } protected Set KeySlots { get { return m_keySlots;} } #endregion #region Methods internal override void ToCompactString(StringBuilder builder) { StringUtil.FormatStringBuilder(builder, "Key (V{0}) - ", m_relation.CellNumber); StringUtil.ToSeparatedStringSorted(builder, KeySlots, ", "); // The slots contain the name of the relation: So we skip // printing the CellRelation } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Common.Utils; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace System.Data.Mapping.ViewGeneration.Validation { // Class representing a key constraint for particular cellrelation internal class KeyConstraint: InternalBase where TCellRelation : CellRelation { #region Constructor // Constructs a key constraint for the given relation and keyslots // with comparer being the comparison operator for comparing various // keyslots in Implies, etc internal KeyConstraint(TCellRelation relation, IEnumerable keySlots, IEqualityComparer comparer) { m_relation = relation; m_keySlots = new Set (keySlots, comparer).MakeReadOnly(); Debug.Assert(m_keySlots.Count > 0, "Key constraint being created without any keyslots?"); } #endregion #region Fields private TCellRelation m_relation; private Set m_keySlots; #endregion #region Properties protected TCellRelation CellRelation { get { return m_relation; } } protected Set KeySlots { get { return m_keySlots;} } #endregion #region Methods internal override void ToCompactString(StringBuilder builder) { StringUtil.FormatStringBuilder(builder, "Key (V{0}) - ", m_relation.CellNumber); StringUtil.ToSeparatedStringSorted(builder, KeySlots, ", "); // The slots contain the name of the relation: So we skip // printing the CellRelation } #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
- StrokeCollection.cs
- XmlReaderDelegator.cs
- XmlObjectSerializerWriteContextComplex.cs
- BaseDataListComponentEditor.cs
- Keywords.cs
- PeerName.cs
- StreamUpgradeAcceptor.cs
- Transform.cs
- ToolboxItemLoader.cs
- HtmlControlPersistable.cs
- DSGeneratorProblem.cs
- RestHandler.cs
- TimeoutConverter.cs
- IteratorFilter.cs
- SystemIcmpV4Statistics.cs
- AddInToken.cs
- StyleHelper.cs
- ServiceMemoryGates.cs
- SQLSingle.cs
- GenerateHelper.cs
- RegexStringValidator.cs
- CharacterBuffer.cs
- DesignerCategoryAttribute.cs
- MonthCalendarDesigner.cs
- ToolStripCollectionEditor.cs
- SafeCryptContextHandle.cs
- GlobalEventManager.cs
- OleDbMetaDataFactory.cs
- FileLogRecordStream.cs
- ECDsaCng.cs
- ClientSponsor.cs
- DropShadowBitmapEffect.cs
- securitycriticaldataClass.cs
- XmlSerializerOperationBehavior.cs
- PointIndependentAnimationStorage.cs
- ScrollBar.cs
- HostingMessageProperty.cs
- BrowserCapabilitiesCompiler.cs
- DetailsViewPageEventArgs.cs
- cryptoapiTransform.cs
- Encoding.cs
- HttpAsyncResult.cs
- SqlBulkCopyColumnMappingCollection.cs
- TextModifierScope.cs
- ResourceCategoryAttribute.cs
- ExtensionFile.cs
- RelationshipNavigation.cs
- mongolianshape.cs
- TabPanel.cs
- DataGridViewCellStateChangedEventArgs.cs
- ThicknessAnimationBase.cs
- ApplicationServiceManager.cs
- DocumentAutomationPeer.cs
- Compress.cs
- ViewStateModeByIdAttribute.cs
- DiscriminatorMap.cs
- LayoutSettings.cs
- VScrollProperties.cs
- DetailsViewModeEventArgs.cs
- ToolStripLocationCancelEventArgs.cs
- TextProperties.cs
- FieldToken.cs
- DataColumn.cs
- TypeUtil.cs
- basemetadatamappingvisitor.cs
- LayoutEngine.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- ExternalCalls.cs
- SSmlParser.cs
- GlyphingCache.cs
- DataContractSerializerFaultFormatter.cs
- AttributeUsageAttribute.cs
- SmiContextFactory.cs
- Span.cs
- MatrixConverter.cs
- RuntimeVariablesExpression.cs
- TreeViewDesigner.cs
- Classification.cs
- XmlDataImplementation.cs
- SqlRowUpdatingEvent.cs
- TextSelectionHighlightLayer.cs
- ColumnMapProcessor.cs
- ColumnTypeConverter.cs
- Choices.cs
- ObjectDataSourceMethodEventArgs.cs
- SetStateEventArgs.cs
- XhtmlBasicControlAdapter.cs
- ValidationErrorEventArgs.cs
- DisplayNameAttribute.cs
- EventBookmark.cs
- VarRefManager.cs
- XmlAggregates.cs
- StopRoutingHandler.cs
- ServiceElementCollection.cs
- ZipPackagePart.cs
- ProfileProvider.cs
- ITextView.cs
- ThrowOnMultipleAssignment.cs
- Crc32Helper.cs
- Receive.cs