Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / xsp / System / Web / Extensions / ui / RegisteredScript.cs / 1 / RegisteredScript.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
[
AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
]
public sealed class RegisteredScript {
private RegisteredScriptType _scriptType;
private Control _control;
private string _key;
private string _script;
private Type _type;
private bool _addScriptTags;
private string _url;
internal RegisteredScript(Control control, Type type, string key, string url) {
Debug.Assert(control != null);
Debug.Assert(type != null);
Debug.Assert(!String.IsNullOrEmpty(url));
// null and empty "key" are treated different by asp.net script duplicate detection so null is allowed.
_scriptType = RegisteredScriptType.ClientScriptInclude;
_control = control;
_type = type;
_key = key;
_url = url;
}
internal RegisteredScript(RegisteredScriptType scriptType,
Control control,
Type type,
string key,
string script,
bool addScriptTags) {
Debug.Assert(control != null);
Debug.Assert(
scriptType != RegisteredScriptType.OnSubmitStatement || !addScriptTags,
"OnSubmitStatements cannot have addScriptTags.");
Debug.Assert(type != null);
// null and empty "key" are treated different by asp.net script duplicate detection so null is allowed.
// null script allowed
_scriptType = scriptType;
_control = control;
_type = type;
_key = key;
_script = script;
_addScriptTags = addScriptTags;
}
public bool AddScriptTags {
get {
return _addScriptTags;
}
}
public Control Control {
get {
return _control;
}
}
public string Key {
get {
// may be null
return _key;
}
}
public string Script {
get {
// may be null
return _script;
}
}
public RegisteredScriptType ScriptType {
get {
return _scriptType;
}
}
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods",
Justification = "Refers to a Control, not my Object.GetType()")]
public Type Type {
get {
return _type;
}
}
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "Consistent with RegisterClientScriptInclude.")]
public string Url {
get {
// null if this is not a client script include or resource
return _url;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
[
AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
]
public sealed class RegisteredScript {
private RegisteredScriptType _scriptType;
private Control _control;
private string _key;
private string _script;
private Type _type;
private bool _addScriptTags;
private string _url;
internal RegisteredScript(Control control, Type type, string key, string url) {
Debug.Assert(control != null);
Debug.Assert(type != null);
Debug.Assert(!String.IsNullOrEmpty(url));
// null and empty "key" are treated different by asp.net script duplicate detection so null is allowed.
_scriptType = RegisteredScriptType.ClientScriptInclude;
_control = control;
_type = type;
_key = key;
_url = url;
}
internal RegisteredScript(RegisteredScriptType scriptType,
Control control,
Type type,
string key,
string script,
bool addScriptTags) {
Debug.Assert(control != null);
Debug.Assert(
scriptType != RegisteredScriptType.OnSubmitStatement || !addScriptTags,
"OnSubmitStatements cannot have addScriptTags.");
Debug.Assert(type != null);
// null and empty "key" are treated different by asp.net script duplicate detection so null is allowed.
// null script allowed
_scriptType = scriptType;
_control = control;
_type = type;
_key = key;
_script = script;
_addScriptTags = addScriptTags;
}
public bool AddScriptTags {
get {
return _addScriptTags;
}
}
public Control Control {
get {
return _control;
}
}
public string Key {
get {
// may be null
return _key;
}
}
public string Script {
get {
// may be null
return _script;
}
}
public RegisteredScriptType ScriptType {
get {
return _scriptType;
}
}
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods",
Justification = "Refers to a Control, not my Object.GetType()")]
public Type Type {
get {
return _type;
}
}
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "Consistent with RegisterClientScriptInclude.")]
public string Url {
get {
// null if this is not a client script include or resource
return _url;
}
}
}
}
// 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
- ExitEventArgs.cs
- DateTimeUtil.cs
- UdpMessageProperty.cs
- Queue.cs
- HMAC.cs
- UdpTransportSettings.cs
- EntityDataSourceWizardForm.cs
- HttpProfileGroupBase.cs
- Polyline.cs
- NameValueConfigurationCollection.cs
- ReadWriteObjectLock.cs
- GenericTypeParameterBuilder.cs
- DataGridViewColumnDesigner.cs
- SingleAnimationUsingKeyFrames.cs
- DataGridViewTopLeftHeaderCell.cs
- Column.cs
- AddInBase.cs
- TextBox.cs
- ResourcePool.cs
- Helper.cs
- ScriptResourceHandler.cs
- PrintPreviewGraphics.cs
- PropertyMapper.cs
- ReadContentAsBinaryHelper.cs
- DynamicMethod.cs
- RangeBase.cs
- TextBoxDesigner.cs
- TypedTableBaseExtensions.cs
- CalendarTable.cs
- DataGridViewRowEventArgs.cs
- RawUIStateInputReport.cs
- compensatingcollection.cs
- ImageClickEventArgs.cs
- Overlapped.cs
- DbConnectionPoolGroup.cs
- SqlInfoMessageEvent.cs
- DbProviderFactories.cs
- DataSourceProvider.cs
- GroupItem.cs
- PageRouteHandler.cs
- _IPv4Address.cs
- ListViewTableRow.cs
- EntityExpressionVisitor.cs
- AmbientLight.cs
- StateDesigner.LayoutSelectionGlyph.cs
- InvalidEnumArgumentException.cs
- QilBinary.cs
- Int32Rect.cs
- CryptoProvider.cs
- ToolStripAdornerWindowService.cs
- HandleExceptionArgs.cs
- AdPostCacheSubstitution.cs
- RegisteredScript.cs
- _OverlappedAsyncResult.cs
- CodeGen.cs
- _NegotiateClient.cs
- DecimalMinMaxAggregationOperator.cs
- XamlFilter.cs
- String.cs
- WS2007FederationHttpBindingCollectionElement.cs
- TextStore.cs
- AttributeQuery.cs
- ResXFileRef.cs
- assertwrapper.cs
- WindowsRegion.cs
- WmpBitmapDecoder.cs
- BitmapEffectGroup.cs
- StrokeCollectionConverter.cs
- OdbcUtils.cs
- ServiceDescription.cs
- InstanceLockQueryResult.cs
- KeyTime.cs
- IPPacketInformation.cs
- RuleProcessor.cs
- SrgsDocumentParser.cs
- NotSupportedException.cs
- diagnosticsswitches.cs
- DataTableCollection.cs
- ManagedWndProcTracker.cs
- WindowsTreeView.cs
- ClientSponsor.cs
- ImageCodecInfo.cs
- HtmlForm.cs
- NamespaceMapping.cs
- xsdvalidator.cs
- CustomValidator.cs
- ToolboxComponentsCreatedEventArgs.cs
- PropVariant.cs
- UICuesEvent.cs
- QuotedStringWriteStateInfo.cs
- WebControlsSection.cs
- DeclaredTypeElement.cs
- ConfigXmlWhitespace.cs
- LexicalChunk.cs
- DataSysAttribute.cs
- MethodBuilder.cs
- DBParameter.cs
- ExpressionHelper.cs
- Math.cs
- WebServiceTypeData.cs