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
- PerfProviderCollection.cs
- ConfigurationErrorsException.cs
- FreezableCollection.cs
- HtmlControlPersistable.cs
- SHA256.cs
- SafeHandle.cs
- ZipIOLocalFileDataDescriptor.cs
- FunctionQuery.cs
- ToolTip.cs
- DurationConverter.cs
- DataGridTemplateColumn.cs
- OdbcInfoMessageEvent.cs
- CodeComment.cs
- StringDictionaryEditor.cs
- PropertyPushdownHelper.cs
- ColumnReorderedEventArgs.cs
- HttpCookie.cs
- WebPartMenuStyle.cs
- GeometryValueSerializer.cs
- ConstructorBuilder.cs
- Button.cs
- Console.cs
- SQLInt32Storage.cs
- StylusShape.cs
- XmlIlVisitor.cs
- MetafileHeader.cs
- NativeMethods.cs
- MultiBinding.cs
- TreeNodeStyle.cs
- GroupBox.cs
- DBSqlParserTableCollection.cs
- LogRestartAreaEnumerator.cs
- WindowsAuthenticationModule.cs
- TextHidden.cs
- TextTreeTextBlock.cs
- TemplateXamlParser.cs
- SuppressMessageAttribute.cs
- EncoderParameter.cs
- httpserverutility.cs
- ItemPager.cs
- SmiRequestExecutor.cs
- PackageRelationshipCollection.cs
- SafeCryptoKeyHandle.cs
- VersionValidator.cs
- Calendar.cs
- PtsPage.cs
- MobileResource.cs
- StylusPointCollection.cs
- JsonXmlDataContract.cs
- xml.cs
- SendKeys.cs
- WebSysDisplayNameAttribute.cs
- ConnectionStringsExpressionBuilder.cs
- Pen.cs
- XmlText.cs
- JapaneseCalendar.cs
- DesignTimeTemplateParser.cs
- UriTemplateTableMatchCandidate.cs
- ObjectViewFactory.cs
- ProtocolReflector.cs
- MSAAEventDispatcher.cs
- DataGridViewUtilities.cs
- BamlReader.cs
- ObjectView.cs
- RSACryptoServiceProvider.cs
- IdentitySection.cs
- WindowsTreeView.cs
- WindowsGraphicsCacheManager.cs
- DynamicVirtualDiscoSearcher.cs
- GridViewCellAutomationPeer.cs
- NotEqual.cs
- SqlDataSourceRefreshSchemaForm.cs
- PrintDialogException.cs
- ManualResetEvent.cs
- DataErrorValidationRule.cs
- GroupBox.cs
- CodeDomDecompiler.cs
- PropertyBuilder.cs
- SuppressMergeCheckAttribute.cs
- XmlDomTextWriter.cs
- HyperLinkStyle.cs
- Rotation3DAnimationBase.cs
- DefaultHttpHandler.cs
- InitializationEventAttribute.cs
- MenuScrollingVisibilityConverter.cs
- SqlDataSourceCommandEventArgs.cs
- DocumentOutline.cs
- WindowsRichEditRange.cs
- XmlObjectSerializerWriteContextComplex.cs
- HtmlControl.cs
- TextInfo.cs
- LinqDataSourceEditData.cs
- OperationCanceledException.cs
- ColorContext.cs
- GlyphCache.cs
- SystemUdpStatistics.cs
- PtsPage.cs
- SelectedCellsCollection.cs
- CharUnicodeInfo.cs
- ProxyElement.cs