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
- ServiceDescription.cs
- SqlTypesSchemaImporter.cs
- Point3D.cs
- VisualStyleInformation.cs
- InstanceCreationEditor.cs
- TextEffectCollection.cs
- ColumnPropertiesGroup.cs
- SourceFilter.cs
- CustomValidator.cs
- ByteViewer.cs
- IndexingContentUnit.cs
- DataGridViewRowsAddedEventArgs.cs
- SrgsDocument.cs
- RowParagraph.cs
- EditorPartDesigner.cs
- XmlQualifiedNameTest.cs
- WebPartHeaderCloseVerb.cs
- SimpleRecyclingCache.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SoapSchemaMember.cs
- EventEntry.cs
- DesignerListAdapter.cs
- SqlFunctions.cs
- ContainerControlDesigner.cs
- AlternateView.cs
- UpdateCommand.cs
- SchemaInfo.cs
- Mapping.cs
- XmlHierarchicalDataSourceView.cs
- FrameworkReadOnlyPropertyMetadata.cs
- LogExtent.cs
- _BasicClient.cs
- WorkflowViewManager.cs
- Int32Converter.cs
- TransformProviderWrapper.cs
- Shared.cs
- MatrixCamera.cs
- XmlDataSource.cs
- base64Transforms.cs
- CreateUserErrorEventArgs.cs
- TraceLevelStore.cs
- Geometry3D.cs
- CalendarDay.cs
- PackageRelationship.cs
- EventMappingSettingsCollection.cs
- XmlSchemaAttributeGroupRef.cs
- TemplateBindingExpression.cs
- ValueChangedEventManager.cs
- EmptyQuery.cs
- TdsValueSetter.cs
- AccessDataSourceView.cs
- TextElementEnumerator.cs
- ServicePointManagerElement.cs
- DropDownList.cs
- LogicalChannelCollection.cs
- NamespaceCollection.cs
- HWStack.cs
- Matrix.cs
- MessageSecurityOverMsmqElement.cs
- CodeStatementCollection.cs
- TreeViewItemAutomationPeer.cs
- DecimalSumAggregationOperator.cs
- TypedReference.cs
- RadioButton.cs
- securitycriticaldataformultiplegetandset.cs
- DynamicDiscoveryDocument.cs
- SqlUserDefinedAggregateAttribute.cs
- StyleTypedPropertyAttribute.cs
- Errors.cs
- DataKeyArray.cs
- OleDbDataAdapter.cs
- SyndicationItemFormatter.cs
- LabelEditEvent.cs
- EndpointConfigContainer.cs
- _ListenerAsyncResult.cs
- AuthorizationSection.cs
- _ProxyChain.cs
- ReceiveCompletedEventArgs.cs
- ConfigurationManagerInternalFactory.cs
- HtmlEncodedRawTextWriter.cs
- DiagnosticsConfiguration.cs
- ToolboxItemAttribute.cs
- DataGridViewCellParsingEventArgs.cs
- CachingHintValidation.cs
- ComponentConverter.cs
- GorillaCodec.cs
- VectorConverter.cs
- GestureRecognizer.cs
- EmptyStringExpandableObjectConverter.cs
- Gdiplus.cs
- XmlElementList.cs
- ColumnHeader.cs
- FilterRepeater.cs
- TriggerCollection.cs
- TypographyProperties.cs
- XmlCharType.cs
- WebPartZoneAutoFormat.cs
- ValueOfAction.cs
- VariableQuery.cs
- DataGridLinkButton.cs