Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / RegisteredScript.cs / 1305376 / RegisteredScript.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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;
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
- SourceElementsCollection.cs
- WebPartConnectionsConfigureVerb.cs
- Function.cs
- arabicshape.cs
- ToolStripKeyboardHandlingService.cs
- SecurityTokenResolver.cs
- ToolStripPanel.cs
- EntityDesignerUtils.cs
- ToolStripItemRenderEventArgs.cs
- ToolstripProfessionalRenderer.cs
- EditorBrowsableAttribute.cs
- SkinBuilder.cs
- BasePattern.cs
- HttpListenerPrefixCollection.cs
- ColorContext.cs
- BasicCellRelation.cs
- RegexCode.cs
- LiteralControl.cs
- DocumentScope.cs
- XmlWriterDelegator.cs
- VoiceSynthesis.cs
- uribuilder.cs
- ConfigurationStrings.cs
- SafeLibraryHandle.cs
- CommandTreeTypeHelper.cs
- ProxyWebPartManager.cs
- CellRelation.cs
- DocumentPageView.cs
- ImageIndexConverter.cs
- infer.cs
- RSAPKCS1SignatureDeformatter.cs
- MethodBuilderInstantiation.cs
- SQLBinaryStorage.cs
- ConfigXmlCDataSection.cs
- D3DImage.cs
- AssemblyNameProxy.cs
- CachedCompositeFamily.cs
- DataSourceXmlAttributeAttribute.cs
- ForEachAction.cs
- shaperfactoryquerycachekey.cs
- Config.cs
- ProgressiveCrcCalculatingStream.cs
- DbDataAdapter.cs
- HttpModulesSection.cs
- EdmValidator.cs
- Aggregates.cs
- NetCodeGroup.cs
- ObjectTypeMapping.cs
- EntityDescriptor.cs
- UnhandledExceptionEventArgs.cs
- WsatAdminException.cs
- ErrorStyle.cs
- LocalServiceSecuritySettings.cs
- Baml2006SchemaContext.cs
- hwndwrapper.cs
- TemplateColumn.cs
- EtwTrace.cs
- TextEditorLists.cs
- LingerOption.cs
- ObjectPersistData.cs
- ItemCollection.cs
- CodeGeneratorAttribute.cs
- TreeNodeSelectionProcessor.cs
- InvokeHandlers.cs
- FormClosingEvent.cs
- XmlCollation.cs
- PersonalizationStateInfoCollection.cs
- TraceUtils.cs
- HMACSHA384.cs
- WizardForm.cs
- XAMLParseException.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- EncoderExceptionFallback.cs
- TdsParserStaticMethods.cs
- EpmContentDeSerializerBase.cs
- QilName.cs
- PageCatalogPart.cs
- ObjRef.cs
- PassportAuthentication.cs
- ValidationHelpers.cs
- Slider.cs
- SimpleBitVector32.cs
- SortQuery.cs
- LineSegment.cs
- ColorPalette.cs
- XPathEmptyIterator.cs
- TextContainerChangedEventArgs.cs
- ApplicationServiceHelper.cs
- unitconverter.cs
- GridLength.cs
- MimeTypeMapper.cs
- TypeDescriptionProviderAttribute.cs
- DataSourceHelper.cs
- FileStream.cs
- PreProcessInputEventArgs.cs
- SQLInt64.cs
- XmlNamespaceManager.cs
- SrgsText.cs
- NavigatorInput.cs
- ReachDocumentPageSerializerAsync.cs