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
- SqlFactory.cs
- DataColumnPropertyDescriptor.cs
- IntMinMaxAggregationOperator.cs
- SafeLibraryHandle.cs
- ProviderCollection.cs
- StorageAssociationSetMapping.cs
- XmlText.cs
- CallbackHandler.cs
- PropertyChangingEventArgs.cs
- EntityReference.cs
- ByteKeyFrameCollection.cs
- ExtentCqlBlock.cs
- SessionPageStateSection.cs
- FixedFindEngine.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- DropAnimation.xaml.cs
- CurrencyWrapper.cs
- RootBrowserWindowAutomationPeer.cs
- StyleCollection.cs
- MergablePropertyAttribute.cs
- StylusPointPropertyId.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- PropertyBuilder.cs
- WindowsSlider.cs
- HtmlElementErrorEventArgs.cs
- LayoutInformation.cs
- Menu.cs
- WebResourceAttribute.cs
- ReferenceConverter.cs
- ConfigurationElementProperty.cs
- DataTransferEventArgs.cs
- SafeFileHandle.cs
- TextAnchor.cs
- CodeParameterDeclarationExpressionCollection.cs
- ToolboxBitmapAttribute.cs
- EventBuilder.cs
- SystemNetworkInterface.cs
- RoutedEventValueSerializer.cs
- ConfigPathUtility.cs
- ExecutionEngineException.cs
- TypedReference.cs
- ZipIORawDataFileBlock.cs
- InvalidAsynchronousStateException.cs
- COMException.cs
- DataGridViewBindingCompleteEventArgs.cs
- Pair.cs
- EntityDataSourceDesigner.cs
- SafeViewOfFileHandle.cs
- RowParagraph.cs
- IndicFontClient.cs
- _BasicClient.cs
- AbstractSvcMapFileLoader.cs
- GeneralTransform3D.cs
- SqlConnectionString.cs
- LocalizeDesigner.cs
- PerspectiveCamera.cs
- InputDevice.cs
- PackagePartCollection.cs
- UpdateTracker.cs
- StringCollection.cs
- InvokeBinder.cs
- LockCookie.cs
- Util.cs
- TableCell.cs
- CompModSwitches.cs
- XmlNodeReader.cs
- NegotiateStream.cs
- SelectionHighlightInfo.cs
- Base64Encoder.cs
- SqlCommandSet.cs
- IisTraceWebEventProvider.cs
- StrokeNodeOperations2.cs
- TerminatorSinks.cs
- DbConnectionInternal.cs
- RemoteCryptoTokenProvider.cs
- PropertyChangingEventArgs.cs
- HttpPostedFile.cs
- DefaultParameterValueAttribute.cs
- GridViewUpdateEventArgs.cs
- SoapAttributeOverrides.cs
- QueryContinueDragEvent.cs
- SafeSerializationManager.cs
- Bold.cs
- AspCompat.cs
- JsonDeserializer.cs
- TreeNodeStyleCollection.cs
- EndOfStreamException.cs
- AmbientValueAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Baml2006SchemaContext.cs
- ListSortDescription.cs
- bindurihelper.cs
- CreateUserErrorEventArgs.cs
- ContainerActivationHelper.cs
- MDIControlStrip.cs
- MemberDescriptor.cs
- RelationshipSet.cs
- XPathNodeList.cs
- XmlReturnWriter.cs