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
- OleDbDataAdapter.cs
- EventToken.cs
- BamlMapTable.cs
- EnumerableWrapperWeakToStrong.cs
- WebBrowserSiteBase.cs
- XsdBuildProvider.cs
- EmptyCollection.cs
- ColorAnimation.cs
- SmiMetaData.cs
- XPathCompileException.cs
- VBIdentifierNameEditor.cs
- CustomWebEventKey.cs
- Component.cs
- ImplicitInputBrush.cs
- WindowsStreamSecurityUpgradeProvider.cs
- TextServicesDisplayAttribute.cs
- DockPattern.cs
- TraceContextEventArgs.cs
- LinqDataSourceEditData.cs
- HtmlTable.cs
- PositiveTimeSpanValidatorAttribute.cs
- CqlParser.cs
- basenumberconverter.cs
- SecurityIdentifierElement.cs
- DataFormat.cs
- VisualStyleRenderer.cs
- VirtualStackFrame.cs
- WhitespaceRuleLookup.cs
- DesignObjectWrapper.cs
- AppDomainProtocolHandler.cs
- ScriptReferenceEventArgs.cs
- RichTextBox.cs
- QuotaExceededException.cs
- DBBindings.cs
- AnnotationService.cs
- OleCmdHelper.cs
- UInt32Storage.cs
- HttpInputStream.cs
- TextEditorMouse.cs
- ApplicationManager.cs
- HealthMonitoringSection.cs
- SessionEndingEventArgs.cs
- InstanceStoreQueryResult.cs
- SymmetricCryptoHandle.cs
- CriticalFinalizerObject.cs
- Exceptions.cs
- messageonlyhwndwrapper.cs
- WindowsAuthenticationEventArgs.cs
- SoapExtensionTypeElementCollection.cs
- LinearKeyFrames.cs
- StyleSheet.cs
- WaitForChangedResult.cs
- EarlyBoundInfo.cs
- DataRowCollection.cs
- PropertyAccessVisitor.cs
- XmlIterators.cs
- VirtualDirectoryMappingCollection.cs
- HostedElements.cs
- Models.cs
- JsonFormatReaderGenerator.cs
- CommandBindingCollection.cs
- httpserverutility.cs
- Hashtable.cs
- _OverlappedAsyncResult.cs
- DisplayInformation.cs
- RenderOptions.cs
- DeflateInput.cs
- DetailsViewCommandEventArgs.cs
- InProcStateClientManager.cs
- SqlDataSourceCache.cs
- ScriptingSectionGroup.cs
- ScriptReferenceEventArgs.cs
- XDRSchema.cs
- ParenthesizePropertyNameAttribute.cs
- ExtractedStateEntry.cs
- TranslateTransform3D.cs
- Suspend.cs
- MediaTimeline.cs
- ProtocolsConfigurationEntry.cs
- XmlStringTable.cs
- UserControlBuildProvider.cs
- MemberAccessException.cs
- TreeView.cs
- TreeNodeCollection.cs
- ConfigurationProperty.cs
- AssociationSetMetadata.cs
- BrowserCapabilitiesFactory35.cs
- QilLiteral.cs
- DragEvent.cs
- ExceptionCollection.cs
- TextServicesDisplayAttributePropertyRanges.cs
- TextEditorTables.cs
- IxmlLineInfo.cs
- TableRowCollection.cs
- SystemIcmpV6Statistics.cs
- SelectionChangedEventArgs.cs
- WindowsGraphics2.cs
- PassportAuthenticationModule.cs
- Soap.cs
- MeasureData.cs