Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / ui / RegisteredScript.cs / 2 / 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
- ProfileParameter.cs
- ContainerFilterService.cs
- PropertyCondition.cs
- RelationshipNavigation.cs
- MulticastNotSupportedException.cs
- BinaryConverter.cs
- LookupBindingPropertiesAttribute.cs
- LostFocusEventManager.cs
- StrokeDescriptor.cs
- GotoExpression.cs
- RootNamespaceAttribute.cs
- CodeDomDecompiler.cs
- ProcessHostMapPath.cs
- RecognizerBase.cs
- Quaternion.cs
- TemplateBindingExtension.cs
- SafeFileMappingHandle.cs
- PingReply.cs
- WsdlBuildProvider.cs
- HttpCookiesSection.cs
- RowParagraph.cs
- NativeMethods.cs
- NameScopePropertyAttribute.cs
- MetaModel.cs
- WebControlAdapter.cs
- Command.cs
- EntityDataSourceDataSelection.cs
- DataSourceComponent.cs
- Boolean.cs
- TextParaLineResult.cs
- MimeTypeAttribute.cs
- LinkButton.cs
- DataPointer.cs
- ServicePoint.cs
- CompositeDuplexBindingElement.cs
- ByteStack.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- WinCategoryAttribute.cs
- FreeFormDragDropManager.cs
- SpecularMaterial.cs
- XsdDataContractImporter.cs
- HitTestFilterBehavior.cs
- TransformerConfigurationWizardBase.cs
- GeometryDrawing.cs
- KeyFrames.cs
- ScriptControlManager.cs
- RouteTable.cs
- ObjectDataSourceMethodEventArgs.cs
- CommonDialog.cs
- SByteConverter.cs
- GridViewPageEventArgs.cs
- ForeignConstraint.cs
- FrameworkElementFactoryMarkupObject.cs
- CodeCatchClause.cs
- AddInAttribute.cs
- FieldTemplateFactory.cs
- CaseExpr.cs
- LoginCancelEventArgs.cs
- CollaborationHelperFunctions.cs
- EventHandlerList.cs
- WebRequestModulesSection.cs
- FamilyTypeface.cs
- ArrayList.cs
- DesignRelation.cs
- XmlBinaryReader.cs
- OneOf.cs
- PeerNameResolver.cs
- DataGridRowClipboardEventArgs.cs
- Attributes.cs
- NullReferenceException.cs
- SQLBinary.cs
- ScrollProperties.cs
- SHA256Managed.cs
- PackageDigitalSignatureManager.cs
- ResourceProperty.cs
- WebContext.cs
- Currency.cs
- EmissiveMaterial.cs
- WebPartEditorCancelVerb.cs
- StrongName.cs
- OleDbParameterCollection.cs
- XmlSchemaFacet.cs
- BitmapEffectOutputConnector.cs
- MouseWheelEventArgs.cs
- DocumentSequenceHighlightLayer.cs
- SeverityFilter.cs
- ExceptionWrapper.cs
- FramingChannels.cs
- VideoDrawing.cs
- WebPartDescriptionCollection.cs
- XPathDocumentIterator.cs
- WasNotInstalledException.cs
- SecureEnvironment.cs
- DataServiceSaveChangesEventArgs.cs
- ExtendedPropertyDescriptor.cs
- WebPartConnectionsConnectVerb.cs
- WindowsTokenRoleProvider.cs
- EventLogPermission.cs
- WindowsStartMenu.cs
- StatusStrip.cs