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
- WebBrowserNavigatedEventHandler.cs
- GPRECT.cs
- ErrorItem.cs
- DataSourceProvider.cs
- CharStorage.cs
- DependencyPropertyChangedEventArgs.cs
- IntranetCredentialPolicy.cs
- DeploymentSectionCache.cs
- IdleTimeoutMonitor.cs
- BitmapEffectInput.cs
- WindowsTooltip.cs
- MouseEventArgs.cs
- QuerySettings.cs
- ZipIOCentralDirectoryBlock.cs
- MsmqNonTransactedPoisonHandler.cs
- SchemaNamespaceManager.cs
- ImageMetadata.cs
- WebPartManager.cs
- Floater.cs
- OleDbDataAdapter.cs
- ScriptReferenceBase.cs
- LineBreakRecord.cs
- VisualStateGroup.cs
- StoragePropertyMapping.cs
- ComponentConverter.cs
- AggregateNode.cs
- SortedSetDebugView.cs
- QilXmlReader.cs
- loginstatus.cs
- DoubleStorage.cs
- StringStorage.cs
- ConfigXmlDocument.cs
- DesignerSerializationVisibilityAttribute.cs
- XPathNodeIterator.cs
- GeometryConverter.cs
- OleStrCAMarshaler.cs
- MetadataImporterQuotas.cs
- TableLayoutPanel.cs
- WsatRegistrationHeader.cs
- PathSegment.cs
- TabItemWrapperAutomationPeer.cs
- sqlser.cs
- DesignerView.xaml.cs
- FloaterParaClient.cs
- RequestValidator.cs
- ServerValidateEventArgs.cs
- WebAdminConfigurationHelper.cs
- SerializationObjectManager.cs
- BitmapMetadataBlob.cs
- GroupLabel.cs
- HitTestDrawingContextWalker.cs
- SafeIUnknown.cs
- VarRemapper.cs
- processwaithandle.cs
- SqlError.cs
- CodeDirectionExpression.cs
- SecurityPermission.cs
- MergeFailedEvent.cs
- TrackingProvider.cs
- XmlValidatingReader.cs
- ModelFunctionTypeElement.cs
- GridItemPatternIdentifiers.cs
- XmlNavigatorStack.cs
- LoginUtil.cs
- AssemblyNameProxy.cs
- MachineKeyConverter.cs
- IntegerValidatorAttribute.cs
- PrintPreviewControl.cs
- SystemIPInterfaceStatistics.cs
- TargetControlTypeAttribute.cs
- WizardStepCollectionEditor.cs
- SlipBehavior.cs
- X509Extension.cs
- TypedServiceChannelBuilder.cs
- AssemblyAssociatedContentFileAttribute.cs
- RowCache.cs
- ISAPIRuntime.cs
- MouseButton.cs
- LoadedOrUnloadedOperation.cs
- DataGridViewTextBoxCell.cs
- UriScheme.cs
- ResourceProviderFactory.cs
- StandardCommands.cs
- HtmlInputRadioButton.cs
- SingleAnimationUsingKeyFrames.cs
- DocumentXmlWriter.cs
- ColumnResult.cs
- StorageInfo.cs
- UnknownBitmapDecoder.cs
- SizeConverter.cs
- SessionEndingCancelEventArgs.cs
- XmlCharCheckingWriter.cs
- XmlNodeWriter.cs
- JsonFormatWriterGenerator.cs
- ObjectStorage.cs
- AmbientLight.cs
- ContractNamespaceAttribute.cs
- MetadataArtifactLoaderCompositeResource.cs
- GeneralTransform3DTo2D.cs
- MouseGestureConverter.cs