Code:
/ FX-1434 / FX-1434 / 1.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
- ThicknessConverter.cs
- CacheDependency.cs
- DbUpdateCommandTree.cs
- SerializationStore.cs
- UshortList2.cs
- XmlDictionaryReaderQuotasElement.cs
- ConfigurationSectionCollection.cs
- EntityClassGenerator.cs
- SwitchAttribute.cs
- Span.cs
- KerberosSecurityTokenAuthenticator.cs
- Accessible.cs
- Vector.cs
- WindowsTokenRoleProvider.cs
- SimpleTextLine.cs
- WebBrowserPermission.cs
- WebPartMenu.cs
- HtmlShimManager.cs
- FileDialogPermission.cs
- smtpconnection.cs
- IInstanceContextProvider.cs
- DifferencingCollection.cs
- TextTreeNode.cs
- XslNumber.cs
- DateTimeFormatInfoScanner.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- CheckBoxFlatAdapter.cs
- CompilationUtil.cs
- CheckBoxField.cs
- XmlCharCheckingWriter.cs
- Types.cs
- ViewLoader.cs
- CredentialManagerDialog.cs
- SnapLine.cs
- UnitySerializationHolder.cs
- DataBindEngine.cs
- TypeToArgumentTypeConverter.cs
- Identifier.cs
- CompensationTokenData.cs
- codemethodreferenceexpression.cs
- WebColorConverter.cs
- DataGridViewBand.cs
- XpsTokenContext.cs
- PolyLineSegmentFigureLogic.cs
- MimePart.cs
- SmiRecordBuffer.cs
- DefaultCommandExtensionCallback.cs
- HeaderUtility.cs
- StateMachineHistory.cs
- DesignerCommandAdapter.cs
- HttpResponseHeader.cs
- Solver.cs
- ProcessModule.cs
- TemplatePagerField.cs
- CompilerParameters.cs
- TypeBuilder.cs
- Vector3DConverter.cs
- FigureParagraph.cs
- WindowsToolbar.cs
- WinInet.cs
- URI.cs
- CurrentChangingEventArgs.cs
- Preprocessor.cs
- ListenerElementsCollection.cs
- DateTimeUtil.cs
- Base64Stream.cs
- Margins.cs
- TextEditorMouse.cs
- NativeMethodsOther.cs
- UserControlCodeDomTreeGenerator.cs
- Control.cs
- WebControl.cs
- TextLineResult.cs
- CreateUserErrorEventArgs.cs
- UnauthorizedWebPart.cs
- GZipStream.cs
- HtmlInputControl.cs
- ContentType.cs
- XmlValidatingReaderImpl.cs
- XmlSchemaAppInfo.cs
- EncodingTable.cs
- ContractCodeDomInfo.cs
- SqlParameterCollection.cs
- StateDesigner.cs
- DecoderBestFitFallback.cs
- Keywords.cs
- RuntimeArgument.cs
- RadialGradientBrush.cs
- TrackingSection.cs
- WindowsUpDown.cs
- GeometryModel3D.cs
- Configuration.cs
- ExtensionQuery.cs
- PlanCompiler.cs
- WbmpConverter.cs
- XmlWriter.cs
- MasterPageParser.cs
- PaintEvent.cs
- HierarchicalDataBoundControlAdapter.cs
- WebSysDisplayNameAttribute.cs