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
- SQLSingle.cs
- TemplateBindingExpression.cs
- FormCollection.cs
- TrackBarDesigner.cs
- Crypto.cs
- ScriptControlDescriptor.cs
- UserControlBuildProvider.cs
- DataSourceCacheDurationConverter.cs
- StylusCaptureWithinProperty.cs
- InputScope.cs
- Peer.cs
- ProbeMatches11.cs
- Pair.cs
- Activation.cs
- SerializationSectionGroup.cs
- TreeViewImageKeyConverter.cs
- View.cs
- ArrayConverter.cs
- WindowsTokenRoleProvider.cs
- MailDefinition.cs
- EntityType.cs
- X509Certificate.cs
- ControlAdapter.cs
- Ops.cs
- MemberAccessException.cs
- SqlReorderer.cs
- IndentTextWriter.cs
- UrlPath.cs
- TextServicesDisplayAttributePropertyRanges.cs
- OptimalBreakSession.cs
- StructuredTypeInfo.cs
- XmlBindingWorker.cs
- BamlCollectionHolder.cs
- PerformanceCounterNameAttribute.cs
- NestPullup.cs
- AsyncContentLoadedEventArgs.cs
- FocusTracker.cs
- BitStream.cs
- ParameterCollectionEditor.cs
- xmlfixedPageInfo.cs
- XsdBuilder.cs
- DtdParser.cs
- X509SecurityTokenAuthenticator.cs
- ActivatedMessageQueue.cs
- CatalogPart.cs
- _TLSstream.cs
- ComponentConverter.cs
- GPPOINTF.cs
- ProgressBarAutomationPeer.cs
- RootBrowserWindowAutomationPeer.cs
- ThreadStateException.cs
- StreamReader.cs
- XMLDiffLoader.cs
- OutputCacheEntry.cs
- ServicePrincipalNameElement.cs
- NegotiateStream.cs
- TextEndOfParagraph.cs
- SecurityContextTokenCache.cs
- EdmToObjectNamespaceMap.cs
- CallTemplateAction.cs
- IntSecurity.cs
- MeshGeometry3D.cs
- MenuItemAutomationPeer.cs
- RegexMatch.cs
- ExtensionElementCollection.cs
- ToolStripControlHost.cs
- Listbox.cs
- NativeStructs.cs
- AudioSignalProblemOccurredEventArgs.cs
- AdornerPresentationContext.cs
- Assert.cs
- DependencyPropertyValueSerializer.cs
- KeyConverter.cs
- UrlMappingCollection.cs
- XslCompiledTransform.cs
- MimeParameters.cs
- HandleRef.cs
- Message.cs
- AsymmetricKeyExchangeFormatter.cs
- HelpEvent.cs
- VerificationAttribute.cs
- LocalIdKeyIdentifierClause.cs
- ErrorStyle.cs
- Switch.cs
- DataGridViewDesigner.cs
- SiteMapDataSource.cs
- ConfigurationSchemaErrors.cs
- userdatakeys.cs
- ListBoxChrome.cs
- Nullable.cs
- X509ScopedServiceCertificateElement.cs
- Vector3DKeyFrameCollection.cs
- BrowserDefinitionCollection.cs
- SafeRightsManagementHandle.cs
- RadioButton.cs
- SignedXml.cs
- DbgCompiler.cs
- DataTableMappingCollection.cs
- InternalDuplexChannelFactory.cs
- FlowDocumentFormatter.cs