Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Markup / TemplateKeyConverter.cs / 1 / TemplateKeyConverter.cs
/****************************************************************************\
*
* File: TemplateKeyConverter.cs
*
* Class for converting a given TemplateKey to a string
*
* Copyright (C) 2005 by Microsoft Corporation. All rights reserved.
*
\***************************************************************************/
using System;
using System.ComponentModel; // for TypeConverter
using System.Globalization; // for CultureInfo
using System.Reflection;
using MS.Utility;
using MS.Internal;
using System.Windows;
using System.ComponentModel.Design.Serialization;
using System.Windows.Documents;
#pragma warning disable 1634, 1691 // suppressing PreSharp warnings
namespace System.Windows.Markup
{
///
/// Class for converting a given TemplateKey to a string
///
public sealed class TemplateKeyConverter : TypeConverter
{
#region Public Methods
///
/// CanConvertFrom()
///
/// ITypeDescriptorContext
/// type to convert from
/// true if the given type can be converted, flase otherwise
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;
}
///
/// ConvertFrom() -TypeConverter method override. using the givein name to return DependencyProperty
///
/// ITypeDescriptorContext
/// CultureInfo
/// Object to convert from
/// instance of Command
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object source)
{
throw GetConvertFromException(source);
}
///
/// ConvertTo() - Serialization purposes, returns the string from Command.Name by adding ownerType.FullName
///
/// ITypeDescriptorContext
/// CultureInfo
/// the object to convert from
/// the type to convert to
/// string object, if the destination type is string
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
throw GetConvertToException(value, destinationType);
}
#endregion Public Methods
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
/****************************************************************************\
*
* File: TemplateKeyConverter.cs
*
* Class for converting a given TemplateKey to a string
*
* Copyright (C) 2005 by Microsoft Corporation. All rights reserved.
*
\***************************************************************************/
using System;
using System.ComponentModel; // for TypeConverter
using System.Globalization; // for CultureInfo
using System.Reflection;
using MS.Utility;
using MS.Internal;
using System.Windows;
using System.ComponentModel.Design.Serialization;
using System.Windows.Documents;
#pragma warning disable 1634, 1691 // suppressing PreSharp warnings
namespace System.Windows.Markup
{
///
/// Class for converting a given TemplateKey to a string
///
public sealed class TemplateKeyConverter : TypeConverter
{
#region Public Methods
///
/// CanConvertFrom()
///
/// ITypeDescriptorContext
/// type to convert from
/// true if the given type can be converted, flase otherwise
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;
}
///
/// ConvertFrom() -TypeConverter method override. using the givein name to return DependencyProperty
///
/// ITypeDescriptorContext
/// CultureInfo
/// Object to convert from
/// instance of Command
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object source)
{
throw GetConvertFromException(source);
}
///
/// ConvertTo() - Serialization purposes, returns the string from Command.Name by adding ownerType.FullName
///
/// ITypeDescriptorContext
/// CultureInfo
/// the object to convert from
/// the type to convert to
/// string object, if the destination type is string
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
throw GetConvertToException(value, destinationType);
}
#endregion Public Methods
}
}
// 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
- ProfilePropertyNameValidator.cs
- XmlSchemaAnnotation.cs
- FileController.cs
- ComAdminInterfaces.cs
- TextView.cs
- XmlUrlResolver.cs
- StateMachine.cs
- DelegateSerializationHolder.cs
- ScalarType.cs
- WindowsFormsSynchronizationContext.cs
- HwndKeyboardInputProvider.cs
- EntityConnectionStringBuilder.cs
- SafeLocalMemHandle.cs
- ListBoxItemWrapperAutomationPeer.cs
- EntityClassGenerator.cs
- Function.cs
- ServerValidateEventArgs.cs
- WebServiceFault.cs
- ExtractorMetadata.cs
- RuntimeArgumentHandle.cs
- DeviceContexts.cs
- TreeNode.cs
- SchemaTableColumn.cs
- XomlDesignerLoader.cs
- DBBindings.cs
- GacUtil.cs
- ValueChangedEventManager.cs
- XmlSchemaParticle.cs
- EncoderNLS.cs
- DynamicActivity.cs
- XPathNavigatorReader.cs
- WebPartMinimizeVerb.cs
- URLIdentityPermission.cs
- PageTheme.cs
- Style.cs
- CanonicalFontFamilyReference.cs
- ClusterSafeNativeMethods.cs
- InlineObject.cs
- SelectionItemPatternIdentifiers.cs
- SectionUpdates.cs
- SizeF.cs
- RequestedSignatureDialog.cs
- ConvertersCollection.cs
- ExceptionRoutedEventArgs.cs
- Tuple.cs
- QueryContext.cs
- SafeCoTaskMem.cs
- OracleDataAdapter.cs
- CodeObjectCreateExpression.cs
- HttpProfileGroupBase.cs
- GridErrorDlg.cs
- NotifyIcon.cs
- DecimalStorage.cs
- XmlLanguage.cs
- UnSafeCharBuffer.cs
- Command.cs
- XmlSchemaSequence.cs
- ControlParameter.cs
- PageCatalogPart.cs
- PipelineComponent.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- EdmItemCollection.cs
- ValueTable.cs
- FrameworkElementAutomationPeer.cs
- EntityDataSourceDesignerHelper.cs
- Point3DIndependentAnimationStorage.cs
- HealthMonitoringSection.cs
- ArithmeticException.cs
- SpeakInfo.cs
- HierarchicalDataBoundControlAdapter.cs
- SiteMap.cs
- Parameter.cs
- SoapExtensionReflector.cs
- HMACSHA384.cs
- MethodToken.cs
- SafeHandles.cs
- TCPClient.cs
- SiteMapHierarchicalDataSourceView.cs
- Light.cs
- DataStorage.cs
- TextEndOfSegment.cs
- CodeGenerator.cs
- SessionStateUtil.cs
- LongValidatorAttribute.cs
- SingleConverter.cs
- RegexCapture.cs
- StyleCollectionEditor.cs
- CodeDomSerializer.cs
- TagElement.cs
- SiteMapSection.cs
- ItemsPanelTemplate.cs
- DataTableReaderListener.cs
- ProfileGroupSettingsCollection.cs
- ItemMap.cs
- DataRowCollection.cs
- DataGridComboBoxColumn.cs
- ReaderOutput.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- DataExpression.cs
- DocumentGridPage.cs