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
- BitmapImage.cs
- RoutingEndpointTrait.cs
- Accessors.cs
- GrammarBuilderWildcard.cs
- TimestampInformation.cs
- BoundingRectTracker.cs
- DataTableMappingCollection.cs
- SegmentTree.cs
- connectionpool.cs
- SchemaElementLookUpTable.cs
- ImpersonationOption.cs
- GridViewSelectEventArgs.cs
- DocumentNUp.cs
- CompilerError.cs
- TypefaceMap.cs
- EncoderParameters.cs
- IntSecurity.cs
- FixedHighlight.cs
- DES.cs
- RequestCachePolicy.cs
- HorizontalAlignConverter.cs
- UInt32.cs
- WebPartConnectionsCloseVerb.cs
- ReleaseInstanceMode.cs
- TableRowsCollectionEditor.cs
- XmlDocumentType.cs
- XmlComplianceUtil.cs
- WebPartDisplayModeCancelEventArgs.cs
- StringUtil.cs
- PerfProviderCollection.cs
- DataGridView.cs
- RegisteredDisposeScript.cs
- WebException.cs
- WindowsSysHeader.cs
- MediaContext.cs
- EditorZoneBase.cs
- DataTableCollection.cs
- Image.cs
- BinaryReader.cs
- EntityDataSourceStatementEditor.cs
- AsymmetricAlgorithm.cs
- Assembly.cs
- MissingMethodException.cs
- DataGridViewRowCollection.cs
- TraceContextEventArgs.cs
- X509Certificate2.cs
- EUCJPEncoding.cs
- QilBinary.cs
- CompareValidator.cs
- ExceptionValidationRule.cs
- ListItemParagraph.cs
- TableLayoutSettings.cs
- TriggerActionCollection.cs
- RSAOAEPKeyExchangeFormatter.cs
- XmlMemberMapping.cs
- DesignerRegion.cs
- TextInfo.cs
- IdentitySection.cs
- TypeUtil.cs
- TextEffectCollection.cs
- CounterCreationDataCollection.cs
- FtpCachePolicyElement.cs
- XpsStructure.cs
- WriteTimeStream.cs
- TextRange.cs
- RoleBoolean.cs
- DesignSurface.cs
- DesignerView.xaml.cs
- MimeMultiPart.cs
- Empty.cs
- FieldBuilder.cs
- HttpRuntimeSection.cs
- BitmapEffectrendercontext.cs
- Win32SafeHandles.cs
- MessagePartDescription.cs
- WindowsStartMenu.cs
- AsyncOperation.cs
- FileStream.cs
- WebPartEditVerb.cs
- QuadraticBezierSegment.cs
- DataSourceCacheDurationConverter.cs
- DataGridViewCellStyle.cs
- DbException.cs
- LoginUtil.cs
- _SSPIWrapper.cs
- HttpResponse.cs
- ConcurrencyBehavior.cs
- WS2007FederationHttpBinding.cs
- RoutedEventArgs.cs
- SoapObjectReader.cs
- BaseValidatorDesigner.cs
- NameSpaceExtractor.cs
- PieceDirectory.cs
- XmlNamedNodeMap.cs
- HelpKeywordAttribute.cs
- ExpressionList.cs
- XsdDuration.cs
- ControlType.cs
- ByeOperationCD1AsyncResult.cs
- PerspectiveCamera.cs