Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / Design / DesignerVerb.cs / 1 / 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
- ComponentCommands.cs
- CompilationSection.cs
- TextBlockAutomationPeer.cs
- EventDescriptorCollection.cs
- Assert.cs
- GenericAuthenticationEventArgs.cs
- DetailsViewCommandEventArgs.cs
- UnknownExceptionActionHelper.cs
- SyntaxCheck.cs
- AsyncDataRequest.cs
- SystemInfo.cs
- CheckedPointers.cs
- MetadataProperty.cs
- SerializationSectionGroup.cs
- ChangeTracker.cs
- ClonableStack.cs
- SerialPort.cs
- LightweightEntityWrapper.cs
- StylusPointProperty.cs
- DataSourceProvider.cs
- Visual3DCollection.cs
- FileSystemEnumerable.cs
- CodeObjectCreateExpression.cs
- DeflateEmulationStream.cs
- Types.cs
- WebBrowser.cs
- FrameSecurityDescriptor.cs
- TraceContext.cs
- ComponentChangedEvent.cs
- DBSqlParserColumnCollection.cs
- CellTreeNodeVisitors.cs
- BooleanAnimationBase.cs
- COM2IProvidePropertyBuilderHandler.cs
- SqlMethods.cs
- CreatingCookieEventArgs.cs
- TrustLevelCollection.cs
- RelationshipEndMember.cs
- BaseParaClient.cs
- AppSecurityManager.cs
- WebPartConnectionsEventArgs.cs
- DataSourceGroupCollection.cs
- DataGridTableCollection.cs
- XmlHierarchyData.cs
- StrokeCollectionDefaultValueFactory.cs
- BrowserCapabilitiesFactoryBase.cs
- ToolStripPanelCell.cs
- CodeDOMProvider.cs
- _CommandStream.cs
- AnimationStorage.cs
- AudioFormatConverter.cs
- _DomainName.cs
- DataGridViewCellFormattingEventArgs.cs
- AutomationEvent.cs
- ToolStripContainer.cs
- ResourceProviderFactory.cs
- IPAddressCollection.cs
- VisualStateGroup.cs
- SqlXml.cs
- StorageMappingItemLoader.cs
- Grid.cs
- OneWayChannelListener.cs
- TypeDescriptorFilterService.cs
- StandardCommands.cs
- AnnotationAuthorChangedEventArgs.cs
- Cursor.cs
- DataGridViewCellPaintingEventArgs.cs
- CultureInfoConverter.cs
- DelegateSerializationHolder.cs
- CustomErrorsSection.cs
- CharAnimationBase.cs
- SamlSecurityTokenAuthenticator.cs
- JpegBitmapEncoder.cs
- SerialStream.cs
- BinaryOperationBinder.cs
- Message.cs
- WindowsTab.cs
- ComEventsSink.cs
- CompilationAssemblyInstallComponent.cs
- ProtocolElementCollection.cs
- ImageDrawing.cs
- TreeViewDesigner.cs
- JsonWriter.cs
- QilUnary.cs
- TTSEngineTypes.cs
- IERequestCache.cs
- StructuredTypeEmitter.cs
- ResourceDictionaryCollection.cs
- HttpHandlersSection.cs
- EdmComplexPropertyAttribute.cs
- SecurityVerifiedMessage.cs
- FormsAuthentication.cs
- ReachNamespaceInfo.cs
- OLEDB_Util.cs
- HeaderCollection.cs
- ApplicationBuildProvider.cs
- MonitorWrapper.cs
- Vector3D.cs
- UserControlCodeDomTreeGenerator.cs
- AssemblyCollection.cs
- AuthenticationServiceManager.cs