Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebResourceAttribute.cs / 1594420 / WebResourceAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Web.Util; [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)] public sealed class WebResourceAttribute : Attribute { private string _contentType; private bool _performSubstitution; private string _webResource; private string _cdnPath; private string _cdnPathSecureConnection; private bool _cdnSupportsSecureConnection; internal const string _microsoftCdnBasePath = "http://ajax.microsoft.com/ajax/4.0/1/"; 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; } [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Cdn", Justification="Stands for Content Delivery Network.")] public string CdnPath { get { return _cdnPath ?? String.Empty; } set { _cdnPath = value; } } internal string CdnPathSecureConnection { get { if (_cdnPathSecureConnection == null) { string cdnPath = CdnPath; if (String.IsNullOrEmpty(cdnPath) || !CdnSupportsSecureConnection || !cdnPath.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) { cdnPath = String.Empty; } else { // convert http to https cdnPath = "https" + cdnPath.Substring(4); } _cdnPathSecureConnection = cdnPath; } return _cdnPathSecureConnection; } } [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cdn", Justification = "Stands for Content Delivery Network.")] public bool CdnSupportsSecureConnection { get { return _cdnSupportsSecureConnection; } set { _cdnSupportsSecureConnection = value; } } 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.Diagnostics.CodeAnalysis; using System.Web.Util; [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)] public sealed class WebResourceAttribute : Attribute { private string _contentType; private bool _performSubstitution; private string _webResource; private string _cdnPath; private string _cdnPathSecureConnection; private bool _cdnSupportsSecureConnection; internal const string _microsoftCdnBasePath = "http://ajax.microsoft.com/ajax/4.0/1/"; 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; } [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId="Cdn", Justification="Stands for Content Delivery Network.")] public string CdnPath { get { return _cdnPath ?? String.Empty; } set { _cdnPath = value; } } internal string CdnPathSecureConnection { get { if (_cdnPathSecureConnection == null) { string cdnPath = CdnPath; if (String.IsNullOrEmpty(cdnPath) || !CdnSupportsSecureConnection || !cdnPath.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) { cdnPath = String.Empty; } else { // convert http to https cdnPath = "https" + cdnPath.Substring(4); } _cdnPathSecureConnection = cdnPath; } return _cdnPathSecureConnection; } } [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cdn", Justification = "Stands for Content Delivery Network.")] public bool CdnSupportsSecureConnection { get { return _cdnSupportsSecureConnection; } set { _cdnSupportsSecureConnection = value; } } 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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ScrollItemPattern.cs
- DetailsView.cs
- Helpers.cs
- RegistrySecurity.cs
- DependencyObject.cs
- DependencyProperty.cs
- SmtpFailedRecipientException.cs
- InstanceNameConverter.cs
- HttpCacheVary.cs
- WebPageTraceListener.cs
- KeyManager.cs
- StylusDownEventArgs.cs
- TextProviderWrapper.cs
- nulltextnavigator.cs
- WaitForChangedResult.cs
- SocketException.cs
- InputScopeNameConverter.cs
- DocumentApplicationJournalEntry.cs
- Listener.cs
- SerialPort.cs
- ValidatedControlConverter.cs
- FactoryGenerator.cs
- GenericPrincipal.cs
- FixedSOMContainer.cs
- ContentDisposition.cs
- NativeMethods.cs
- FixedPageProcessor.cs
- XamlInt32CollectionSerializer.cs
- TypeSystem.cs
- Label.cs
- DataGridViewColumnDesigner.cs
- DocumentSchemaValidator.cs
- XslAstAnalyzer.cs
- NamespaceExpr.cs
- EventManager.cs
- ThreadLocal.cs
- ApplyTemplatesAction.cs
- Mapping.cs
- Win32PrintDialog.cs
- ActivationArguments.cs
- TemplateParser.cs
- TextElementAutomationPeer.cs
- TypeConverter.cs
- ReaderOutput.cs
- ToolStripArrowRenderEventArgs.cs
- SqlAliaser.cs
- IgnoreFileBuildProvider.cs
- WaitHandleCannotBeOpenedException.cs
- SmiEventStream.cs
- WindowsTreeView.cs
- AutomationIdentifierGuids.cs
- CommandHelper.cs
- MembershipUser.cs
- ThrowHelper.cs
- WebReferenceCollection.cs
- DockPatternIdentifiers.cs
- OdbcUtils.cs
- WebScriptMetadataFormatter.cs
- DockProviderWrapper.cs
- DirectoryObjectSecurity.cs
- EntityObject.cs
- ModelPerspective.cs
- InitializerFacet.cs
- PersistenceTypeAttribute.cs
- KeyedCollection.cs
- InputScope.cs
- Expander.cs
- ServiceEndpoint.cs
- NeutralResourcesLanguageAttribute.cs
- NonPrimarySelectionGlyph.cs
- ThreadStaticAttribute.cs
- ClosableStream.cs
- MetadataPropertyAttribute.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ListParaClient.cs
- ArcSegment.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ControlBuilder.cs
- DateTimeConverter.cs
- PasswordPropertyTextAttribute.cs
- ContextStaticAttribute.cs
- ChineseLunisolarCalendar.cs
- CompensateDesigner.cs
- QuaternionKeyFrameCollection.cs
- log.cs
- ScaleTransform3D.cs
- SystemIPInterfaceProperties.cs
- FindCriteria.cs
- PathTooLongException.cs
- CultureTableRecord.cs
- DataGridCaption.cs
- XmlMessageFormatter.cs
- IgnoreFlushAndCloseStream.cs
- ServerIdentity.cs
- FunctionMappingTranslator.cs
- CultureSpecificStringDictionary.cs
- RecordManager.cs
- WebPartCancelEventArgs.cs
- TraceProvider.cs
- PrinterResolution.cs