Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / Design / DesignerVerb.cs / 1305376 / DesignerVerb.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel.Design {
using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
using System.Text.RegularExpressions;
///
/// Represents a verb that can be executed by a component's designer.
///
[HostProtection(SharedState = true)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public class DesignerVerb : MenuCommand {
///
///
/// Initializes a new instance of the class.
///
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public DesignerVerb(string text, EventHandler handler) : base(handler, StandardCommands.VerbFirst) {
Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); // VSWHIDBEY 485835
}
///
///
/// Initializes a new instance of the
/// class.
///
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public DesignerVerb(string text, EventHandler handler, CommandID startCommandID) : base(handler, startCommandID) {
Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", "");// VSWHIDBEY 485835
}
///
/// Gets or sets the description of the menu item for the verb.
///
public string Description {
get {
object result = Properties["Description"];
if (result == null) {
return String.Empty;
}
return (string)result;
}
set {
Properties["Description"] = value;
}
}
///
///
/// Gets or sets the text to show on the menu item for the verb.
///
///
public string Text {
get {
object result = Properties["Text"];
if (result == null) {
return String.Empty;
}
return (string)result;
}
}
///
///
/// Overrides object's ToString().
///
///
public override string ToString() {
return Text + " : " + base.ToString();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel.Design {
using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
using System.Text.RegularExpressions;
///
/// Represents a verb that can be executed by a component's designer.
///
[HostProtection(SharedState = true)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name="FullTrust")]
public class DesignerVerb : MenuCommand {
///
///
/// Initializes a new instance of the class.
///
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public DesignerVerb(string text, EventHandler handler) : base(handler, StandardCommands.VerbFirst) {
Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); // VSWHIDBEY 485835
}
///
///
/// Initializes a new instance of the
/// class.
///
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public DesignerVerb(string text, EventHandler handler, CommandID startCommandID) : base(handler, startCommandID) {
Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", "");// VSWHIDBEY 485835
}
///
/// Gets or sets the description of the menu item for the verb.
///
public string Description {
get {
object result = Properties["Description"];
if (result == null) {
return String.Empty;
}
return (string)result;
}
set {
Properties["Description"] = value;
}
}
///
///
/// Gets or sets the text to show on the menu item for the verb.
///
///
public string Text {
get {
object result = Properties["Text"];
if (result == null) {
return String.Empty;
}
return (string)result;
}
}
///
///
/// Overrides object's ToString().
///
///
public override string ToString() {
return Text + " : " + base.ToString();
}
}
}
// 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
- DrawListViewSubItemEventArgs.cs
- NullRuntimeConfig.cs
- FileFormatException.cs
- VectorValueSerializer.cs
- PageStatePersister.cs
- filewebresponse.cs
- UpdateExpressionVisitor.cs
- UnauthorizedAccessException.cs
- AssemblyAttributesGoHere.cs
- TimeSpanStorage.cs
- PartitionResolver.cs
- EntityDataSourceUtil.cs
- DropShadowBitmapEffect.cs
- DataControlLinkButton.cs
- Internal.cs
- SqlCommandSet.cs
- ExtensionCollection.cs
- DependencyObjectType.cs
- ProtocolsConfiguration.cs
- MetadataArtifactLoaderCompositeFile.cs
- XmlDeclaration.cs
- Byte.cs
- WebCategoryAttribute.cs
- DurableMessageDispatchInspector.cs
- XmlNavigatorFilter.cs
- BindableAttribute.cs
- FixedDocument.cs
- CollectionViewProxy.cs
- ThreadPool.cs
- Guid.cs
- ProcessHost.cs
- ScriptControlDescriptor.cs
- PtsHost.cs
- ScrollBar.cs
- SafeRightsManagementPubHandle.cs
- InheritablePropertyChangeInfo.cs
- SQLDecimal.cs
- SafeNativeMethods.cs
- infer.cs
- StatusInfoItem.cs
- EntityContainerAssociationSetEnd.cs
- LinkedResourceCollection.cs
- ActivationArguments.cs
- PointAnimation.cs
- StringUtil.cs
- ProviderConnectionPointCollection.cs
- HttpContextServiceHost.cs
- CroppedBitmap.cs
- BamlLocalizableResourceKey.cs
- CompositeKey.cs
- ParserExtension.cs
- CultureInfoConverter.cs
- OdbcEnvironment.cs
- InvokePatternIdentifiers.cs
- DocumentViewerHelper.cs
- CodeSnippetStatement.cs
- ApplicationActivator.cs
- RoleService.cs
- InstanceLockException.cs
- AsynchronousChannelMergeEnumerator.cs
- PickDesigner.xaml.cs
- QueryMatcher.cs
- RandomNumberGenerator.cs
- InheritablePropertyChangeInfo.cs
- HttpResponseInternalBase.cs
- LayoutSettings.cs
- CellTreeSimplifier.cs
- SerializationSectionGroup.cs
- RSAProtectedConfigurationProvider.cs
- LocalizationParserHooks.cs
- ScrollProperties.cs
- DataGridTextBox.cs
- Button.cs
- LinqDataSourceInsertEventArgs.cs
- ConnectionsZoneDesigner.cs
- Environment.cs
- VerificationAttribute.cs
- TableDetailsRow.cs
- DataGridItem.cs
- XhtmlConformanceSection.cs
- StyleCollectionEditor.cs
- SingletonChannelAcceptor.cs
- ToolStripItemCollection.cs
- DataGridViewRow.cs
- DiagnosticTraceSource.cs
- FontFaceLayoutInfo.cs
- WebDisplayNameAttribute.cs
- Accessible.cs
- SqlRewriteScalarSubqueries.cs
- EntityException.cs
- OracleException.cs
- AssociationTypeEmitter.cs
- MessageDroppedTraceRecord.cs
- XmlLangPropertyAttribute.cs
- WindowsBrush.cs
- HostAdapter.cs
- _NegoState.cs
- SystemDropShadowChrome.cs
- RouteValueDictionary.cs
- SecurityProtocolFactory.cs