Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Services / Monitoring / system / Diagnosticts / Design / VerbConverter.cs / 1 / VerbConverter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Diagnostics.Design {
using System.Diagnostics;
using System;
using System.Design;
using System.Windows.Forms.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Globalization;
///
///
/// Editor that shows a list of verbs based on the value of the FileName property.
///
///
internal class VerbConverter : TypeConverter {
private const string DefaultVerb = SR.VerbEditorDefault;
///
///
///
/// Initializes a new instance of the 'VerbConverter' class for the given type.
///
///
public VerbConverter() {
}
///
///
///
///
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) {
if (sourceType == typeof(string)) {
return true;
}
return base.CanConvertFrom(context, sourceType);
}
///
///
///
///
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) {
if (value is string) {
string text = ((string)value).Trim();
return text;
}
return base.ConvertFrom(context, culture, value);
}
///
///
///
/// Gets a collection of standard values for the data type this validator is
/// designed for.
///
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
ProcessStartInfo info = (context == null) ? null : context.Instance as ProcessStartInfo;
StandardValuesCollection values;
if (info != null)
values = new StandardValuesCollection(info.Verbs);
else
values = null;
return values;
}
///
///
///
/// Gets a value indicating
/// whether this object
/// supports a standard set of values that can be picked
/// from a list using the specified context.
///
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) {
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) {
return false;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RoutedEventArgs.cs
- RedirectionProxy.cs
- ServiceChannelManager.cs
- ConnectionProviderAttribute.cs
- ContractsBCL.cs
- ProxyElement.cs
- ReferenceEqualityComparer.cs
- ConfigXmlElement.cs
- Route.cs
- SqlLiftWhereClauses.cs
- PerformanceCounterLib.cs
- PropertyChangedEventManager.cs
- CompensationExtension.cs
- AnimationException.cs
- TriggerCollection.cs
- ComponentEvent.cs
- ContentElementCollection.cs
- AppDomainFactory.cs
- WebPartMovingEventArgs.cs
- FlowDocumentScrollViewer.cs
- ConnectionInterfaceCollection.cs
- _ListenerAsyncResult.cs
- TableLayoutPanelDesigner.cs
- ItemContainerGenerator.cs
- InputBuffer.cs
- WindowsPrincipal.cs
- Rect.cs
- LeaseManager.cs
- sortedlist.cs
- ItemPager.cs
- CustomError.cs
- PropertySet.cs
- _SSPIWrapper.cs
- BitmapEffectGeneralTransform.cs
- Int64.cs
- ToolboxDataAttribute.cs
- SqlStatistics.cs
- StoragePropertyMapping.cs
- GenericEnumerator.cs
- Query.cs
- ScaleTransform.cs
- Message.cs
- CodeTypeDeclarationCollection.cs
- ButtonBaseAutomationPeer.cs
- Compiler.cs
- pingexception.cs
- EntityCodeGenerator.cs
- LowerCaseStringConverter.cs
- NavigationPropertyEmitter.cs
- ProcessModelSection.cs
- SortDescriptionCollection.cs
- ControlParser.cs
- ApplicationException.cs
- GenericTypeParameterBuilder.cs
- SqlDataSourceView.cs
- IPEndPointCollection.cs
- Attributes.cs
- WebPartHeaderCloseVerb.cs
- EntityDataSourceDesignerHelper.cs
- FileDataSourceCache.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- TreeBuilderXamlTranslator.cs
- EventWaitHandle.cs
- SimpleHandlerBuildProvider.cs
- JumpPath.cs
- Transform3DGroup.cs
- Bits.cs
- FixedFindEngine.cs
- SendKeys.cs
- IdentityModelDictionary.cs
- ResourceDictionary.cs
- XPathNodePointer.cs
- CodeThrowExceptionStatement.cs
- MultiBinding.cs
- RowsCopiedEventArgs.cs
- HttpListener.cs
- DynamicMethod.cs
- EvidenceBase.cs
- UriTemplateDispatchFormatter.cs
- IdnMapping.cs
- HttpCapabilitiesSectionHandler.cs
- ObjectViewFactory.cs
- ButtonFieldBase.cs
- HttpCachePolicyElement.cs
- CapabilitiesUse.cs
- WsatProxy.cs
- Rectangle.cs
- StringOutput.cs
- IdentityReference.cs
- StylusCaptureWithinProperty.cs
- ObjectMemberMapping.cs
- AxHost.cs
- CollectionBuilder.cs
- MissingManifestResourceException.cs
- ServiceInfo.cs
- MessageAction.cs
- JpegBitmapEncoder.cs
- DataBindEngine.cs
- ISFTagAndGuidCache.cs
- EFColumnProvider.cs