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
- MouseActionValueSerializer.cs
- FontUnitConverter.cs
- SqlClientWrapperSmiStreamChars.cs
- AccessedThroughPropertyAttribute.cs
- TrustManager.cs
- EntityTemplateFactory.cs
- EntityType.cs
- DecimalFormatter.cs
- SchemaTableColumn.cs
- XhtmlConformanceSection.cs
- ProjectedSlot.cs
- InfoCardConstants.cs
- DataFieldConverter.cs
- ReadOnlyNameValueCollection.cs
- XamlWrappingReader.cs
- OracleSqlParser.cs
- FileDialogCustomPlaces.cs
- Parser.cs
- RuntimeIdentifierPropertyAttribute.cs
- ThreadAttributes.cs
- PropertyGeneratedEventArgs.cs
- SqlBinder.cs
- OracleRowUpdatingEventArgs.cs
- ContextStack.cs
- DetailsViewPageEventArgs.cs
- _AuthenticationState.cs
- CodeDOMProvider.cs
- GridView.cs
- DispatcherOperation.cs
- DataPagerFieldItem.cs
- ListControl.cs
- InteropEnvironment.cs
- HostExecutionContextManager.cs
- TreeView.cs
- AssemblyInfo.cs
- HashCodeCombiner.cs
- XamlWriter.cs
- log.cs
- HttpAsyncResult.cs
- ExpressionBuilder.cs
- QilSortKey.cs
- ListSourceHelper.cs
- StringConcat.cs
- NodeLabelEditEvent.cs
- mda.cs
- QueryAccessibilityHelpEvent.cs
- SelfIssuedTokenFactoryCredential.cs
- Encoding.cs
- GridViewAutoFormat.cs
- DynamicMethod.cs
- Adorner.cs
- SystemIcons.cs
- SystemColors.cs
- ObjectSpanRewriter.cs
- ExternalCalls.cs
- SystemException.cs
- TransactionContext.cs
- ClientConfigurationSystem.cs
- ScriptControlDescriptor.cs
- EastAsianLunisolarCalendar.cs
- GenericsNotImplementedException.cs
- InputMethodStateChangeEventArgs.cs
- SqlGenerator.cs
- DataGridPagerStyle.cs
- SmiRecordBuffer.cs
- BaseTemplateCodeDomTreeGenerator.cs
- InvalidComObjectException.cs
- XmlSchemaNotation.cs
- ListItemParagraph.cs
- TypeTypeConverter.cs
- DataGridCommandEventArgs.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- SqlDataRecord.cs
- OrderedHashRepartitionStream.cs
- GeometryCombineModeValidation.cs
- OleDbPermission.cs
- BindingMemberInfo.cs
- UIElementHelper.cs
- MsmqVerifier.cs
- IntSecurity.cs
- EditorPartDesigner.cs
- NativeMethods.cs
- MulticastIPAddressInformationCollection.cs
- SchemaTableOptionalColumn.cs
- HttpCapabilitiesEvaluator.cs
- DBNull.cs
- ContentElementAutomationPeer.cs
- TypeReference.cs
- ServerValidateEventArgs.cs
- linebase.cs
- PersonalizationEntry.cs
- TransactionTable.cs
- PropertyMetadata.cs
- DataRowComparer.cs
- TextPointerBase.cs
- QilIterator.cs
- NullableBoolConverter.cs
- DynamicMethod.cs
- TabRenderer.cs
- UrlMappingCollection.cs