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 / SchemaConstraints.cs / 2 / SchemaConstraints.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Common.Utils;
using System.Collections.Generic;
using System.Text;
namespace System.Data.Mapping.ViewGeneration.Validation {
///
/// A class representing a set of constraints. It uses generic parameters
/// so that we can get strong typing and avoid downcasts
///
internal class SchemaConstraints : InternalBase
where TKeyConstraint : InternalBase {
#region Constructor
// effects: Creates an empty set of constraints
internal SchemaConstraints() {
m_keyConstraints = new List();
}
#endregion
#region Fields
// Use different lists so we can enumerate the right kind of constraints
private List m_keyConstraints;
#endregion
#region Properties
internal IEnumerable KeyConstraints {
get { return m_keyConstraints; }
}
#endregion
#region Methods
// effects: Adds a key constraint to this
internal void Add(TKeyConstraint constraint) {
EntityUtil.CheckArgumentNull(constraint, "constraint");
m_keyConstraints.Add(constraint);
}
// effects: Converts constraints to human-readable strings and adds them to builder
private static void ConstraintsToBuilder(IEnumerable constraints, StringBuilder builder)
where Constraint : InternalBase {
foreach (Constraint constraint in constraints) {
constraint.ToCompactString(builder);
builder.Append(Environment.NewLine);
}
}
internal override void ToCompactString(StringBuilder builder) {
ConstraintsToBuilder(m_keyConstraints, builder);
}
#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;
namespace System.Data.Mapping.ViewGeneration.Validation {
///
/// A class representing a set of constraints. It uses generic parameters
/// so that we can get strong typing and avoid downcasts
///
internal class SchemaConstraints : InternalBase
where TKeyConstraint : InternalBase {
#region Constructor
// effects: Creates an empty set of constraints
internal SchemaConstraints() {
m_keyConstraints = new List();
}
#endregion
#region Fields
// Use different lists so we can enumerate the right kind of constraints
private List m_keyConstraints;
#endregion
#region Properties
internal IEnumerable KeyConstraints {
get { return m_keyConstraints; }
}
#endregion
#region Methods
// effects: Adds a key constraint to this
internal void Add(TKeyConstraint constraint) {
EntityUtil.CheckArgumentNull(constraint, "constraint");
m_keyConstraints.Add(constraint);
}
// effects: Converts constraints to human-readable strings and adds them to builder
private static void ConstraintsToBuilder(IEnumerable constraints, StringBuilder builder)
where Constraint : InternalBase {
foreach (Constraint constraint in constraints) {
constraint.ToCompactString(builder);
builder.Append(Environment.NewLine);
}
}
internal override void ToCompactString(StringBuilder builder) {
ConstraintsToBuilder(m_keyConstraints, builder);
}
#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
- SoapCommonClasses.cs
- StateDesigner.LayoutSelectionGlyph.cs
- InheritanceRules.cs
- ClientBuildManager.cs
- TreeNodeCollection.cs
- IFlowDocumentViewer.cs
- DynamicContractTypeBuilder.cs
- Int64Converter.cs
- QilChoice.cs
- AvTrace.cs
- DesignerActionItem.cs
- TextSelectionHighlightLayer.cs
- ContextMenu.cs
- TypeContext.cs
- Transactions.cs
- AnimationException.cs
- QilNode.cs
- IdentityReference.cs
- XPathParser.cs
- Compiler.cs
- XmlSerializerNamespaces.cs
- SqlDependencyListener.cs
- EntityTemplateUserControl.cs
- ReadOnlyDictionary.cs
- UIntPtr.cs
- TextMarkerSource.cs
- XsdBuilder.cs
- SingleAnimationBase.cs
- TextTrailingCharacterEllipsis.cs
- CustomError.cs
- ColorInterpolationModeValidation.cs
- WebBrowserNavigatingEventHandler.cs
- RMEnrollmentPage1.cs
- BamlLocalizationDictionary.cs
- FirstMatchCodeGroup.cs
- Timeline.cs
- WinCategoryAttribute.cs
- WebPartDisplayModeCollection.cs
- SqlLiftIndependentRowExpressions.cs
- ContextProperty.cs
- TableRow.cs
- BCLDebug.cs
- TextBox.cs
- SqlCommand.cs
- TreeView.cs
- BaseDataList.cs
- ValidationSummary.cs
- SoapReflectionImporter.cs
- HostingMessageProperty.cs
- ActionNotSupportedException.cs
- followingquery.cs
- StructuredType.cs
- CatalogPartCollection.cs
- SemanticResultValue.cs
- CodeDOMUtility.cs
- WmlImageAdapter.cs
- ScrollBarRenderer.cs
- ColorConvertedBitmap.cs
- webbrowsersite.cs
- HistoryEventArgs.cs
- ClrProviderManifest.cs
- NetCodeGroup.cs
- InternalConfigEventArgs.cs
- PriorityBindingExpression.cs
- CompositionTarget.cs
- ToolStripComboBox.cs
- CrossAppDomainChannel.cs
- CompiledELinqQueryState.cs
- EditingCoordinator.cs
- NumberFormatInfo.cs
- PreviewKeyDownEventArgs.cs
- NameTable.cs
- SchemaMapping.cs
- ControlBuilder.cs
- RequestValidator.cs
- QuaternionIndependentAnimationStorage.cs
- Common.cs
- XPathScanner.cs
- CodeMemberField.cs
- ExtentKey.cs
- DecimalAnimationUsingKeyFrames.cs
- LabelDesigner.cs
- SplitContainer.cs
- CanExecuteRoutedEventArgs.cs
- CryptoStream.cs
- PenContext.cs
- streamingZipPartStream.cs
- RoleGroup.cs
- DecimalAnimationUsingKeyFrames.cs
- BitmapDecoder.cs
- DataGridPagerStyle.cs
- RuntimeConfigLKG.cs
- XmlTextWriter.cs
- SystemGatewayIPAddressInformation.cs
- FilterQueryOptionExpression.cs
- CommonProperties.cs
- contentDescriptor.cs
- DataControlButton.cs
- Tracking.cs
- Int32KeyFrameCollection.cs