Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / ExpressionConverter.cs / 1305600 / ExpressionConverter.cs
//---------------------------------------------------------------------------- // // File: ExpressionConverter.cs // // Description: // TypeConverter for a generic property value expression // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; namespace System.Windows { ////// TypeConverter for a generic property value expression /// ////// The cole purpose of this TypeConveret is to block the /// default TypeConverter/ ToString() behavior /// public class ExpressionConverter : TypeConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return false; } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return false; } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { throw GetConvertFromException(value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { throw GetConvertToException(value, destinationType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ExpressionConverter.cs // // Description: // TypeConverter for a generic property value expression // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Globalization; using System.ComponentModel.Design.Serialization; namespace System.Windows { ////// TypeConverter for a generic property value expression /// ////// The cole purpose of this TypeConveret is to block the /// default TypeConverter/ ToString() behavior /// public class ExpressionConverter : TypeConverter { ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert from /// ////// true if conversion is possible /// public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return false; } ////// TypeConverter method override. /// /// /// ITypeDescriptorContext /// /// /// Type to convert to /// ////// true if conversion is possible /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return false; } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// ////// value that is result of conversion /// public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { throw GetConvertFromException(value); } ////// TypeConverter method implementation. /// /// /// ITypeDescriptorContext /// /// /// current culture (see CLR specs) /// /// /// value to convert from /// /// /// Type to convert to /// ////// converted value /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { throw GetConvertToException(value, destinationType); } } } // 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
- CompiledQueryCacheEntry.cs
- SqlGatherProducedAliases.cs
- StateDesigner.Helpers.cs
- RouteParser.cs
- ListItemCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- ProcessModuleCollection.cs
- AvTraceDetails.cs
- ToolStripScrollButton.cs
- Comparer.cs
- ParamArrayAttribute.cs
- CommandLibraryHelper.cs
- ExclusiveTcpListener.cs
- ConfigurationCollectionAttribute.cs
- MessageDispatch.cs
- CompModSwitches.cs
- ServiceContractDetailViewControl.cs
- CharEnumerator.cs
- DelegatingConfigHost.cs
- PtsHost.cs
- DetailsViewRowCollection.cs
- ResourceDescriptionAttribute.cs
- ValueSerializerAttribute.cs
- ColorConvertedBitmap.cs
- EntityParameter.cs
- ThreadInterruptedException.cs
- HtmlTableRowCollection.cs
- contentDescriptor.cs
- DesignBindingEditor.cs
- CachedBitmap.cs
- DependencyPropertyKind.cs
- FamilyTypeface.cs
- DiagnosticTrace.cs
- SafeBitVector32.cs
- HtmlElementErrorEventArgs.cs
- CachedPathData.cs
- LayoutSettings.cs
- FunctionDetailsReader.cs
- DropShadowBitmapEffect.cs
- WorkflowRuntime.cs
- CollectionBase.cs
- ExtendedPropertyCollection.cs
- ArraySegment.cs
- WizardStepBase.cs
- AttachInfo.cs
- MetadataStore.cs
- RoleGroup.cs
- ColorTransform.cs
- filewebrequest.cs
- PolyBezierSegment.cs
- RootProfilePropertySettingsCollection.cs
- CodeAccessSecurityEngine.cs
- DataServices.cs
- TextBlockAutomationPeer.cs
- XmlChildEnumerator.cs
- ErrorFormatterPage.cs
- UndoManager.cs
- StringWriter.cs
- CodeDOMProvider.cs
- FrameworkContentElement.cs
- SoapObjectWriter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- Block.cs
- SqlBulkCopy.cs
- FrameworkObject.cs
- ControlIdConverter.cs
- ExternalFile.cs
- FixedElement.cs
- InstallerTypeAttribute.cs
- _CookieModule.cs
- ThreadStartException.cs
- HMACMD5.cs
- UserPreferenceChangedEventArgs.cs
- LineServicesCallbacks.cs
- COM2PropertyDescriptor.cs
- SamlAction.cs
- CommonXSendMessage.cs
- DtrList.cs
- UrlUtility.cs
- DataGridViewBand.cs
- CodeDirectionExpression.cs
- AstNode.cs
- GB18030Encoding.cs
- ErrorRuntimeConfig.cs
- AliasGenerator.cs
- ResourcesGenerator.cs
- NeutralResourcesLanguageAttribute.cs
- TextTreeRootTextBlock.cs
- SynchronousReceiveElement.cs
- LightweightCodeGenerator.cs
- ExpandoObject.cs
- NamespaceListProperty.cs
- ApplicationBuildProvider.cs
- XmlSchema.cs
- FileReader.cs
- DbCommandTree.cs
- ObjectPersistData.cs
- TreeNodeStyleCollectionEditor.cs
- PropertyGroupDescription.cs
- XmlObjectSerializerReadContext.cs