Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Abstractions / HttpFileCollectionWrapper.cs / 1305376 / HttpFileCollectionWrapper.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web {
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Runtime.CompilerServices;
[TypeForwardedFrom("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
[SuppressMessage("Microsoft.Security", "CA2126:TypeLinkDemandsRequireInheritanceDemands", Justification = "Workaround for FxCop Bug")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
Justification = "This type is an abstraction for HttpFileCollection.")]
public class HttpFileCollectionWrapper : HttpFileCollectionBase {
private HttpFileCollection _collection;
public HttpFileCollectionWrapper(HttpFileCollection httpFileCollection) {
if (httpFileCollection == null) {
throw new ArgumentNullException("httpFileCollection");
}
_collection = httpFileCollection;
}
public override string[] AllKeys {
get {
return _collection.AllKeys;
}
}
public override int Count {
get {
return ((ICollection)_collection).Count;
}
}
public override bool IsSynchronized {
get {
return ((ICollection)_collection).IsSynchronized;
}
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public override NameObjectCollectionBase.KeysCollection Keys {
get {
return _collection.Keys;
}
}
public override object SyncRoot {
get {
return ((ICollection)_collection).SyncRoot;
}
}
public override HttpPostedFileBase this[string name] {
get {
HttpPostedFile file = _collection[name];
return (file != null) ? new HttpPostedFileWrapper(file) : null;
}
}
public override HttpPostedFileBase this[int index] {
get {
HttpPostedFile file = _collection[index];
return (file != null) ? new HttpPostedFileWrapper(file) : null;
}
}
public override void CopyTo(Array dest, int index) {
_collection.CopyTo(dest, index);
}
public override HttpPostedFileBase Get(int index) {
HttpPostedFile file = _collection.Get(index);
return (file != null) ? new HttpPostedFileWrapper(file) : null;
}
public override HttpPostedFileBase Get(string name) {
HttpPostedFile file = _collection.Get(name);
return (file != null) ? new HttpPostedFileWrapper(file) : null;
}
public override IEnumerator GetEnumerator() {
return ((IEnumerable)_collection).GetEnumerator();
}
public override string GetKey(int index) {
return _collection.GetKey(index);
}
[SuppressMessage("Microsoft.Security", "CA2114:MethodSecurityShouldBeASupersetOfType", Justification = "Workaround for FxCop Bug")]
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context) {
_collection.GetObjectData(info, context);
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public override void OnDeserialization(object sender) {
_collection.OnDeserialization(sender);
}
}
}
// 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
- ComponentDispatcher.cs
- DnsElement.cs
- ModelProperty.cs
- PathFigureCollectionValueSerializer.cs
- DataBinder.cs
- AppDomainShutdownMonitor.cs
- TablePatternIdentifiers.cs
- SqlDataSourceDesigner.cs
- PaperSize.cs
- ColorAnimationBase.cs
- SmiRequestExecutor.cs
- XamlToRtfParser.cs
- GcSettings.cs
- ValidationError.cs
- AnnouncementEndpointElement.cs
- SelectionRangeConverter.cs
- SaveFileDialog.cs
- PenContext.cs
- RC2CryptoServiceProvider.cs
- DataControlImageButton.cs
- TraceSection.cs
- SafeBuffer.cs
- KeyEvent.cs
- FactoryGenerator.cs
- InkCanvasInnerCanvas.cs
- Parser.cs
- PrintPreviewDialog.cs
- AnimationStorage.cs
- AdCreatedEventArgs.cs
- WebPartMovingEventArgs.cs
- FamilyTypefaceCollection.cs
- FocusTracker.cs
- EventEntry.cs
- MinimizableAttributeTypeConverter.cs
- invalidudtexception.cs
- OptimisticConcurrencyException.cs
- SortedList.cs
- ToolStripSplitStackLayout.cs
- MediaEntryAttribute.cs
- SemaphoreSecurity.cs
- _ConnectStream.cs
- PageAsyncTaskManager.cs
- SolidColorBrush.cs
- TextSelectionHelper.cs
- InvokeMemberBinder.cs
- OdbcConnectionFactory.cs
- WorkflowMarkupSerializer.cs
- EdgeProfileValidation.cs
- FontUnit.cs
- HttpCookiesSection.cs
- Path.cs
- ConnectionStringsSection.cs
- coordinator.cs
- DataBoundControlAdapter.cs
- ImageCollectionCodeDomSerializer.cs
- AlternateViewCollection.cs
- SqlBulkCopy.cs
- CqlParserHelpers.cs
- NotSupportedException.cs
- SafeProcessHandle.cs
- ResXResourceReader.cs
- PlatformCulture.cs
- Control.cs
- _TimerThread.cs
- DocumentViewerBase.cs
- AssociatedControlConverter.cs
- AspNetHostingPermission.cs
- TextOnlyOutput.cs
- ControlBindingsConverter.cs
- StandardCommands.cs
- DSASignatureDeformatter.cs
- DBSchemaRow.cs
- ImageConverter.cs
- MediaCommands.cs
- Selector.cs
- ManipulationDelta.cs
- KnownColorTable.cs
- InputLanguageCollection.cs
- RoutedCommand.cs
- ScriptReferenceEventArgs.cs
- OracleSqlParser.cs
- HGlobalSafeHandle.cs
- PersistenceTypeAttribute.cs
- VectorKeyFrameCollection.cs
- AttachmentService.cs
- EntityModelSchemaGenerator.cs
- PointCollectionValueSerializer.cs
- CodeThrowExceptionStatement.cs
- WebConfigurationHostFileChange.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridViewHeaderCell.cs
- SafeFindHandle.cs
- MarkedHighlightComponent.cs
- LoginNameDesigner.cs
- KeyTimeConverter.cs
- OdbcError.cs
- WSHttpSecurityElement.cs
- ObjectConverter.cs
- EdmSchemaError.cs
- TextTreeTextElementNode.cs