Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PeerContact.cs
- DecoderReplacementFallback.cs
- DbCommandTree.cs
- StylusPointCollection.cs
- InstanceStore.cs
- ItemsControl.cs
- OleDbError.cs
- sqlcontext.cs
- Form.cs
- XmlCustomFormatter.cs
- CalendarAutoFormat.cs
- ListViewInsertedEventArgs.cs
- DeclarationUpdate.cs
- BamlBinaryReader.cs
- StringSource.cs
- SkewTransform.cs
- JsonQNameDataContract.cs
- BaseHashHelper.cs
- MetadataException.cs
- CancelRequestedRecord.cs
- ZipArchive.cs
- MessageSmuggler.cs
- ClientProxyGenerator.cs
- SqlNode.cs
- SystemIPInterfaceStatistics.cs
- MimeMultiPart.cs
- CodeParameterDeclarationExpressionCollection.cs
- EventBookmark.cs
- ObjectListItemCollection.cs
- CommandDesigner.cs
- DetailsViewRowCollection.cs
- DuplicateWaitObjectException.cs
- ReferentialConstraint.cs
- filewebrequest.cs
- Int32AnimationUsingKeyFrames.cs
- TextProviderWrapper.cs
- RelativeSource.cs
- InstanceCreationEditor.cs
- StrongTypingException.cs
- DataGridItemEventArgs.cs
- DynamicActionMessageFilter.cs
- Label.cs
- KerberosSecurityTokenProvider.cs
- TypefaceMetricsCache.cs
- WebZone.cs
- SqlTriggerContext.cs
- BitmapData.cs
- PropertiesTab.cs
- IImplicitResourceProvider.cs
- SynchronizationLockException.cs
- XmlCharCheckingWriter.cs
- TextDecorationCollection.cs
- objectresult_tresulttype.cs
- ComboBox.cs
- FormView.cs
- MarkedHighlightComponent.cs
- Variant.cs
- ProfileGroupSettings.cs
- HtmlTernaryTree.cs
- TypeUtil.cs
- ObjectAnimationBase.cs
- Html32TextWriter.cs
- LoginDesignerUtil.cs
- PropertyGridCommands.cs
- DefaultHttpHandler.cs
- BevelBitmapEffect.cs
- TaskExceptionHolder.cs
- TextDecorationCollection.cs
- Byte.cs
- DateTimeParse.cs
- Literal.cs
- WebPartEditorApplyVerb.cs
- CultureData.cs
- FontCollection.cs
- WebPartRestoreVerb.cs
- ToolStripArrowRenderEventArgs.cs
- LineServicesCallbacks.cs
- FormViewDeletedEventArgs.cs
- PartitionerQueryOperator.cs
- Nodes.cs
- OperationFormatStyle.cs
- ChangePassword.cs
- CustomCredentialPolicy.cs
- BindingMemberInfo.cs
- CannotUnloadAppDomainException.cs
- IgnorePropertiesAttribute.cs
- FormattedText.cs
- Rotation3DAnimationBase.cs
- DataTable.cs
- ColorKeyFrameCollection.cs
- TypeBrowser.xaml.cs
- DaylightTime.cs
- Module.cs
- XmlNotation.cs
- UriExt.cs
- ToolStripLabel.cs
- DataRecordInfo.cs
- Compiler.cs
- ChangePassword.cs
- EventLogPermissionEntry.cs