Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameItem.cs / 3 / 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
- complextypematerializer.cs
- BinaryReader.cs
- CounterNameConverter.cs
- FunctionCommandText.cs
- PageParser.cs
- Utils.cs
- TextViewBase.cs
- MsdtcClusterUtils.cs
- HyperLinkDataBindingHandler.cs
- ImageDrawing.cs
- DataMisalignedException.cs
- SqlConnectionString.cs
- XmlStreamStore.cs
- ImageListStreamer.cs
- RetrieveVirtualItemEventArgs.cs
- StrongNameKeyPair.cs
- Match.cs
- WebBrowserNavigatedEventHandler.cs
- SchemaTypeEmitter.cs
- StatusBarPanelClickEvent.cs
- TaiwanCalendar.cs
- sqlnorm.cs
- SyntaxCheck.cs
- StylusEditingBehavior.cs
- DbConnectionHelper.cs
- DrawingAttributeSerializer.cs
- InputProviderSite.cs
- AuthenticationService.cs
- ScrollProviderWrapper.cs
- XamlStyleSerializer.cs
- UnsafeNativeMethodsPenimc.cs
- GACIdentityPermission.cs
- HatchBrush.cs
- ReachDocumentSequenceSerializerAsync.cs
- ExpressionConverter.cs
- XpsFixedPageReaderWriter.cs
- FacetValueContainer.cs
- RangeValueProviderWrapper.cs
- StorageMappingItemCollection.cs
- IImplicitResourceProvider.cs
- Parallel.cs
- PageEventArgs.cs
- PropertyNames.cs
- And.cs
- TrackingExtract.cs
- RbTree.cs
- ControlParameter.cs
- FocusChangedEventArgs.cs
- InputLangChangeRequestEvent.cs
- CompilerCollection.cs
- MulticastDelegate.cs
- ColorIndependentAnimationStorage.cs
- TableCellAutomationPeer.cs
- NavigatingCancelEventArgs.cs
- TraceContextEventArgs.cs
- Group.cs
- VectorValueSerializer.cs
- CodeStatementCollection.cs
- CorrelationValidator.cs
- EntitySet.cs
- SqlConnectionHelper.cs
- EventPrivateKey.cs
- StringValidator.cs
- InstanceLockedException.cs
- RemoteWebConfigurationHostServer.cs
- DocumentViewerHelper.cs
- DictionaryEntry.cs
- MemoryStream.cs
- Context.cs
- FolderBrowserDialog.cs
- SslStream.cs
- MetricEntry.cs
- figurelengthconverter.cs
- PersonalizationProviderCollection.cs
- UIPermission.cs
- GridViewDeletedEventArgs.cs
- TextUtf8RawTextWriter.cs
- ColumnCollection.cs
- Screen.cs
- UrlPath.cs
- HtmlAnchor.cs
- EngineSite.cs
- WebPartEditorOkVerb.cs
- ToolStrip.cs
- ConstraintStruct.cs
- SmiEventSink_DeferedProcessing.cs
- ChannelDispatcher.cs
- MSAAEventDispatcher.cs
- InvokeWebService.cs
- FormatControl.cs
- HtmlTitle.cs
- ArraySegment.cs
- xdrvalidator.cs
- Rect3D.cs
- InstanceDescriptor.cs
- ToolboxService.cs
- FormatterServices.cs
- dbenumerator.cs
- FontClient.cs
- BinaryCommonClasses.cs