Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / ScriptBehaviorDescriptor.cs / 1305376 / 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.Web; using System.Web.Resources; 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.Web; using System.Web.Resources; 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
- XmlSchemaSequence.cs
- SiteMap.cs
- FamilyCollection.cs
- WindowsGraphicsCacheManager.cs
- WebControlsSection.cs
- OutputCacheModule.cs
- Single.cs
- Baml2006KnownTypes.cs
- XmlReaderSettings.cs
- XmlTextEncoder.cs
- XPathChildIterator.cs
- HTMLTextWriter.cs
- Int32AnimationUsingKeyFrames.cs
- AppendHelper.cs
- SynchronizationLockException.cs
- DesignerSerializerAttribute.cs
- Descriptor.cs
- CheckBoxDesigner.cs
- WSDualHttpSecurityMode.cs
- UnsafeNativeMethods.cs
- EntityCodeGenerator.cs
- CodeGroup.cs
- ListenerElementsCollection.cs
- Matrix.cs
- Canvas.cs
- DateTimePickerDesigner.cs
- ModelPerspective.cs
- HttpClientCertificate.cs
- ObjectListItem.cs
- TreeNodeClickEventArgs.cs
- ToolStripManager.cs
- Stacktrace.cs
- DataMember.cs
- SplitterPanelDesigner.cs
- Registry.cs
- X500Name.cs
- XmlTextReaderImplHelpers.cs
- XmlFormatExtensionPrefixAttribute.cs
- BitmapEffectCollection.cs
- OleDbCommand.cs
- CodeBinaryOperatorExpression.cs
- CalendarDesigner.cs
- ScaleTransform3D.cs
- Container.cs
- SiteMap.cs
- EtwProvider.cs
- SafeSystemMetrics.cs
- SimpleFileLog.cs
- RepeaterItemEventArgs.cs
- AudioBase.cs
- ListControlBuilder.cs
- DynamicILGenerator.cs
- ClientFormsAuthenticationCredentials.cs
- ILGenerator.cs
- DataGridViewRowConverter.cs
- FilterException.cs
- CryptoProvider.cs
- CollectionsUtil.cs
- httpserverutility.cs
- SourceFilter.cs
- ConcurrentQueue.cs
- ReferenceSchema.cs
- RepeatBehavior.cs
- ListViewHitTestInfo.cs
- ObjectDataSourceView.cs
- BamlLocalizationDictionary.cs
- XmlSerializerNamespaces.cs
- DelegateSerializationHolder.cs
- StrokeNodeOperations.cs
- InvalidAsynchronousStateException.cs
- ValidatingCollection.cs
- SafeRightsManagementSessionHandle.cs
- Configuration.cs
- SqlDataSourceView.cs
- IgnoreDeviceFilterElementCollection.cs
- RangeValuePattern.cs
- WorkflowShape.cs
- LinkArea.cs
- PrintSchema.cs
- FormViewCommandEventArgs.cs
- DataKey.cs
- AppDomain.cs
- SkinBuilder.cs
- PrivilegedConfigurationManager.cs
- XmlWriterSettings.cs
- ComponentCache.cs
- UIElementIsland.cs
- SizeValueSerializer.cs
- RowToParametersTransformer.cs
- CreateInstanceBinder.cs
- ClaimTypes.cs
- DetailsViewUpdateEventArgs.cs
- HostedController.cs
- DataServiceExpressionVisitor.cs
- VectorAnimation.cs
- CodeVariableReferenceExpression.cs
- TypeInfo.cs
- BitArray.cs
- _SslStream.cs
- CompilerResults.cs