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
- ISAPIRuntime.cs
- StatusBarItemAutomationPeer.cs
- ObjectParameter.cs
- FigureParagraph.cs
- Point3DAnimation.cs
- ListBindingHelper.cs
- ErrorReporting.cs
- WebPartZoneBase.cs
- PeerNearMe.cs
- SamlConditions.cs
- TrackBarRenderer.cs
- PopOutPanel.cs
- IriParsingElement.cs
- ViewLoader.cs
- EditingMode.cs
- DataGridViewDataConnection.cs
- EncodingInfo.cs
- SessionIDManager.cs
- DescendentsWalker.cs
- ALinqExpressionVisitor.cs
- LineUtil.cs
- MinMaxParagraphWidth.cs
- NamespaceList.cs
- AttachedAnnotation.cs
- RangeBase.cs
- XsdValidatingReader.cs
- SymmetricAlgorithm.cs
- HatchBrush.cs
- CalendarDateRangeChangingEventArgs.cs
- InvocationExpression.cs
- Attributes.cs
- RecognizedAudio.cs
- LifetimeServices.cs
- RoleBoolean.cs
- CallbackTimeoutsBehavior.cs
- LogArchiveSnapshot.cs
- mansign.cs
- dsa.cs
- XmlCharType.cs
- OrderedEnumerableRowCollection.cs
- Debug.cs
- AffineTransform3D.cs
- PageContent.cs
- UIElementParaClient.cs
- AxDesigner.cs
- SpanIndex.cs
- DockAndAnchorLayout.cs
- ProfileSettingsCollection.cs
- BypassElementCollection.cs
- RenamedEventArgs.cs
- Point3DCollection.cs
- Directory.cs
- SQLMoney.cs
- ListBoxAutomationPeer.cs
- xmlsaver.cs
- ActiveXSite.cs
- SerializationSectionGroup.cs
- Property.cs
- BigIntegerStorage.cs
- X509WindowsSecurityToken.cs
- ConsoleTraceListener.cs
- PropertyMapper.cs
- AuthenticationModulesSection.cs
- HttpHandlerAction.cs
- TableNameAttribute.cs
- MergePropertyDescriptor.cs
- AmbiguousMatchException.cs
- DelegateCompletionCallbackWrapper.cs
- XmlNamespaceDeclarationsAttribute.cs
- Section.cs
- DataGridViewDataErrorEventArgs.cs
- MetadataArtifactLoaderResource.cs
- GPRECT.cs
- EntitySqlException.cs
- RootProfilePropertySettingsCollection.cs
- IndexOutOfRangeException.cs
- Int64AnimationBase.cs
- HttpRuntimeSection.cs
- ComponentEvent.cs
- PerformanceCounterNameAttribute.cs
- Graphics.cs
- StringAttributeCollection.cs
- XPathNodeInfoAtom.cs
- CodeCompileUnit.cs
- StrokeNodeOperations2.cs
- StreamGeometry.cs
- Stroke.cs
- SimpleBitVector32.cs
- _SSPISessionCache.cs
- VectorAnimationBase.cs
- InstanceCreationEditor.cs
- ToolStripHighContrastRenderer.cs
- ReachSerializableProperties.cs
- ViewKeyConstraint.cs
- EntityTransaction.cs
- XmlAnyAttributeAttribute.cs
- DirectoryInfo.cs
- ModifiableIteratorCollection.cs
- MatrixValueSerializer.cs
- OutputCacheSection.cs