Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / DialogResultConverter.cs / 1 / DialogResultConverter.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: DialogResultConverter.cs
//
// Description: Contains the DialogResultConverter: TypeConverter for the DialogResult class.
//
// History:
// 10/31/2003 : HuWang - Created
//
//---------------------------------------------------------------------------
using System;
using System.ComponentModel;
using System.Globalization;
namespace System.Windows
{
///
/// DialogResultConverter - Converter class for converting instances of other types to and from DialogResult instances.
///
public class DialogResultConverter: TypeConverter
{
//-------------------------------------------------------------------
//
// Public Methods
//
//-------------------------------------------------------------------
#region Public Methods
///
/// CanConvertFrom - We don't support convert from other types to DialogResult
///
///
/// bool - Always return False
///
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
{
// We don't support ConvertFrom
return false;
}
///
/// CanConvertTo - Returns whether or not this class can convert to a given type.
///
///
/// bool - Always return False
///
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
{
// We don't support ConvertTo
return false;
}
///
/// ConvertFrom - Attempt to convert to a DialogResult from the given object.
/// Always throw InvalidOperation exception
///
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext,
CultureInfo cultureInfo,
object source)
{
throw new InvalidOperationException(SR.Get(SRID.CantSetInMarkup));
}
///
/// ConvertTo - Attempt to convert a DialogResult to the given type
/// Always throw InvalidOperation exception
///
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext,
CultureInfo cultureInfo,
object value,
Type destinationType)
{
throw new InvalidOperationException(SR.Get(SRID.CantSetInMarkup));
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: DialogResultConverter.cs
//
// Description: Contains the DialogResultConverter: TypeConverter for the DialogResult class.
//
// History:
// 10/31/2003 : HuWang - Created
//
//---------------------------------------------------------------------------
using System;
using System.ComponentModel;
using System.Globalization;
namespace System.Windows
{
///
/// DialogResultConverter - Converter class for converting instances of other types to and from DialogResult instances.
///
public class DialogResultConverter: TypeConverter
{
//-------------------------------------------------------------------
//
// Public Methods
//
//-------------------------------------------------------------------
#region Public Methods
///
/// CanConvertFrom - We don't support convert from other types to DialogResult
///
///
/// bool - Always return False
///
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
{
// We don't support ConvertFrom
return false;
}
///
/// CanConvertTo - Returns whether or not this class can convert to a given type.
///
///
/// bool - Always return False
///
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
{
// We don't support ConvertTo
return false;
}
///
/// ConvertFrom - Attempt to convert to a DialogResult from the given object.
/// Always throw InvalidOperation exception
///
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext,
CultureInfo cultureInfo,
object source)
{
throw new InvalidOperationException(SR.Get(SRID.CantSetInMarkup));
}
///
/// ConvertTo - Attempt to convert a DialogResult to the given type
/// Always throw InvalidOperation exception
///
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext,
CultureInfo cultureInfo,
object value,
Type destinationType)
{
throw new InvalidOperationException(SR.Get(SRID.CantSetInMarkup));
}
#endregion
}
}
// 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
- DataTableExtensions.cs
- FileDialog_Vista.cs
- CollectionViewSource.cs
- CheckoutException.cs
- SystemPens.cs
- ColumnClickEvent.cs
- GregorianCalendarHelper.cs
- Partitioner.cs
- EmptyQuery.cs
- ReadOnlyDictionary.cs
- WorkflowItemPresenter.cs
- MemoryPressure.cs
- NetTcpSectionData.cs
- XamlSerializerUtil.cs
- EUCJPEncoding.cs
- WebHttpDispatchOperationSelectorData.cs
- WindowsGraphics2.cs
- IntSecurity.cs
- AssemblyHelper.cs
- SqlDataSourceFilteringEventArgs.cs
- OracleDateTime.cs
- InvalidDocumentContentsException.cs
- AssociatedControlConverter.cs
- AnimatedTypeHelpers.cs
- SessionStateContainer.cs
- SortDescriptionCollection.cs
- AliasedExpr.cs
- _ShellExpression.cs
- ImageSource.cs
- ToolStripHighContrastRenderer.cs
- OutputCacheSettings.cs
- ArgumentException.cs
- TargetException.cs
- VoiceChangeEventArgs.cs
- ExpanderAutomationPeer.cs
- DelimitedListTraceListener.cs
- MeshGeometry3D.cs
- SoapMessage.cs
- ConversionContext.cs
- HandleRef.cs
- ObjectSecurity.cs
- BitStream.cs
- EntityChangedParams.cs
- MultiSelector.cs
- MD5HashHelper.cs
- ChangeProcessor.cs
- RuleEngine.cs
- MediaPlayerState.cs
- UpdateCompiler.cs
- BindingListCollectionView.cs
- PersonalizationProviderHelper.cs
- IRCollection.cs
- ValuePattern.cs
- PartialCachingControl.cs
- RenamedEventArgs.cs
- _LocalDataStoreMgr.cs
- ResetableIterator.cs
- TransformerInfo.cs
- SelectionService.cs
- UnsafePeerToPeerMethods.cs
- TransformerTypeCollection.cs
- DrawItemEvent.cs
- ScriptManager.cs
- DocumentViewerAutomationPeer.cs
- BufferedWebEventProvider.cs
- BevelBitmapEffect.cs
- UnsafeNativeMethodsPenimc.cs
- EdmSchemaError.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- RewritingValidator.cs
- Matrix3DStack.cs
- TokenizerHelper.cs
- XmlSiteMapProvider.cs
- NamespaceEmitter.cs
- DataGridColumnCollection.cs
- ProviderBase.cs
- ComPersistableTypeElement.cs
- MemoryMappedFileSecurity.cs
- CodeTypeDeclarationCollection.cs
- SkewTransform.cs
- BehaviorDragDropEventArgs.cs
- HealthMonitoringSection.cs
- SafeArrayRankMismatchException.cs
- CompilerHelpers.cs
- HtmlControl.cs
- VisualBrush.cs
- ComponentManagerBroker.cs
- SubstitutionList.cs
- ServiceOperation.cs
- UserControl.cs
- FileDialogCustomPlacesCollection.cs
- TextStore.cs
- DrawingAttributes.cs
- ClientRoleProvider.cs
- IgnoreSectionHandler.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ProfileGroupSettingsCollection.cs
- COM2Properties.cs
- StateWorkerRequest.cs
- CodeTypeParameter.cs