Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Validation / SchemaConstraints.cs / 1 / 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
- Menu.cs
- HttpProfileGroupBase.cs
- HttpDebugHandler.cs
- ComponentCommands.cs
- SimpleBitVector32.cs
- MatrixConverter.cs
- MasterPageCodeDomTreeGenerator.cs
- TargetFrameworkUtil.cs
- QueryInterceptorAttribute.cs
- ControllableStoryboardAction.cs
- TypeConverterMarkupExtension.cs
- TableLayoutColumnStyleCollection.cs
- Constraint.cs
- UnknownBitmapDecoder.cs
- CookieProtection.cs
- XmlSchemaChoice.cs
- XmlHierarchyData.cs
- CodeStatementCollection.cs
- ISessionStateStore.cs
- SwitchAttribute.cs
- BCLDebug.cs
- SettingsAttributeDictionary.cs
- RijndaelManaged.cs
- ZoneLinkButton.cs
- SiteOfOriginPart.cs
- EditorZoneBase.cs
- PatternMatcher.cs
- ExpressionBindings.cs
- Configuration.cs
- ViewManager.cs
- DoubleKeyFrameCollection.cs
- RevocationPoint.cs
- CacheRequest.cs
- Nullable.cs
- SqlUserDefinedAggregateAttribute.cs
- FixedSOMLineCollection.cs
- TextEffectCollection.cs
- OdbcEnvironment.cs
- SqlAggregateChecker.cs
- SaveFileDialogDesigner.cs
- TextHidden.cs
- Visual3D.cs
- ADMembershipProvider.cs
- ResetableIterator.cs
- SoapMessage.cs
- APCustomTypeDescriptor.cs
- AnnotationStore.cs
- EdmMember.cs
- FigureParaClient.cs
- COAUTHIDENTITY.cs
- XmlArrayItemAttribute.cs
- DesignerTextWriter.cs
- GCHandleCookieTable.cs
- Size3D.cs
- ConvertersCollection.cs
- RowType.cs
- XmlIlTypeHelper.cs
- SchemaImporterExtensionElementCollection.cs
- Transform.cs
- FileDialogCustomPlace.cs
- CharEntityEncoderFallback.cs
- GeometryConverter.cs
- DataGridViewEditingControlShowingEventArgs.cs
- PasswordBox.cs
- OleDbConnection.cs
- XmlProcessingInstruction.cs
- CloudCollection.cs
- FixedTextPointer.cs
- SystemFonts.cs
- SvcMapFileLoader.cs
- __Filters.cs
- WebPartZoneBaseDesigner.cs
- FormConverter.cs
- FontFamilyValueSerializer.cs
- _StreamFramer.cs
- VectorConverter.cs
- SecurityDocument.cs
- Timer.cs
- TextSegment.cs
- ValidationErrorCollection.cs
- DataGridViewDataErrorEventArgs.cs
- StorageBasedPackageProperties.cs
- OracleDataAdapter.cs
- TemplateContainer.cs
- BulletedList.cs
- ConfigurationException.cs
- DataGridViewToolTip.cs
- DemultiplexingClientMessageFormatter.cs
- TransformerTypeCollection.cs
- ScrollEvent.cs
- x509utils.cs
- DataSetUtil.cs
- SortQueryOperator.cs
- Certificate.cs
- RemotingException.cs
- GenericXmlSecurityToken.cs
- IDQuery.cs
- RepeaterCommandEventArgs.cs
- OleDbConnectionInternal.cs
- ConfigurationManagerInternalFactory.cs