Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ClientFormsAuthenticationCredentials.cs
- BitmapEffectrendercontext.cs
- precedingsibling.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ReadOnlyPropertyMetadata.cs
- ObjectTypeMapping.cs
- TextDecorationCollectionConverter.cs
- ContainerActivationHelper.cs
- EtwTrace.cs
- DataList.cs
- TypeInitializationException.cs
- updateconfighost.cs
- ObjectParameterCollection.cs
- PropertyEmitterBase.cs
- FileNotFoundException.cs
- WeakReferenceEnumerator.cs
- AsymmetricKeyExchangeFormatter.cs
- TransformDescriptor.cs
- Lasso.cs
- FormViewPageEventArgs.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ProfileSettingsCollection.cs
- WindowAutomationPeer.cs
- ContentPlaceHolder.cs
- TemplateAction.cs
- WebPartConnectVerb.cs
- TextBoxAutoCompleteSourceConverter.cs
- SoapReflectionImporter.cs
- BooleanKeyFrameCollection.cs
- ScopedKnownTypes.cs
- ProfileGroupSettings.cs
- QueryCacheKey.cs
- ExceptionValidationRule.cs
- ReadOnlyPropertyMetadata.cs
- OleDbParameterCollection.cs
- MetadataItemEmitter.cs
- CapabilitiesRule.cs
- NumberFormatter.cs
- MessagingDescriptionAttribute.cs
- DataControlField.cs
- DataObject.cs
- EventBuilder.cs
- WindowsIdentity.cs
- ReflectionUtil.cs
- _Events.cs
- BackoffTimeoutHelper.cs
- HttpServerUtilityWrapper.cs
- DataGridItemCollection.cs
- JsonUriDataContract.cs
- TraceInternal.cs
- TextStore.cs
- JoinSymbol.cs
- LiteralControl.cs
- StateMachineWorkflow.cs
- TablePattern.cs
- ConnectionStringsSection.cs
- ObjectKeyFrameCollection.cs
- ProtocolsConfigurationHandler.cs
- HostProtectionException.cs
- XhtmlBasicLiteralTextAdapter.cs
- MultiBinding.cs
- Vector3DIndependentAnimationStorage.cs
- Axis.cs
- VerificationAttribute.cs
- EmptyReadOnlyDictionaryInternal.cs
- AttributeQuery.cs
- EncodingInfo.cs
- DataGridViewRow.cs
- TextRangeEditTables.cs
- OdbcError.cs
- XmlToDatasetMap.cs
- FrameworkPropertyMetadata.cs
- MethodMessage.cs
- PocoEntityKeyStrategy.cs
- PointAnimation.cs
- PeerTransportListenAddressValidator.cs
- TreeViewDesigner.cs
- Hex.cs
- CommandConverter.cs
- ReferencedCollectionType.cs
- StylusCaptureWithinProperty.cs
- PropertyValueUIItem.cs
- PickBranchDesigner.xaml.cs
- Funcletizer.cs
- BamlTreeUpdater.cs
- IPHostEntry.cs
- EventItfInfo.cs
- SQLChars.cs
- WizardStepBase.cs
- NetTcpSection.cs
- DefaultDialogButtons.cs
- CharacterMetrics.cs
- Part.cs
- DataContractAttribute.cs
- CodeTryCatchFinallyStatement.cs
- JsonFormatWriterGenerator.cs
- UInt64Converter.cs
- InstanceCreationEditor.cs
- DecimalConverter.cs
- OdbcPermission.cs