WebResourceAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebResourceAttribute.cs / 1 / WebResourceAttribute.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.UI { 
 
    using System;
    using System.ComponentModel; 
    using System.Security.Permissions;
    using System.Web.Util;

 
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
    public sealed class WebResourceAttribute : Attribute { 

        private string _contentType; 
        private bool _performSubstitution;
        private string _webResource;

 
        public WebResourceAttribute(string webResource, string contentType) {
            if (String.IsNullOrEmpty(webResource)) { 
                throw ExceptionUtil.ParameterNullOrEmpty("webResource"); 
            }
 
            if (String.IsNullOrEmpty(contentType)) {
                throw ExceptionUtil.ParameterNullOrEmpty("contentType");
            }
 
            _contentType = contentType;
            _webResource = webResource; 
            _performSubstitution = false; 
        }
 

        public string ContentType {
            get {
                return _contentType; 
            }
        } 
 

        public bool PerformSubstitution { 
            get {
                return _performSubstitution;
            }
            set { 
                _performSubstitution = value;
            } 
        } 

 
        public string WebResource {
            get {
                return _webResource;
            } 
        }
    } 
} 

 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.UI { 
 
    using System;
    using System.ComponentModel; 
    using System.Security.Permissions;
    using System.Web.Util;

 
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
    public sealed class WebResourceAttribute : Attribute { 

        private string _contentType; 
        private bool _performSubstitution;
        private string _webResource;

 
        public WebResourceAttribute(string webResource, string contentType) {
            if (String.IsNullOrEmpty(webResource)) { 
                throw ExceptionUtil.ParameterNullOrEmpty("webResource"); 
            }
 
            if (String.IsNullOrEmpty(contentType)) {
                throw ExceptionUtil.ParameterNullOrEmpty("contentType");
            }
 
            _contentType = contentType;
            _webResource = webResource; 
            _performSubstitution = false; 
        }
 

        public string ContentType {
            get {
                return _contentType; 
            }
        } 
 

        public bool PerformSubstitution { 
            get {
                return _performSubstitution;
            }
            set { 
                _performSubstitution = value;
            } 
        } 

 
        public string WebResource {
            get {
                return _webResource;
            } 
        }
    } 
} 

 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.

                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK