Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / ui / ScriptBehaviorDescriptor.cs / 2 / ScriptBehaviorDescriptor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Security.Permissions; using System.Web; using System.Web.Resources; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) ] public class ScriptBehaviorDescriptor : ScriptComponentDescriptor { private string _name; [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID")] public ScriptBehaviorDescriptor(string type, string elementID) : base(type, elementID) { RegisterDispose = false; } public override string ClientID { get { if (String.IsNullOrEmpty(ID)) { Debug.Assert(!String.IsNullOrEmpty(ElementID), "Base ctor ensures ElementID is not null or empty"); return ElementID + "$" + Name; } else { return ID; } } } [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID")] public string ElementID { get { return base.ElementIDInternal; } } public string Name { get { if (String.IsNullOrEmpty(_name)) { return GetTypeName(this.Type); } else { return _name; } } set { _name = value; } } // Returns the short name of a possibly namespace-qualified type name. // Examples: // "TestNS1.TestNS2.TestType" -> "TestType" // "TestType" -> "TestType" private static string GetTypeName(string type) { int index = type.LastIndexOf('.'); if (index == -1) { return type; } else { return type.Substring(index + 1); } } protected internal override string GetScript() { if (!String.IsNullOrEmpty(_name)) { AddProperty("name", _name); } return base.GetScript(); } } } // 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.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Security.Permissions; using System.Web; using System.Web.Resources; [ AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) ] public class ScriptBehaviorDescriptor : ScriptComponentDescriptor { private string _name; [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID")] public ScriptBehaviorDescriptor(string type, string elementID) : base(type, elementID) { RegisterDispose = false; } public override string ClientID { get { if (String.IsNullOrEmpty(ID)) { Debug.Assert(!String.IsNullOrEmpty(ElementID), "Base ctor ensures ElementID is not null or empty"); return ElementID + "$" + Name; } else { return ID; } } } [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ID")] public string ElementID { get { return base.ElementIDInternal; } } public string Name { get { if (String.IsNullOrEmpty(_name)) { return GetTypeName(this.Type); } else { return _name; } } set { _name = value; } } // Returns the short name of a possibly namespace-qualified type name. // Examples: // "TestNS1.TestNS2.TestType" -> "TestType" // "TestType" -> "TestType" private static string GetTypeName(string type) { int index = type.LastIndexOf('.'); if (index == -1) { return type; } else { return type.Substring(index + 1); } } protected internal override string GetScript() { if (!String.IsNullOrEmpty(_name)) { AddProperty("name", _name); } return base.GetScript(); } } } // 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
- DataGridPageChangedEventArgs.cs
- NativeMethods.cs
- EventLogger.cs
- CustomAttributeBuilder.cs
- MediaElementAutomationPeer.cs
- EventLog.cs
- PasswordDeriveBytes.cs
- PartialTrustVisibleAssemblyCollection.cs
- MarshalByRefObject.cs
- DataPointer.cs
- TypeUtil.cs
- NativeMethods.cs
- XPathNodeIterator.cs
- TypeResolver.cs
- AssemblyBuilder.cs
- GlyphCache.cs
- tibetanshape.cs
- DesignerTransactionCloseEvent.cs
- ObjectResult.cs
- AlternationConverter.cs
- TransformPatternIdentifiers.cs
- RectangleHotSpot.cs
- IndentedTextWriter.cs
- DataKeyCollection.cs
- XmlSerializerFactory.cs
- TCPClient.cs
- Resources.Designer.cs
- TableItemStyle.cs
- DateTimeConverter2.cs
- XmlArrayItemAttribute.cs
- CommandManager.cs
- TypeHelpers.cs
- PathFigure.cs
- OverrideMode.cs
- WsdlInspector.cs
- NavigationService.cs
- PrintingPermission.cs
- TransformValueSerializer.cs
- VirtualPathProvider.cs
- HyperLinkColumn.cs
- RadioButtonFlatAdapter.cs
- DataTemplateKey.cs
- InfoCardTraceRecord.cs
- RegexTree.cs
- GenerateTemporaryTargetAssembly.cs
- GeneralTransform.cs
- ForEachDesigner.xaml.cs
- WebHeaderCollection.cs
- ThreadInterruptedException.cs
- webeventbuffer.cs
- ListViewAutomationPeer.cs
- InfoCardAsymmetricCrypto.cs
- WebPartEditorOkVerb.cs
- MsmqIntegrationBinding.cs
- __FastResourceComparer.cs
- CapacityStreamGeometryContext.cs
- BrowserCapabilitiesFactory.cs
- DataTableReaderListener.cs
- GetIndexBinder.cs
- WebSysDisplayNameAttribute.cs
- PersistenceProvider.cs
- WebReference.cs
- CommandLibraryHelper.cs
- _AuthenticationState.cs
- DataGridColumnDropSeparator.cs
- XamlTypeMapper.cs
- PointLight.cs
- DeadCharTextComposition.cs
- MarkupExtensionSerializer.cs
- SqlMethods.cs
- DataBoundControlAdapter.cs
- CompressionTracing.cs
- PropertyItem.cs
- LambdaCompiler.ControlFlow.cs
- WebPartTransformerCollection.cs
- InstalledFontCollection.cs
- NativeMethods.cs
- DataTransferEventArgs.cs
- TableRowCollection.cs
- BufferBuilder.cs
- TypeConverterAttribute.cs
- TableRow.cs
- DesignerOptionService.cs
- PointCollection.cs
- GroupBoxAutomationPeer.cs
- MasterPageCodeDomTreeGenerator.cs
- UsernameTokenFactoryCredential.cs
- EntityViewGenerator.cs
- IdnMapping.cs
- filewebrequest.cs
- CodePageEncoding.cs
- GenericAuthenticationEventArgs.cs
- ValidatorCompatibilityHelper.cs
- LoopExpression.cs
- basemetadatamappingvisitor.cs
- BaseProcessor.cs
- HtmlInputControl.cs
- TextView.cs
- DataGridViewCellParsingEventArgs.cs
- Range.cs