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; /// /// /// public VerbConverter() { } ////// Initializes a new instance of the 'VerbConverter' class for the given type. /// ////// /// /// 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); } ////// /// /// 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 collection of standard values for the data type this validator is /// designed for. ////// /// /// 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.Gets a value indicating /// whether this object /// supports a standard set of values that can be picked /// from a list using the specified context. ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SynchronizingStream.cs
- HitTestResult.cs
- EasingQuaternionKeyFrame.cs
- Model3DGroup.cs
- _SSPISessionCache.cs
- CircleHotSpot.cs
- DictionaryContent.cs
- FrameworkPropertyMetadata.cs
- WebPartVerbCollection.cs
- ToolboxComponentsCreatedEventArgs.cs
- HierarchicalDataBoundControlAdapter.cs
- BrushConverter.cs
- BoolExpr.cs
- CommandEventArgs.cs
- Zone.cs
- BitmapSourceSafeMILHandle.cs
- Vector3dCollection.cs
- Profiler.cs
- XmlSchemaNotation.cs
- ComplexPropertyEntry.cs
- CommonObjectSecurity.cs
- SelectionEditor.cs
- DecoderExceptionFallback.cs
- UnsafeNativeMethods.cs
- ParameterBuilder.cs
- WorkItem.cs
- XPathChildIterator.cs
- HebrewCalendar.cs
- RuntimeVariablesExpression.cs
- CustomAttributeBuilder.cs
- FloaterBaseParagraph.cs
- SqlReorderer.cs
- MsmqBindingElementBase.cs
- IpcChannel.cs
- SchemaEntity.cs
- PostBackTrigger.cs
- GeneratedContractType.cs
- UserPreferenceChangingEventArgs.cs
- SystemResources.cs
- EntitySqlQueryState.cs
- HttpCapabilitiesEvaluator.cs
- FileVersion.cs
- InputLanguageManager.cs
- Attributes.cs
- AuthorizationRuleCollection.cs
- AstNode.cs
- EntityConnection.cs
- PeerCustomResolverElement.cs
- RegisteredScript.cs
- FormViewModeEventArgs.cs
- InternalDispatchObject.cs
- FreezableCollection.cs
- PenThread.cs
- DeclarationUpdate.cs
- XmlSchemaExternal.cs
- Models.cs
- mediaclock.cs
- JapaneseCalendar.cs
- NativeCppClassAttribute.cs
- RadioButtonPopupAdapter.cs
- XmlConvert.cs
- LocalizationParserHooks.cs
- ProcessManager.cs
- PrinterSettings.cs
- WSSecureConversation.cs
- ActivityExecutor.cs
- UserPersonalizationStateInfo.cs
- XmlSerializerOperationFormatter.cs
- WindowsPrincipal.cs
- ResourcesBuildProvider.cs
- NamedPipeTransportSecurityElement.cs
- GeneralTransform.cs
- future.cs
- UnmanagedMarshal.cs
- Verify.cs
- HttpModuleAction.cs
- SqlFacetAttribute.cs
- EntitySetBase.cs
- ExceptionRoutedEventArgs.cs
- RequestQueue.cs
- SimpleLine.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TextAdaptor.cs
- ErrorsHelper.cs
- MembershipSection.cs
- FloaterBaseParaClient.cs
- AudioStateChangedEventArgs.cs
- DecoderExceptionFallback.cs
- DeleteIndexBinder.cs
- Cursor.cs
- ComponentEditorPage.cs
- MasterPage.cs
- WhiteSpaceTrimStringConverter.cs
- DesignerActionHeaderItem.cs
- Internal.cs
- XmlNodeComparer.cs
- ColumnBinding.cs
- EntityDataSourceDataSelectionPanel.cs
- DesignerActionGlyph.cs
- UdpDiscoveryEndpoint.cs