Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- controlskin.cs
- BlurBitmapEffect.cs
- NgenServicingAttributes.cs
- ISAPIApplicationHost.cs
- XsdBuildProvider.cs
- EmptyQuery.cs
- DbExpressionVisitor.cs
- SerializableAttribute.cs
- ImageAttributes.cs
- XamlFxTrace.cs
- RotateTransform.cs
- ScriptComponentDescriptor.cs
- ScriptingJsonSerializationSection.cs
- ToolBarOverflowPanel.cs
- FacetEnabledSchemaElement.cs
- ImageDrawing.cs
- MessageQueuePermissionAttribute.cs
- StylusEventArgs.cs
- hresults.cs
- DBSchemaTable.cs
- SapiAttributeParser.cs
- ArrangedElementCollection.cs
- HttpRuntimeSection.cs
- LinkButton.cs
- SerialErrors.cs
- GradientStop.cs
- ProfileService.cs
- DefaultTextStoreTextComposition.cs
- OleDbSchemaGuid.cs
- NavigationPropertyEmitter.cs
- TimeSpanValidatorAttribute.cs
- DataListCommandEventArgs.cs
- DiscoveryProxy.cs
- ImageAutomationPeer.cs
- OdbcRowUpdatingEvent.cs
- PageContent.cs
- PEFileEvidenceFactory.cs
- ForwardPositionQuery.cs
- ClientConfigurationSystem.cs
- MgmtConfigurationRecord.cs
- UITypeEditor.cs
- UpdatePanelTriggerCollection.cs
- HttpModuleAction.cs
- ContainerVisual.cs
- listviewsubitemcollectioneditor.cs
- DataService.cs
- ComPlusDiagnosticTraceRecords.cs
- Simplifier.cs
- ProgressBarRenderer.cs
- FrameworkElement.cs
- CollaborationHelperFunctions.cs
- RemotingServices.cs
- SR.cs
- BrowserCapabilitiesCompiler.cs
- XmlSchemaChoice.cs
- ClickablePoint.cs
- GroupStyle.cs
- DesignerToolStripControlHost.cs
- IpcChannelHelper.cs
- AutomationProperty.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DebugView.cs
- AlgoModule.cs
- BinaryMethodMessage.cs
- CommentEmitter.cs
- QueryBranchOp.cs
- DataGridViewRowsAddedEventArgs.cs
- PreProcessInputEventArgs.cs
- _ConnectOverlappedAsyncResult.cs
- XmlCharCheckingWriter.cs
- MultiViewDesigner.cs
- NumericExpr.cs
- FontCacheUtil.cs
- KeyManager.cs
- TextServicesLoader.cs
- XmlQueryType.cs
- DataGridLinkButton.cs
- CancellationState.cs
- Matrix3DStack.cs
- StringExpressionSet.cs
- ExceptionUtil.cs
- Win32.cs
- Asn1IntegerConverter.cs
- ResourceProperty.cs
- SqlDataSourceSelectingEventArgs.cs
- BlobPersonalizationState.cs
- OrderedEnumerableRowCollection.cs
- RoleExceptions.cs
- ActivityCodeDomReferenceService.cs
- NetMsmqSecurityMode.cs
- ResourceDescriptionAttribute.cs
- WebPartRestoreVerb.cs
- ValueTable.cs
- FaultDescriptionCollection.cs
- DesignColumn.cs
- TableItemStyle.cs
- PrintPreviewDialog.cs
- XmlSiteMapProvider.cs
- BinaryNode.cs
- Decoder.cs