Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / System / data / design / Source.cs / 1 / Source.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;
using System.Windows.Forms;
using System.Diagnostics;
///
///
internal abstract class Source: DataSourceComponent, IDataSourceNamedObject, ICloneable {
protected string name;
private MemberAttributes modifier;
protected DataSourceComponent owner;
private bool webMethod;
private string webMethodDescription;
private string userSourceName = null;
private string generatorSourceName = null;
private string generatorGetMethodName = null;
private string generatorSourceNameForPaging = null;
private string generatorGetMethodNameForPaging = null;
internal Source() {
modifier = MemberAttributes.Public;
}
[
DataSourceXmlAttribute(),
DefaultValue(false)
]
public bool EnableWebMethods {
get {
return this.webMethod;
}
set {
this.webMethod = value;
}
}
internal bool IsMainSource {
get {
DesignTable table = Owner as DesignTable;
return (table != null && table.MainSource == this);
}
}
[
DefaultValue(MemberAttributes.Public),
DataSourceXmlAttribute()
]
public MemberAttributes Modifier {
get {
return modifier;
}
set {
modifier = value;
}
}
///
///
[
DefaultValue(""),
DataSourceXmlAttribute(),
MergableProperty(false)
]
public virtual string Name{
get{
return name;
}
set{
if (name != value) {
if (this.CollectionParent != null) {
this.CollectionParent.ValidateUniqueName (this, value);
}
name = value;
}
}
}
///
/// Displayed in the Table Control with signature, different with that in the property grid
///
internal virtual string DisplayName {
get {
return Name;
}
set {
}
}
///
/// This is the reference to a DesignTable or DesignDataSource that owns this source.
/// Only one DataSourceComponent at a time can own a given source.
///
[Browsable(false)]
internal DataSourceComponent Owner {
get {
if (this.owner == null) {
// check to see we can find the owner from parent
if (this.CollectionParent != null) {
SourceCollection collection = this.CollectionParent as SourceCollection;
Debug.Assert (collection != null, " Source is not in a SourceCollection?");
if (collection != null) {
this.owner = (DataSourceComponent)collection.CollectionHost;
}
}
}
return this.owner;
}
set {
Debug.Assert( value == null || value is DesignTable || value is DesignDataSource );
this.owner = value;
}
}
[Browsable(false)]
public virtual string PublicTypeName {
get {
return "Function";
}
}
[
DataSourceXmlAttribute(),
DefaultValue("")
]
public string WebMethodDescription {
get{
return this.webMethodDescription;
}
set {
this.webMethodDescription = value;
}
}
public abstract object Clone();
///
/// Compare the source by name
///
///
///
internal virtual bool NameExist(string nameToCheck) {
Debug.Assert(StringUtil.NotEmptyAfterTrim(nameToCheck));
return StringUtil.EqualValue(this.Name, nameToCheck, true /*CaseInsensitive*/);
}
///
/// IDataSourceCollectionMember implementation
///
public override void SetCollection(DataSourceCollectionBase collection) {
base.SetCollection(collection);
if (collection != null) {
Debug.Assert(collection is SourceCollection);
this.Owner = (DataSourceComponent)collection.CollectionHost; // Might be null
}
else {
this.Owner = null;
}
}
public override string ToString() {
return this.PublicTypeName + " " + this.DisplayName;
}
[DataSourceXmlAttribute(), Browsable (false), DefaultValue(null)]
public string UserSourceName {
get {
return userSourceName;
}
set {
userSourceName = value;
}
}
[DataSourceXmlAttribute(), Browsable (false), DefaultValue(null)]
public string GeneratorSourceName {
get {
return generatorSourceName;
}
set {
generatorSourceName = value;
}
}
[DataSourceXmlAttribute(), Browsable (false), DefaultValue(null)]
public string GeneratorGetMethodName {
get {
return generatorGetMethodName;
}
set {
generatorGetMethodName = value;
}
}
[DataSourceXmlAttribute(), Browsable (false), DefaultValue(null)]
public string GeneratorSourceNameForPaging {
get {
return generatorSourceNameForPaging;
}
set {
generatorSourceNameForPaging = value;
}
}
[DataSourceXmlAttribute(), Browsable (false), DefaultValue(null)]
public string GeneratorGetMethodNameForPaging {
get {
return generatorGetMethodNameForPaging;
}
set {
generatorGetMethodNameForPaging = value;
}
}
// IDataSourceRenamableObject implementation
[Browsable(false)]
public override string GeneratorName {
get {
return GeneratorSourceName;
}
}
}
}
// 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
- ImageBrush.cs
- SkinBuilder.cs
- TimeManager.cs
- OracleParameterCollection.cs
- SQLBytesStorage.cs
- DesignerActionVerbItem.cs
- FileEnumerator.cs
- AutomationElementCollection.cs
- ApplyImportsAction.cs
- BindableTemplateBuilder.cs
- LockCookie.cs
- CollectionMarkupSerializer.cs
- FixedStringLookup.cs
- EntityCommandCompilationException.cs
- PersonalizationStateInfo.cs
- Header.cs
- InkPresenterAutomationPeer.cs
- StylusOverProperty.cs
- RtfControlWordInfo.cs
- BackEase.cs
- ProcessInfo.cs
- DocumentSchemaValidator.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SqlDataReader.cs
- DirectionalLight.cs
- ModelVisual3D.cs
- EncodingDataItem.cs
- FixedSOMPageConstructor.cs
- ErrorHandlerFaultInfo.cs
- DataGridViewCellConverter.cs
- TraceInternal.cs
- UnsafeNativeMethods.cs
- MinimizableAttributeTypeConverter.cs
- UserInitiatedNavigationPermission.cs
- OracleNumber.cs
- FlowDocumentReaderAutomationPeer.cs
- MachineKey.cs
- TrustManagerPromptUI.cs
- ClientEventManager.cs
- UnmanagedMemoryStreamWrapper.cs
- UnsafeNetInfoNativeMethods.cs
- SecurityTokenProvider.cs
- EvidenceTypeDescriptor.cs
- InheritedPropertyChangedEventArgs.cs
- XmlQueryType.cs
- ExtentKey.cs
- CodePropertyReferenceExpression.cs
- AttributeTableBuilder.cs
- SourceFileInfo.cs
- TabControlCancelEvent.cs
- ListMarkerLine.cs
- ProvidersHelper.cs
- AccessViolationException.cs
- _AutoWebProxyScriptHelper.cs
- PropertyChangedEventArgs.cs
- XmlBinaryReader.cs
- PolyLineSegment.cs
- EncryptedReference.cs
- AppSecurityManager.cs
- DataMemberFieldEditor.cs
- OuterGlowBitmapEffect.cs
- Item.cs
- PathFigureCollection.cs
- ParameterModifier.cs
- DataControlField.cs
- RequestCacheEntry.cs
- MemoryMappedView.cs
- XmlAttribute.cs
- linebase.cs
- PositiveTimeSpanValidator.cs
- WorkflowEventArgs.cs
- Descriptor.cs
- ProcessActivityTreeOptions.cs
- StateRuntime.cs
- TextElementEnumerator.cs
- HeaderCollection.cs
- AttachedAnnotationChangedEventArgs.cs
- XmlSchemaAttributeGroupRef.cs
- PropertyGroupDescription.cs
- InstanceLockException.cs
- _NetworkingPerfCounters.cs
- ErrorWebPart.cs
- TimerExtension.cs
- InstanceOwnerQueryResult.cs
- WebContext.cs
- _NegotiateClient.cs
- EncryptedKeyHashIdentifierClause.cs
- PixelFormats.cs
- ScaleTransform.cs
- GridViewSelectEventArgs.cs
- Base64Encoder.cs
- datacache.cs
- IPEndPointCollection.cs
- PersistenceMetadataNamespace.cs
- CultureInfoConverter.cs
- DependencyProperty.cs
- TypeElement.cs
- ListItemConverter.cs
- StoryFragments.cs
- FileUtil.cs