Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / KeyConstraint.cs / 1305376 / 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
- BufferedStream2.cs
- ThreadInterruptedException.cs
- ZipPackage.cs
- EventBuilder.cs
- StringConcat.cs
- IndicShape.cs
- NameValuePair.cs
- StrokeSerializer.cs
- DrawingCollection.cs
- QilLiteral.cs
- SqlInternalConnection.cs
- RepeaterItemEventArgs.cs
- DataGridViewColumnEventArgs.cs
- PropertyTab.cs
- CapabilitiesRule.cs
- SecurityContextTokenCache.cs
- UnicastIPAddressInformationCollection.cs
- DataControlLinkButton.cs
- SqlCommandBuilder.cs
- UrlRoutingHandler.cs
- UseLicense.cs
- InvalidFilterCriteriaException.cs
- BindingOperations.cs
- GenericArgumentsUpdater.cs
- HGlobalSafeHandle.cs
- IsolatedStorageFileStream.cs
- FieldToken.cs
- GridViewCellAutomationPeer.cs
- PersonalizationProviderCollection.cs
- VisualProxy.cs
- DomainUpDown.cs
- CodeArrayIndexerExpression.cs
- NamedPipeTransportSecurity.cs
- UInt32Storage.cs
- FullTextState.cs
- SendMessageRecord.cs
- _HeaderInfoTable.cs
- RemoteWebConfigurationHost.cs
- LocalizableResourceBuilder.cs
- SamlAuthenticationClaimResource.cs
- ObjectStateEntry.cs
- EntityStoreSchemaFilterEntry.cs
- EventMappingSettings.cs
- BooleanToVisibilityConverter.cs
- OleStrCAMarshaler.cs
- CacheHelper.cs
- DBBindings.cs
- XmlNamespaceManager.cs
- NetCodeGroup.cs
- MimeMapping.cs
- ObjectAnimationBase.cs
- DataObjectFieldAttribute.cs
- DataGridViewToolTip.cs
- ScrollChrome.cs
- CodeTypeReference.cs
- EFDataModelProvider.cs
- BrowserCapabilitiesCompiler.cs
- PropertyTabChangedEvent.cs
- WebPartTransformer.cs
- MatcherBuilder.cs
- HtmlControlAdapter.cs
- InvariantComparer.cs
- Stroke.cs
- EdmToObjectNamespaceMap.cs
- ConfigurationFileMap.cs
- DataColumnMappingCollection.cs
- HostingPreferredMapPath.cs
- DataGridViewImageColumn.cs
- CodeArrayCreateExpression.cs
- FaultDesigner.cs
- UpDownEvent.cs
- HelpProvider.cs
- HttpServerUtilityWrapper.cs
- HwndHostAutomationPeer.cs
- SchemaMapping.cs
- HwndHostAutomationPeer.cs
- RemoteWebConfigurationHostServer.cs
- DictionaryManager.cs
- XmlNullResolver.cs
- SingleObjectCollection.cs
- PointF.cs
- DeleteIndexBinder.cs
- LogArchiveSnapshot.cs
- BinaryFormatter.cs
- TableColumn.cs
- QuadraticBezierSegment.cs
- QueryComponents.cs
- EntityObject.cs
- EntitySqlQueryState.cs
- InstrumentationTracker.cs
- MiniAssembly.cs
- PropertyGeneratedEventArgs.cs
- PlatformCulture.cs
- ResourcesGenerator.cs
- CfgArc.cs
- ReturnType.cs
- UiaCoreTypesApi.cs
- LinkDescriptor.cs
- ResolveMatchesMessage11.cs
- DataGridViewControlCollection.cs