Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / RelationHandler.cs / 2 / RelationHandler.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
// Information Contained Herein is Proprietary and Confidential.
//
//-----------------------------------------------------------------------------
namespace System.Data.Design {
using System;
using System.CodeDom;
using System.Collections;
using System.ComponentModel;
using System.Data;
internal sealed class RelationHandler {
private TypedDataSourceCodeGenerator codeGenerator = null;
private DesignRelationCollection relations = null;
internal RelationHandler(TypedDataSourceCodeGenerator codeGenerator, DesignRelationCollection relations) {
this.codeGenerator = codeGenerator;
this.relations = relations;
}
internal DesignRelationCollection Relations {
get {
return relations;
}
}
internal void AddPrivateVars(CodeTypeDeclaration dataSourceClass) {
if(dataSourceClass == null) {
throw new InternalException("DataSource CodeTypeDeclaration should not be null.");
}
if( relations == null ) {
return;
}
foreach(DesignRelation relation in relations) {
if(relation.DataRelation != null) {
//\\ private DataRelation
string relationVariableName = relation.GeneratorRelationVarName;
dataSourceClass.Members.Add( CodeGenHelper.FieldDecl(CodeGenHelper.GlobalType(typeof(System.Data.DataRelation)), relationVariableName) );
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompilerState.cs
- ValidatorCollection.cs
- ScalarOps.cs
- ZipIOModeEnforcingStream.cs
- DbSourceCommand.cs
- HttpApplicationFactory.cs
- Logging.cs
- DoubleIndependentAnimationStorage.cs
- COM2TypeInfoProcessor.cs
- ChangeProcessor.cs
- RequestCachingSection.cs
- MediaEntryAttribute.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ProxyGenerationError.cs
- WindowsRichEdit.cs
- BitmapPalettes.cs
- EventlogProvider.cs
- Filter.cs
- MutexSecurity.cs
- RemotingSurrogateSelector.cs
- SecurityPolicySection.cs
- XmlHierarchyData.cs
- BitmapDecoder.cs
- ActivityExecutorSurrogate.cs
- PngBitmapDecoder.cs
- ColorAnimation.cs
- DescendantQuery.cs
- codemethodreferenceexpression.cs
- FacetEnabledSchemaElement.cs
- XmlSchemaDatatype.cs
- WindowsTokenRoleProvider.cs
- BCLDebug.cs
- SqlDataSourceCommandEventArgs.cs
- GiveFeedbackEvent.cs
- WebPartConnectionsCancelEventArgs.cs
- DiscreteKeyFrames.cs
- FileRecordSequence.cs
- KerberosTicketHashIdentifierClause.cs
- CodeValidator.cs
- XmlUtil.cs
- Polyline.cs
- NavigationExpr.cs
- FacetDescriptionElement.cs
- xmlglyphRunInfo.cs
- SettingsSection.cs
- ScrollItemPatternIdentifiers.cs
- TextCharacters.cs
- UIElement3DAutomationPeer.cs
- TextParaClient.cs
- FamilyTypeface.cs
- TextServicesCompartment.cs
- InkSerializer.cs
- SmiRecordBuffer.cs
- Speller.cs
- CodeStatementCollection.cs
- ParenthesizePropertyNameAttribute.cs
- LayoutEditorPart.cs
- Listen.cs
- AuthenticationException.cs
- ObjectQuery.cs
- PlanCompiler.cs
- DataGridColumnFloatingHeader.cs
- EnterpriseServicesHelper.cs
- PathGeometry.cs
- SectionXmlInfo.cs
- DataList.cs
- CacheSection.cs
- KnownBoxes.cs
- DataSourceView.cs
- PasswordBoxAutomationPeer.cs
- DragEventArgs.cs
- CapabilitiesUse.cs
- DeclarativeCatalogPart.cs
- LicenseContext.cs
- LongMinMaxAggregationOperator.cs
- CompilationUtil.cs
- PageContent.cs
- LinearGradientBrush.cs
- CurrentChangedEventManager.cs
- _UncName.cs
- ListItemConverter.cs
- OutputCacheProfile.cs
- XmlBuffer.cs
- EventlogProvider.cs
- RenderingEventArgs.cs
- Compress.cs
- XmlException.cs
- RectAnimationClockResource.cs
- InputLangChangeEvent.cs
- EventsTab.cs
- DependencyPropertyHelper.cs
- _SingleItemRequestCache.cs
- MobileRedirect.cs
- TaskCanceledException.cs
- FrameworkElement.cs
- TextSelectionHighlightLayer.cs
- HwndMouseInputProvider.cs
- QueryCacheManager.cs
- FillBehavior.cs
- GridToolTip.cs