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
- WindowsTokenRoleProvider.cs
- CompositeDataBoundControl.cs
- CodeExpressionStatement.cs
- DataGridCaption.cs
- EntityWrapperFactory.cs
- TimerElapsedEvenArgs.cs
- SequenceQuery.cs
- PaintValueEventArgs.cs
- TCEAdapterGenerator.cs
- XmlSchemaGroupRef.cs
- TextBoxLine.cs
- WindowsPrincipal.cs
- FreezableCollection.cs
- FrugalList.cs
- TextContainerChangeEventArgs.cs
- CardSpaceSelector.cs
- StaticFileHandler.cs
- TrimSurroundingWhitespaceAttribute.cs
- DataRowChangeEvent.cs
- ExtenderProviderService.cs
- StringSource.cs
- ScriptRegistrationManager.cs
- StringUtil.cs
- NativeMethods.cs
- MouseButton.cs
- PropertyMapper.cs
- DbExpressionVisitor_TResultType.cs
- ScriptControl.cs
- BaseCollection.cs
- Brushes.cs
- ConfigurationSectionGroup.cs
- DropSource.cs
- ConfigurationManagerHelper.cs
- ObjectIDGenerator.cs
- ImageSourceValueSerializer.cs
- VScrollBar.cs
- ToolStripTextBox.cs
- FocusManager.cs
- SqlConnectionString.cs
- XmlReturnWriter.cs
- PartialClassGenerationTaskInternal.cs
- ArgumentNullException.cs
- SizeConverter.cs
- RoutingExtension.cs
- FormsIdentity.cs
- NavigatorInput.cs
- StartUpEventArgs.cs
- ValidationHelper.cs
- PerSessionInstanceContextProvider.cs
- GatewayDefinition.cs
- XmlReflectionImporter.cs
- UmAlQuraCalendar.cs
- SplitterPanel.cs
- RegexStringValidator.cs
- EntityDataSourceDesigner.cs
- PerformanceCounterLib.cs
- ContainsRowNumberChecker.cs
- LinkLabelLinkClickedEvent.cs
- GenericsNotImplementedException.cs
- SqlVisitor.cs
- XPathNavigatorKeyComparer.cs
- HMACSHA512.cs
- HtmlControlPersistable.cs
- UriExt.cs
- OleAutBinder.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TreeView.cs
- ObjectManager.cs
- FilterInvalidBodyAccessException.cs
- QueryContinueDragEventArgs.cs
- TrustDriver.cs
- SafeCoTaskMem.cs
- ErrorWrapper.cs
- DateTimeConverter2.cs
- SelectionHighlightInfo.cs
- FileIOPermission.cs
- DrawingContextWalker.cs
- IPAddressCollection.cs
- UpdateProgress.cs
- SHA512Managed.cs
- TagMapInfo.cs
- DataRowComparer.cs
- Soap12ServerProtocol.cs
- ExceptionHelpers.cs
- InternalBufferOverflowException.cs
- DragDropManager.cs
- FormsIdentity.cs
- DataSvcMapFile.cs
- InputScopeNameConverter.cs
- TextModifierScope.cs
- EventSourceCreationData.cs
- Margins.cs
- HtmlHead.cs
- SoapDocumentMethodAttribute.cs
- Stylesheet.cs
- Dump.cs
- GACMembershipCondition.cs
- XomlCompiler.cs
- HtmlUtf8RawTextWriter.cs
- KerberosSecurityTokenProvider.cs