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
- Duration.cs
- ZipIOExtraFieldZip64Element.cs
- HttpListenerRequest.cs
- MembershipUser.cs
- GlyphRunDrawing.cs
- XmlSchemaSimpleType.cs
- TraceData.cs
- OrderToken.cs
- ClientTarget.cs
- TypeResolver.cs
- DataGridViewColumn.cs
- HttpDictionary.cs
- TemplateBaseAction.cs
- LineServicesRun.cs
- ResourceDictionaryCollection.cs
- EpmContentSerializer.cs
- ComponentRenameEvent.cs
- HtmlInputHidden.cs
- XMLSchema.cs
- SqlCacheDependency.cs
- newitemfactory.cs
- BamlResourceSerializer.cs
- ExtendedProperty.cs
- ImmComposition.cs
- ReadOnlyCollection.cs
- ValidatorCollection.cs
- XmlNamedNodeMap.cs
- CustomValidator.cs
- DataGridViewCellFormattingEventArgs.cs
- PointConverter.cs
- InputEventArgs.cs
- LicenseContext.cs
- PropertyDescriptor.cs
- SmtpDateTime.cs
- XmlSchemaSimpleTypeUnion.cs
- OdbcErrorCollection.cs
- Input.cs
- CursorConverter.cs
- SqlInfoMessageEvent.cs
- SoapReflectionImporter.cs
- SystemUnicastIPAddressInformation.cs
- SerializableAttribute.cs
- ComplexTypeEmitter.cs
- WorkflowMessageEventHandler.cs
- SettingsContext.cs
- FrameworkContextData.cs
- ThreadStateException.cs
- TextTrailingWordEllipsis.cs
- ByteKeyFrameCollection.cs
- PersonalizablePropertyEntry.cs
- DataServiceQueryException.cs
- SourceElementsCollection.cs
- ResourceExpression.cs
- SyndicationItemFormatter.cs
- SamlAssertion.cs
- PackageDigitalSignature.cs
- BridgeDataReader.cs
- Evaluator.cs
- safemediahandle.cs
- SafeEventHandle.cs
- OpenTypeCommon.cs
- ConsoleTraceListener.cs
- Vector3D.cs
- OciEnlistContext.cs
- ColumnMapProcessor.cs
- XslAst.cs
- DragDropHelper.cs
- LocationEnvironment.cs
- DataGridPreparingCellForEditEventArgs.cs
- DrawItemEvent.cs
- TextServicesCompartmentEventSink.cs
- DataBinder.cs
- HtmlPhoneCallAdapter.cs
- ListViewSelectEventArgs.cs
- ExtensionElementCollection.cs
- RegionIterator.cs
- DocumentViewer.cs
- MessagePropertyVariants.cs
- TemplatePagerField.cs
- SerializationInfo.cs
- LinqDataSourceContextEventArgs.cs
- ApplicationCommands.cs
- TargetControlTypeAttribute.cs
- ExpandCollapseProviderWrapper.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- StorageScalarPropertyMapping.cs
- UpdatePanel.cs
- DataObjectAttribute.cs
- TableFieldsEditor.cs
- TypeSemantics.cs
- InstanceDescriptor.cs
- CookieProtection.cs
- DetailsViewDeletedEventArgs.cs
- ConnectionModeReader.cs
- DeflateStream.cs
- CanExecuteRoutedEventArgs.cs
- WeakReference.cs
- ActivityExecutionFilter.cs
- MenuCommand.cs
- QilIterator.cs