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
- ReadOnlyObservableCollection.cs
- JavaScriptString.cs
- Positioning.cs
- Zone.cs
- NetMsmqSecurityMode.cs
- TextViewSelectionProcessor.cs
- FrameworkTemplate.cs
- StylusPoint.cs
- TypeDescriptor.cs
- ClientSideQueueItem.cs
- CompositionAdorner.cs
- fixedPageContentExtractor.cs
- DesignerSelectionListAdapter.cs
- WindowsStartMenu.cs
- ConfigurationSectionGroupCollection.cs
- ClientRuntimeConfig.cs
- OpenFileDialog.cs
- Resources.Designer.cs
- XhtmlBasicTextViewAdapter.cs
- SecurityChannel.cs
- AppDomainManager.cs
- DropDownList.cs
- DocobjHost.cs
- Pair.cs
- ToolbarAUtomationPeer.cs
- WaitHandle.cs
- EventLogQuery.cs
- ToolStripItemDataObject.cs
- WorkflowServiceNamespace.cs
- SoapElementAttribute.cs
- DataGridColumnHeaderCollection.cs
- CopyOfAction.cs
- DeviceOverridableAttribute.cs
- XmlSchemaSequence.cs
- OleDbConnection.cs
- CapabilitiesPattern.cs
- DatatypeImplementation.cs
- ScrollChrome.cs
- TemplatePropertyEntry.cs
- storepermission.cs
- translator.cs
- XmlEntityReference.cs
- XmlNode.cs
- WorkflowViewManager.cs
- BlobPersonalizationState.cs
- SelectionPattern.cs
- DeclarationUpdate.cs
- RequestCacheEntry.cs
- BufferModesCollection.cs
- ChannelCacheSettings.cs
- HitTestWithPointDrawingContextWalker.cs
- TransformerInfo.cs
- processwaithandle.cs
- MachineKeyConverter.cs
- ErrorHandler.cs
- TraceHwndHost.cs
- Documentation.cs
- AsyncMethodInvoker.cs
- DbQueryCommandTree.cs
- XmlDataLoader.cs
- ErrorHandler.cs
- DecimalStorage.cs
- XmlWrappingReader.cs
- ExtensionSurface.cs
- HttpPostedFile.cs
- BitmapEffectInput.cs
- TextElement.cs
- UserPreferenceChangedEventArgs.cs
- ToolStripSystemRenderer.cs
- CngUIPolicy.cs
- FlowDocumentView.cs
- WebPartConnectionsEventArgs.cs
- SectionVisual.cs
- DecoderExceptionFallback.cs
- CustomLineCap.cs
- AspNetSynchronizationContext.cs
- WebServiceAttribute.cs
- Expressions.cs
- Queue.cs
- _SslSessionsCache.cs
- PipelineModuleStepContainer.cs
- DataGridViewColumnCollection.cs
- EntitySetBase.cs
- HandlerWithFactory.cs
- ClientData.cs
- TextRangeEditLists.cs
- ServiceAuthorizationBehavior.cs
- ColorDialog.cs
- Win32.cs
- AttachedProperty.cs
- ButtonBaseAdapter.cs
- StrongTypingException.cs
- HttpListenerResponse.cs
- SharedPersonalizationStateInfo.cs
- ToolStripDropDownItem.cs
- DialogResultConverter.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- BitVec.cs
- DynamicActivityProperty.cs
- OleDbRowUpdatedEvent.cs