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
- PropertyDescriptorCollection.cs
- RijndaelManagedTransform.cs
- HatchBrush.cs
- VectorCollectionValueSerializer.cs
- Guid.cs
- XamlSerializerUtil.cs
- MemberMaps.cs
- ApplicationSecurityInfo.cs
- UIElementParagraph.cs
- XmlAttributeAttribute.cs
- InternalResources.cs
- ListBoxAutomationPeer.cs
- PackageDigitalSignatureManager.cs
- SamlSubject.cs
- TdsParserHelperClasses.cs
- NetMsmqSecurityMode.cs
- Label.cs
- InvalidOperationException.cs
- Manipulation.cs
- CodeDirectiveCollection.cs
- SpeakCompletedEventArgs.cs
- SqlParameter.cs
- OdbcConnectionOpen.cs
- ChangeTracker.cs
- TraceContext.cs
- CipherData.cs
- UnsafeNativeMethods.cs
- HtmlString.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- SafeSecurityHelper.cs
- JsonFormatReaderGenerator.cs
- TemplateBindingExpression.cs
- Menu.cs
- XmlKeywords.cs
- ClientSideProviderDescription.cs
- DataGridViewRowsRemovedEventArgs.cs
- _NTAuthentication.cs
- SecurityCriticalDataForSet.cs
- OptionUsage.cs
- SqlParameter.cs
- FlowDocumentPaginator.cs
- ClientUtils.cs
- Geometry3D.cs
- PrimitiveType.cs
- UdpMessageProperty.cs
- TempFiles.cs
- TraceHwndHost.cs
- RuleCache.cs
- ScriptReference.cs
- _NetworkingPerfCounters.cs
- Dump.cs
- GridLengthConverter.cs
- Renderer.cs
- DatePickerDateValidationErrorEventArgs.cs
- HtmlTableRowCollection.cs
- FormsAuthenticationUserCollection.cs
- ArithmeticException.cs
- DataSourceXmlSerializer.cs
- ProcessActivityTreeOptions.cs
- TextFormatterHost.cs
- CallSiteBinder.cs
- SchemaDeclBase.cs
- Regex.cs
- messageonlyhwndwrapper.cs
- ObjectMemberMapping.cs
- FixedSOMTableRow.cs
- CacheDependency.cs
- WindowsToolbarAsMenu.cs
- Size3DConverter.cs
- _BaseOverlappedAsyncResult.cs
- SplitterPanel.cs
- HorizontalAlignConverter.cs
- Bookmark.cs
- ReverseQueryOperator.cs
- InheritanceRules.cs
- HtmlInputSubmit.cs
- HitTestParameters.cs
- ProtocolsConfigurationEntry.cs
- CheckoutException.cs
- SystemResourceHost.cs
- SerializableReadOnlyDictionary.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- ZoneLinkButton.cs
- DmlSqlGenerator.cs
- NativeMethods.cs
- RuntimeUtils.cs
- DbDataSourceEnumerator.cs
- BStrWrapper.cs
- RelationalExpressions.cs
- Pkcs7Signer.cs
- CodeLinePragma.cs
- InputChannel.cs
- BitmapEffectCollection.cs
- MenuItem.cs
- ProtocolsConfigurationHandler.cs
- HyperLinkStyle.cs
- WebPartConnectVerb.cs
- BitmapEffectGroup.cs
- BlockUIContainer.cs
- TreeNodeStyleCollection.cs