Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- PageSetupDialog.cs
- FieldDescriptor.cs
- CompilerState.cs
- DataGridViewRowPrePaintEventArgs.cs
- SoapIgnoreAttribute.cs
- TransformerInfoCollection.cs
- TextProperties.cs
- TextCharacters.cs
- UpDownEvent.cs
- CodeTypeReferenceCollection.cs
- ManagementInstaller.cs
- TreeNodeMouseHoverEvent.cs
- SerializationInfo.cs
- CookieProtection.cs
- TabletDeviceInfo.cs
- QilTernary.cs
- StringSorter.cs
- CannotUnloadAppDomainException.cs
- XmlWriter.cs
- ProxySimple.cs
- CompositeFontInfo.cs
- ZipIORawDataFileBlock.cs
- NativeMethods.cs
- ContentTextAutomationPeer.cs
- Hash.cs
- PrintDocument.cs
- WindowsNonControl.cs
- ExceptionHandler.cs
- ExceptionValidationRule.cs
- FontNameConverter.cs
- SoapFormatExtensions.cs
- DetailsViewUpdateEventArgs.cs
- autovalidator.cs
- SynchronizingStream.cs
- GatewayIPAddressInformationCollection.cs
- SendActivity.cs
- Deserializer.cs
- XmlMembersMapping.cs
- RestClientProxyHandler.cs
- DataRowCollection.cs
- Attributes.cs
- FixedElement.cs
- LineInfo.cs
- InputScopeNameConverter.cs
- KnownTypes.cs
- CatalogZoneBase.cs
- ReferencedAssemblyResolver.cs
- CustomGrammar.cs
- ImageSourceValueSerializer.cs
- BitmapData.cs
- EndOfStreamException.cs
- CombinedGeometry.cs
- RoutingService.cs
- Attributes.cs
- TouchDevice.cs
- LabelTarget.cs
- Validator.cs
- TypeContext.cs
- SspiSecurityToken.cs
- CalendarModeChangedEventArgs.cs
- DataGridComboBoxColumn.cs
- XmlCollation.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SqlGatherConsumedAliases.cs
- Dispatcher.cs
- EventTask.cs
- DataGridRow.cs
- ReferentialConstraint.cs
- XmlQueryRuntime.cs
- HttpPostedFileWrapper.cs
- ScalarType.cs
- X509ChainPolicy.cs
- AutomationPatternInfo.cs
- TextModifier.cs
- SettingsPropertyValueCollection.cs
- XPathDocumentNavigator.cs
- OptimalTextSource.cs
- XNodeSchemaApplier.cs
- DesignerDeviceConfig.cs
- SystemIcons.cs
- FontResourceCache.cs
- HtmlInputHidden.cs
- EmulateRecognizeCompletedEventArgs.cs
- UserInitiatedNavigationPermission.cs
- XamlInterfaces.cs
- NameSpaceExtractor.cs
- Cursor.cs
- MultiBindingExpression.cs
- DurableMessageDispatchInspector.cs
- UpdateManifestForBrowserApplication.cs
- PageCodeDomTreeGenerator.cs
- SmtpNtlmAuthenticationModule.cs
- SafeNativeMethods.cs
- Storyboard.cs
- DBConnectionString.cs
- ExceptionUtil.cs
- DataKeyCollection.cs
- ZipIOCentralDirectoryFileHeader.cs
- CodeIndexerExpression.cs
- CounterCreationData.cs