Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / EmptyArray.cs / 1 / EmptyArray.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel { using System; using System.Collections.Generic; class EmptyArray{ static T[] instance; EmptyArray() { } internal static T[] Instance { get { if (instance == null) instance = new T[0]; return instance; } } internal static T[] Allocate(int n) { if (n == 0) return Instance; else return new T[n]; } internal static T[] ToArray(IList collection) { if (collection.Count == 0) { return EmptyArray .Instance; } else { T[] array = new T[collection.Count]; collection.CopyTo(array, 0); return array; } } internal static T[] ToArray(SynchronizedCollection collection) { lock (collection.SyncRoot) { return EmptyArray .ToArray((IList )collection); } } } class EmptyArray { static object[] instance = new object[0]; EmptyArray() { } internal static object[] Instance { get { return instance; } } internal static object[] Allocate(int n) { if (n == 0) return Instance; else return new object[n]; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Context.cs
- Stroke2.cs
- DataGridTextBox.cs
- PersistenceTask.cs
- NumericUpDown.cs
- DiagnosticTrace.cs
- ListBindingHelper.cs
- PersonalizablePropertyEntry.cs
- SvcMapFileSerializer.cs
- SafeProcessHandle.cs
- UdpTransportSettingsElement.cs
- AsnEncodedData.cs
- NamedPipeProcessProtocolHandler.cs
- DescendantBaseQuery.cs
- ClientSponsor.cs
- InProcStateClientManager.cs
- ListViewDeleteEventArgs.cs
- TypeValidationEventArgs.cs
- ConfigurationManagerHelper.cs
- ColorIndependentAnimationStorage.cs
- SpellerInterop.cs
- ProcessHostServerConfig.cs
- NullRuntimeConfig.cs
- Property.cs
- TrustManagerMoreInformation.cs
- Helpers.cs
- DataGridViewTextBoxCell.cs
- PipeSecurity.cs
- StrongNameUtility.cs
- StatusBarDrawItemEvent.cs
- QilInvokeEarlyBound.cs
- VirtualPath.cs
- EntityTypeBase.cs
- PermissionToken.cs
- XmlNavigatorStack.cs
- UnsafeNativeMethods.cs
- SecurityPermission.cs
- KnownColorTable.cs
- Bookmark.cs
- ToolStripManager.cs
- ChangeNode.cs
- TriState.cs
- DataBindingExpressionBuilder.cs
- Attribute.cs
- DynamicHyperLink.cs
- PictureBoxDesigner.cs
- SwitchExpression.cs
- HttpCookiesSection.cs
- X509AsymmetricSecurityKey.cs
- WebColorConverter.cs
- SettingsPropertyValueCollection.cs
- HostProtectionPermission.cs
- ConfigurationSectionGroup.cs
- AnnotationResourceCollection.cs
- COM2ComponentEditor.cs
- BoolExpression.cs
- WebPartMenuStyle.cs
- TreeNode.cs
- PartitionerQueryOperator.cs
- ParseChildrenAsPropertiesAttribute.cs
- SessionIDManager.cs
- Int16Animation.cs
- SmtpReplyReaderFactory.cs
- DependencyPropertyValueSerializer.cs
- ASCIIEncoding.cs
- TreeNodeCollection.cs
- SiteMapNodeItem.cs
- GlyphElement.cs
- InputElement.cs
- ClipboardProcessor.cs
- WebBrowser.cs
- HandlerWithFactory.cs
- Grant.cs
- ApplicationFileParser.cs
- WebPartConnectionsCancelVerb.cs
- MutableAssemblyCacheEntry.cs
- UriTemplateTrieNode.cs
- Matrix.cs
- TextEditorCopyPaste.cs
- WebPartZoneBase.cs
- COM2ExtendedUITypeEditor.cs
- PhoneCall.cs
- DictionaryManager.cs
- StringResourceManager.cs
- TargetParameterCountException.cs
- Int32Converter.cs
- RandomNumberGenerator.cs
- Setter.cs
- EventLogEntryCollection.cs
- CallSite.cs
- TextTreeUndoUnit.cs
- BitmapEffectInput.cs
- HtmlInputFile.cs
- StreamWithDictionary.cs
- ChangeDirector.cs
- SnapshotChangeTrackingStrategy.cs
- GridPatternIdentifiers.cs
- ZipPackagePart.cs
- EncodingTable.cs
- OperationAbortedException.cs