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
- NativeCompoundFileAPIs.cs
- ExceptionDetail.cs
- DataGridViewCellValidatingEventArgs.cs
- ToolstripProfessionalRenderer.cs
- WSSecureConversation.cs
- InternalResources.cs
- MediaPlayerState.cs
- SingletonChannelAcceptor.cs
- XmlSerializerNamespaces.cs
- ProviderConnectionPoint.cs
- X509UI.cs
- DataBindingHandlerAttribute.cs
- GroupItemAutomationPeer.cs
- HtmlCommandAdapter.cs
- OdbcDataAdapter.cs
- ItemChangedEventArgs.cs
- ExpressionBindings.cs
- XamlParser.cs
- StreamAsIStream.cs
- WsdlImporterElementCollection.cs
- FixedSOMTable.cs
- QueryTreeBuilder.cs
- OdbcConnectionPoolProviderInfo.cs
- StylusPointDescription.cs
- TextFormatterImp.cs
- SafeBitVector32.cs
- WizardForm.cs
- SizeChangedEventArgs.cs
- CellPartitioner.cs
- X509CertificateChain.cs
- ResourceDescriptionAttribute.cs
- Compilation.cs
- LabelDesigner.cs
- TabControl.cs
- WpfMemberInvoker.cs
- DesignerTransactionCloseEvent.cs
- MsmqIntegrationInputMessage.cs
- MemoryRecordBuffer.cs
- ScriptResourceAttribute.cs
- Timer.cs
- SelectedDatesCollection.cs
- InteropAutomationProvider.cs
- VisualBasicSettingsConverter.cs
- EmptyCollection.cs
- CounterSetInstanceCounterDataSet.cs
- SessionPageStatePersister.cs
- Point3DCollection.cs
- RedirectionProxy.cs
- InheritanceRules.cs
- TargetConverter.cs
- Type.cs
- ProfileInfo.cs
- DataGridCaption.cs
- ModelPerspective.cs
- HttpRequestWrapper.cs
- SourceLineInfo.cs
- DesignTimeTemplateParser.cs
- OracleException.cs
- TemplateBindingExpression.cs
- ConfigXmlCDataSection.cs
- Polygon.cs
- Bitmap.cs
- HttpValueCollection.cs
- XmlAttribute.cs
- OutputCacheModule.cs
- JavaScriptSerializer.cs
- SiteMapDesignerDataSourceView.cs
- DataControlLinkButton.cs
- XmlDocument.cs
- ElementHostAutomationPeer.cs
- ZeroOpNode.cs
- BorderGapMaskConverter.cs
- DesignerDeviceConfig.cs
- QueryGenerator.cs
- SqlConnectionHelper.cs
- CommandPlan.cs
- ParsedAttributeCollection.cs
- DoubleCollection.cs
- Label.cs
- DatatypeImplementation.cs
- DockProviderWrapper.cs
- RangeValueProviderWrapper.cs
- SelectionService.cs
- CanonicalFontFamilyReference.cs
- IndexOutOfRangeException.cs
- arabicshape.cs
- DashStyle.cs
- BitmapCodecInfo.cs
- PackagePartCollection.cs
- TargetInvocationException.cs
- CommandEventArgs.cs
- SynchronizationContext.cs
- TypeDescriptor.cs
- MeasureItemEvent.cs
- InvokePatternIdentifiers.cs
- HashAlgorithm.cs
- SevenBitStream.cs
- BitmapImage.cs
- Pointer.cs
- VScrollProperties.cs