Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameItem.cs / 1305376 / EntityDataSourceContainerNameItem.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //----------------------------------------------------------------------------- using System.Data.Metadata.Edm; using System.Diagnostics; namespace System.Web.UI.Design.WebControls { internal class EntityDataSourceContainerNameItem : IComparable{ // Only one of the following should be set. This is enforced through the constructors and the fact that these fields are readonly. private readonly EntityContainer _entityContainer; // used when we have a real EntityContainer backing this item private readonly string _unknownContainerName; // used when we have an unknown DefaultContainerName that we still want to include in the list internal EntityDataSourceContainerNameItem(EntityContainer entityContainer) { Debug.Assert(entityContainer != null, "null entityContainer"); _entityContainer = entityContainer; } internal EntityDataSourceContainerNameItem(string unknownContainerName) { Debug.Assert(!String.IsNullOrEmpty(unknownContainerName), "null or empty unknownContainerName"); _unknownContainerName = unknownContainerName; } internal string EntityContainerName { get { if (_entityContainer != null) { return _entityContainer.Name; } else { return _unknownContainerName; } } } internal EntityContainer EntityContainer { get { // may be null if this represents an unknown container return _entityContainer; } } public override string ToString() { return this.EntityContainerName; } int IComparable .CompareTo(EntityDataSourceContainerNameItem other) { return (String.Compare(this.EntityContainerName, other.EntityContainerName, StringComparison.OrdinalIgnoreCase)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //----------------------------------------------------------------------------- using System.Data.Metadata.Edm; using System.Diagnostics; namespace System.Web.UI.Design.WebControls { internal class EntityDataSourceContainerNameItem : IComparable{ // Only one of the following should be set. This is enforced through the constructors and the fact that these fields are readonly. private readonly EntityContainer _entityContainer; // used when we have a real EntityContainer backing this item private readonly string _unknownContainerName; // used when we have an unknown DefaultContainerName that we still want to include in the list internal EntityDataSourceContainerNameItem(EntityContainer entityContainer) { Debug.Assert(entityContainer != null, "null entityContainer"); _entityContainer = entityContainer; } internal EntityDataSourceContainerNameItem(string unknownContainerName) { Debug.Assert(!String.IsNullOrEmpty(unknownContainerName), "null or empty unknownContainerName"); _unknownContainerName = unknownContainerName; } internal string EntityContainerName { get { if (_entityContainer != null) { return _entityContainer.Name; } else { return _unknownContainerName; } } } internal EntityContainer EntityContainer { get { // may be null if this represents an unknown container return _entityContainer; } } public override string ToString() { return this.EntityContainerName; } int IComparable .CompareTo(EntityDataSourceContainerNameItem other) { return (String.Compare(this.EntityContainerName, other.EntityContainerName, StringComparison.OrdinalIgnoreCase)); } } } // 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
- ThreadStartException.cs
- VarRemapper.cs
- CssTextWriter.cs
- CodeRemoveEventStatement.cs
- TcpTransportManager.cs
- FreeFormDesigner.cs
- TypeUnloadedException.cs
- CommentAction.cs
- DataObject.cs
- PasswordPropertyTextAttribute.cs
- DiscriminatorMap.cs
- Part.cs
- SaveFileDialog.cs
- BasicCommandTreeVisitor.cs
- DataColumn.cs
- SymmetricAlgorithm.cs
- FlowPosition.cs
- WindowsHyperlink.cs
- ShimAsPublicXamlType.cs
- SqlConnectionStringBuilder.cs
- listitem.cs
- XmlSiteMapProvider.cs
- TcpStreams.cs
- SerializableAttribute.cs
- RecipientInfo.cs
- DataChangedEventManager.cs
- TypeHelper.cs
- TableLayoutCellPaintEventArgs.cs
- OutgoingWebRequestContext.cs
- TextEmbeddedObject.cs
- ProtocolElement.cs
- VSWCFServiceContractGenerator.cs
- WpfKnownMemberInvoker.cs
- EventLogEntry.cs
- PrimitiveOperationFormatter.cs
- TimerEventSubscription.cs
- BuildProviderCollection.cs
- Accessible.cs
- EpmContentSerializerBase.cs
- ClientProtocol.cs
- Size3D.cs
- Adorner.cs
- ListViewItemMouseHoverEvent.cs
- InternalResources.cs
- SchemaImporterExtensionElement.cs
- MonitoringDescriptionAttribute.cs
- Emitter.cs
- CollectionsUtil.cs
- NamedObject.cs
- RuntimeResourceSet.cs
- XmlIgnoreAttribute.cs
- WebRequestModuleElement.cs
- FilteredDataSetHelper.cs
- SqlExpander.cs
- HttpDictionary.cs
- CodeComment.cs
- UTF8Encoding.cs
- InvokeGenerator.cs
- MergePropertyDescriptor.cs
- ReadWriteSpinLock.cs
- AxHost.cs
- RevocationPoint.cs
- AlphabeticalEnumConverter.cs
- MessageSmuggler.cs
- GridViewCellAutomationPeer.cs
- ToolStripItemTextRenderEventArgs.cs
- SmtpClient.cs
- WebRequestModuleElement.cs
- ThreadAbortException.cs
- ResolveResponse.cs
- ColorIndependentAnimationStorage.cs
- PropertyValue.cs
- ComponentResourceKeyConverter.cs
- InkCanvas.cs
- ObjectDataSourceDisposingEventArgs.cs
- StringAnimationUsingKeyFrames.cs
- WebPartCancelEventArgs.cs
- DataPointer.cs
- ServicePoint.cs
- ClientTargetCollection.cs
- SystemFonts.cs
- DirectoryNotFoundException.cs
- SmiMetaData.cs
- ResourceProviderFactory.cs
- TextPattern.cs
- XmlNavigatorFilter.cs
- GacUtil.cs
- PageFunction.cs
- Attributes.cs
- PropertyInformationCollection.cs
- DisplayMemberTemplateSelector.cs
- DataGridViewLinkColumn.cs
- ControlBuilderAttribute.cs
- PolicyLevel.cs
- SQLRoleProvider.cs
- TemplateComponentConnector.cs
- XmlWrappingReader.cs
- HttpWriter.cs
- BasicKeyConstraint.cs
- CellParagraph.cs