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
- RepeatBehaviorConverter.cs
- VectorCollectionConverter.cs
- PagePropertiesChangingEventArgs.cs
- TransactionTraceIdentifier.cs
- _SslSessionsCache.cs
- ClientCultureInfo.cs
- DiscardableAttribute.cs
- SystemFonts.cs
- COM2TypeInfoProcessor.cs
- OptionalMessageQuery.cs
- ExecutionScope.cs
- OpCopier.cs
- TextServicesHost.cs
- InputLanguage.cs
- AmbientLight.cs
- DataGridColumnDropSeparator.cs
- DefaultValueAttribute.cs
- ModelItemCollection.cs
- CodeMethodInvokeExpression.cs
- WebPartConnectionsEventArgs.cs
- ArrayWithOffset.cs
- PrtCap_Public.cs
- ServiceManager.cs
- AnnotationMap.cs
- HtmlImage.cs
- DrawingContextDrawingContextWalker.cs
- TrackingStringDictionary.cs
- BackgroundWorker.cs
- ViewStateException.cs
- SchemaTableColumn.cs
- RIPEMD160Managed.cs
- ErrorTableItemStyle.cs
- CompositeControl.cs
- PageMediaType.cs
- DecimalFormatter.cs
- EmbossBitmapEffect.cs
- FontNameEditor.cs
- Typeface.cs
- DesignerSerializationManager.cs
- LinqDataSourceHelper.cs
- TimerEventSubscriptionCollection.cs
- SchemaDeclBase.cs
- DataBoundControlAdapter.cs
- DelegatingConfigHost.cs
- ExpressionHelper.cs
- Attributes.cs
- WCFModelStrings.Designer.cs
- SafeThemeHandle.cs
- Repeater.cs
- ToolStripSeparatorRenderEventArgs.cs
- ContractReference.cs
- RoleManagerModule.cs
- SQLChars.cs
- EmbeddedMailObjectsCollection.cs
- ImmutableObjectAttribute.cs
- WinFormsSecurity.cs
- WebPartConnection.cs
- CodeDomDesignerLoader.cs
- TextParaLineResult.cs
- Visual3D.cs
- PartialArray.cs
- RegexCode.cs
- Mapping.cs
- MsmqInputChannelListenerBase.cs
- WebServiceTypeData.cs
- InstanceData.cs
- SecurityElement.cs
- ModelVisual3D.cs
- IpcManager.cs
- PreviewPageInfo.cs
- DbConnectionPoolGroupProviderInfo.cs
- SqlBulkCopyColumnMappingCollection.cs
- TableStyle.cs
- DateTimeFormatInfo.cs
- WmlObjectListAdapter.cs
- StateItem.cs
- QueryCacheEntry.cs
- BehaviorEditorPart.cs
- TypeHelper.cs
- COM2EnumConverter.cs
- OracleDataReader.cs
- DataBindingHandlerAttribute.cs
- DBParameter.cs
- WsdlInspector.cs
- ColorAnimationUsingKeyFrames.cs
- TreeNodeCollectionEditor.cs
- TypeElement.cs
- KnownTypesHelper.cs
- ContentDisposition.cs
- DynamicMethod.cs
- DebugTraceHelper.cs
- RecordConverter.cs
- TextModifierScope.cs
- CompositeActivityTypeDescriptor.cs
- DetailsView.cs
- PropertyInformation.cs
- SapiRecoContext.cs
- XmlTextReaderImpl.cs
- Nullable.cs
- EventMap.cs