Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Base / System / Windows / ExpressionConverter.cs / 1 / 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
- CompiledQueryCacheKey.cs
- Delegate.cs
- PeerNameRegistration.cs
- ItemChangedEventArgs.cs
- ForeignConstraint.cs
- SignalGate.cs
- XmlSchemaChoice.cs
- XmlReaderSettings.cs
- ActivitySurrogate.cs
- CapabilitiesPattern.cs
- PointLight.cs
- ServicePoint.cs
- GifBitmapDecoder.cs
- SamlAuthorizationDecisionStatement.cs
- FrameworkTemplate.cs
- TypeDescriptor.cs
- datacache.cs
- XmlIlGenerator.cs
- ChameleonKey.cs
- coordinatorscratchpad.cs
- MergeLocalizationDirectives.cs
- CFGGrammar.cs
- InternalDispatchObject.cs
- Brushes.cs
- ListDictionaryInternal.cs
- SqlRemoveConstantOrderBy.cs
- ColorKeyFrameCollection.cs
- DoubleAnimationUsingPath.cs
- ExtensibleClassFactory.cs
- WindowsMenu.cs
- X509CertificateTokenFactoryCredential.cs
- CalendarDay.cs
- __Filters.cs
- ButtonAutomationPeer.cs
- Transform.cs
- ReachPrintTicketSerializer.cs
- LineBreakRecord.cs
- SingleStorage.cs
- WebServiceTypeData.cs
- ClientBuildManagerCallback.cs
- WindowsSlider.cs
- ZipIOCentralDirectoryBlock.cs
- SafeEventLogWriteHandle.cs
- FontNamesConverter.cs
- CollectionViewGroupRoot.cs
- HostProtectionException.cs
- SrgsToken.cs
- FileLevelControlBuilderAttribute.cs
- TextElementCollection.cs
- DataColumn.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- ControlPaint.cs
- PolicyAssertionCollection.cs
- FontFaceLayoutInfo.cs
- RoleManagerEventArgs.cs
- FunctionMappingTranslator.cs
- StrongNameKeyPair.cs
- XmlElement.cs
- TextElementEditingBehaviorAttribute.cs
- ContainerFilterService.cs
- AccessDataSourceView.cs
- PropertyInfoSet.cs
- Queue.cs
- UniformGrid.cs
- KeyMatchBuilder.cs
- SqlCachedBuffer.cs
- IPAddress.cs
- WebBrowserEvent.cs
- WindowsGraphicsWrapper.cs
- CaseStatementSlot.cs
- XmlQueryOutput.cs
- ZoneButton.cs
- ServiceNameCollection.cs
- Attributes.cs
- InternalTransaction.cs
- ButtonBase.cs
- Win32SafeHandles.cs
- FixedSOMContainer.cs
- AppPool.cs
- RC2.cs
- DatatypeImplementation.cs
- UseManagedPresentationElement.cs
- SettingsBase.cs
- ToolStripGripRenderEventArgs.cs
- FormViewInsertEventArgs.cs
- SeverityFilter.cs
- DataFormats.cs
- GridViewUpdatedEventArgs.cs
- AttachedPropertyInfo.cs
- ControlParameter.cs
- XhtmlBasicCalendarAdapter.cs
- AsymmetricKeyExchangeDeformatter.cs
- ListenerConfig.cs
- MenuBase.cs
- LayoutTableCell.cs
- MachinePropertyVariants.cs
- SemanticAnalyzer.cs
- ContentElement.cs
- PeerNameResolver.cs
- RepeaterItemCollection.cs