Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / SchemaConstraints.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RNGCryptoServiceProvider.cs
- CodePropertyReferenceExpression.cs
- XPathScanner.cs
- Resources.Designer.cs
- SQLMembershipProvider.cs
- PtsHost.cs
- SqlReferenceCollection.cs
- LineBreakRecord.cs
- QueryCreatedEventArgs.cs
- SystemIcmpV6Statistics.cs
- ImageField.cs
- XamlSerializationHelper.cs
- ScriptingRoleServiceSection.cs
- XsltInput.cs
- OleDbErrorCollection.cs
- SqlDelegatedTransaction.cs
- EmptyQuery.cs
- CheckBoxAutomationPeer.cs
- CodeComment.cs
- UIElementPropertyUndoUnit.cs
- RoutingExtension.cs
- PageThemeParser.cs
- SoundPlayerAction.cs
- ProxyElement.cs
- NeutralResourcesLanguageAttribute.cs
- MetadataUtil.cs
- StaticFileHandler.cs
- OleDbConnectionFactory.cs
- OleDbSchemaGuid.cs
- AdapterDictionary.cs
- AccessedThroughPropertyAttribute.cs
- StylusPoint.cs
- HttpPostProtocolImporter.cs
- FileSecurity.cs
- EditorPart.cs
- SecurityContext.cs
- AxHostDesigner.cs
- ResolveMatchesMessageCD1.cs
- SafeRightsManagementEnvironmentHandle.cs
- Application.cs
- OverrideMode.cs
- OleDbConnectionFactory.cs
- DataSetFieldSchema.cs
- XMLDiffLoader.cs
- Trace.cs
- BindingListCollectionView.cs
- NetworkInformationPermission.cs
- JavaScriptSerializer.cs
- WsiProfilesElementCollection.cs
- ConditionChanges.cs
- OracleTransaction.cs
- OracleCommandSet.cs
- FilterElement.cs
- WebPartsSection.cs
- MembershipPasswordException.cs
- HelpKeywordAttribute.cs
- Configuration.cs
- SQLRoleProvider.cs
- ScriptMethodAttribute.cs
- KeyFrames.cs
- WorkflowRuntimeSection.cs
- LeaseManager.cs
- SqlStream.cs
- Matrix3DConverter.cs
- HtmlButton.cs
- XmlSchemaAttributeGroupRef.cs
- ComponentSerializationService.cs
- SlipBehavior.cs
- ConnectionStringsExpressionBuilder.cs
- ConfigurationSectionHelper.cs
- TextRunProperties.cs
- COM2Properties.cs
- DesignerPainter.cs
- RelOps.cs
- CallContext.cs
- InternalConfigHost.cs
- DataGridSortCommandEventArgs.cs
- CompareValidator.cs
- ToolStripCustomTypeDescriptor.cs
- TransactionFlowBindingElementImporter.cs
- SplashScreenNativeMethods.cs
- HuffCodec.cs
- SiteMap.cs
- SecureStringHasher.cs
- FileDialogCustomPlace.cs
- ChameleonKey.cs
- GregorianCalendarHelper.cs
- ElementNotEnabledException.cs
- ClientBuildManager.cs
- HelpProvider.cs
- ProfileGroupSettingsCollection.cs
- PropertyIDSet.cs
- TemplatePagerField.cs
- XmlTypeAttribute.cs
- SystemColors.cs
- HttpServerUtilityWrapper.cs
- TransformerConfigurationWizardBase.cs
- XmlAttribute.cs
- CurrentTimeZone.cs
- SecurityManager.cs