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
- OuterGlowBitmapEffect.cs
- RectIndependentAnimationStorage.cs
- XXXOnTypeBuilderInstantiation.cs
- ProcessInfo.cs
- DataGridColumnFloatingHeader.cs
- TreeViewItem.cs
- RulePatternOps.cs
- MarkupExtensionReturnTypeAttribute.cs
- GACIdentityPermission.cs
- ContentFilePart.cs
- XomlCompilerError.cs
- PropertyInfoSet.cs
- DBBindings.cs
- DataRowChangeEvent.cs
- TextRangeSerialization.cs
- HttpHandlerActionCollection.cs
- PermissionSetTriple.cs
- HostingPreferredMapPath.cs
- EmptyControlCollection.cs
- ReadOnlyCollectionBase.cs
- UnknownBitmapDecoder.cs
- DataGridViewSelectedColumnCollection.cs
- NullableBoolConverter.cs
- RegexCharClass.cs
- ToolStripItemEventArgs.cs
- SqlDelegatedTransaction.cs
- ExpressionParser.cs
- XsdBuilder.cs
- Set.cs
- ExtendedPropertyCollection.cs
- ButtonDesigner.cs
- ListBoxAutomationPeer.cs
- MatcherBuilder.cs
- ScriptControlDescriptor.cs
- Thread.cs
- ContainerAction.cs
- ToolStripContainer.cs
- GregorianCalendar.cs
- HttpPostProtocolReflector.cs
- FlagsAttribute.cs
- _DigestClient.cs
- SerTrace.cs
- ObjectStateManager.cs
- DirectoryRedirect.cs
- ConfigurationElementCollection.cs
- ValidationEventArgs.cs
- DataGridViewCellEventArgs.cs
- StrokeNodeEnumerator.cs
- Pkcs7Recipient.cs
- Msec.cs
- DesignerRegionMouseEventArgs.cs
- PowerModeChangedEventArgs.cs
- AppDomainGrammarProxy.cs
- TemplateBuilder.cs
- Point4D.cs
- sqlnorm.cs
- MappingItemCollection.cs
- CngAlgorithmGroup.cs
- SerialReceived.cs
- ColorConverter.cs
- DropShadowEffect.cs
- ServerIdentity.cs
- UpDownBase.cs
- SelectionProviderWrapper.cs
- GraphicsPath.cs
- AssemblyAttributes.cs
- EventManager.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- EncodingDataItem.cs
- xsdvalidator.cs
- GenericParameterDataContract.cs
- WindowsSysHeader.cs
- HtmlInputReset.cs
- DeploymentSection.cs
- SymmetricAlgorithm.cs
- SessionPageStateSection.cs
- CryptoKeySecurity.cs
- RouteParser.cs
- VideoDrawing.cs
- CheckedListBox.cs
- DataRow.cs
- AssemblyBuilder.cs
- QilXmlReader.cs
- FilteredSchemaElementLookUpTable.cs
- X509Utils.cs
- SQLDoubleStorage.cs
- ParentQuery.cs
- HttpProfileGroupBase.cs
- AsyncCodeActivityContext.cs
- AssemblyResourceLoader.cs
- XmlConverter.cs
- TextDecorationCollectionConverter.cs
- Compilation.cs
- UiaCoreProviderApi.cs
- ExtendedPropertiesHandler.cs
- EditorPartCollection.cs
- XmlBinaryReader.cs
- webproxy.cs
- HttpApplication.cs
- RSAPKCS1SignatureDeformatter.cs