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
- TransactedReceiveData.cs
- CompositionAdorner.cs
- TextChange.cs
- MarkupExtensionParser.cs
- CallTemplateAction.cs
- DataGridComboBoxColumn.cs
- SharedUtils.cs
- SqlWriter.cs
- FloatUtil.cs
- ConfigurationHandlersInstallComponent.cs
- Decimal.cs
- InitializerFacet.cs
- PreProcessInputEventArgs.cs
- DetailsViewUpdatedEventArgs.cs
- SynchronizingStream.cs
- HtmlHistory.cs
- BasePropertyDescriptor.cs
- HandlerFactoryCache.cs
- ItemType.cs
- SafeFileMappingHandle.cs
- MethodBody.cs
- SolidBrush.cs
- RelationHandler.cs
- RestHandlerFactory.cs
- TCPClient.cs
- SqlUDTStorage.cs
- TraceProvider.cs
- AuthStoreRoleProvider.cs
- PersonalizationStateQuery.cs
- Cursors.cs
- TransformerInfoCollection.cs
- IisTraceWebEventProvider.cs
- Stylesheet.cs
- _TLSstream.cs
- StickyNoteHelper.cs
- GeneralTransform.cs
- StringValueConverter.cs
- TabControl.cs
- DataGridItemEventArgs.cs
- RegexInterpreter.cs
- XamlBrushSerializer.cs
- translator.cs
- WorkflowFormatterBehavior.cs
- PreservationFileReader.cs
- Type.cs
- HScrollProperties.cs
- CompositeFontInfo.cs
- InkPresenterAutomationPeer.cs
- XmlCDATASection.cs
- DynamicArgumentDesigner.xaml.cs
- AsymmetricKeyExchangeDeformatter.cs
- BidOverLoads.cs
- Dictionary.cs
- FormsAuthenticationTicket.cs
- ClosableStream.cs
- EntityContainerEmitter.cs
- EdmError.cs
- Menu.cs
- XamlContextStack.cs
- ThemeableAttribute.cs
- PopOutPanel.cs
- XsdCachingReader.cs
- VideoDrawing.cs
- HtmlEncodedRawTextWriter.cs
- PropertyChangingEventArgs.cs
- CompositeActivityValidator.cs
- ReachFixedDocumentSerializer.cs
- ListViewDeletedEventArgs.cs
- storepermission.cs
- TransactionValidationBehavior.cs
- HwndSource.cs
- Parameter.cs
- Lookup.cs
- AttachedAnnotationChangedEventArgs.cs
- TimeSpan.cs
- RightsManagementEncryptionTransform.cs
- RoutedEventArgs.cs
- DataGridViewRowConverter.cs
- EmbeddedMailObjectsCollection.cs
- CustomErrorsSectionWrapper.cs
- SettingsPropertyValue.cs
- DocumentXmlWriter.cs
- safePerfProviderHandle.cs
- CodePageEncoding.cs
- XmlNodeChangedEventManager.cs
- CodeSnippetExpression.cs
- ReadOnlyMetadataCollection.cs
- WebConfigurationHost.cs
- ViewManager.cs
- LayoutManager.cs
- AttachedAnnotationChangedEventArgs.cs
- TypeDefinition.cs
- PackageStore.cs
- MatrixCamera.cs
- DataFormats.cs
- SvcMapFileLoader.cs
- NetPeerTcpBinding.cs
- DbProviderFactories.cs
- RuleSettings.cs
- Button.cs