Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / TemplateKeyConverter.cs / 1305600 / 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
- UniqueConstraint.cs
- EntityDescriptor.cs
- StreamInfo.cs
- GridSplitterAutomationPeer.cs
- WebConfigurationHost.cs
- InstanceData.cs
- CompilerInfo.cs
- WindowsEditBoxRange.cs
- LineServicesCallbacks.cs
- TransformerConfigurationWizardBase.cs
- HttpHeaderCollection.cs
- DbConnectionStringBuilder.cs
- DiagnosticSection.cs
- HttpBufferlessInputStream.cs
- Rect3D.cs
- WindowsListBox.cs
- DataListCommandEventArgs.cs
- CatalogPartCollection.cs
- ToolStripSystemRenderer.cs
- ListViewTableRow.cs
- Oci.cs
- ActivityContext.cs
- IISMapPath.cs
- HorizontalAlignConverter.cs
- SegmentInfo.cs
- PauseStoryboard.cs
- SqlDuplicator.cs
- RuntimeEnvironment.cs
- DoubleLink.cs
- ProcessInfo.cs
- Visual3DCollection.cs
- SmiEventSink.cs
- ScriptComponentDescriptor.cs
- Sql8ExpressionRewriter.cs
- EndOfStreamException.cs
- ResourceReferenceExpression.cs
- PolicyLevel.cs
- ChooseAction.cs
- ListQueryResults.cs
- WebException.cs
- TextElementAutomationPeer.cs
- HostedTcpTransportManager.cs
- COM2PropertyDescriptor.cs
- InstanceKeyCompleteException.cs
- NativeMethods.cs
- webbrowsersite.cs
- _AutoWebProxyScriptEngine.cs
- EventLogPermissionEntryCollection.cs
- DataRowComparer.cs
- PolicyException.cs
- ScrollPattern.cs
- InheritablePropertyChangeInfo.cs
- GridViewRowCollection.cs
- ErrorHandler.cs
- FreezableCollection.cs
- SymbolPair.cs
- SmiRecordBuffer.cs
- SqlCommandBuilder.cs
- Menu.cs
- SeverityFilter.cs
- ProcessHost.cs
- BoolLiteral.cs
- Helper.cs
- RoutedEventConverter.cs
- CultureSpecificCharacterBufferRange.cs
- IntegerFacetDescriptionElement.cs
- Symbol.cs
- ConfigUtil.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- X509Certificate2Collection.cs
- ComPlusSynchronizationContext.cs
- ListItemCollection.cs
- NotImplementedException.cs
- XsltFunctions.cs
- BamlResourceContent.cs
- ContainerParaClient.cs
- PropertyOverridesTypeEditor.cs
- ApplicationDirectoryMembershipCondition.cs
- NativeMethods.cs
- KnownTypeHelper.cs
- DataPagerFieldCommandEventArgs.cs
- ActivationArguments.cs
- ToolBarButton.cs
- BufferedOutputStream.cs
- QueryContinueDragEvent.cs
- TdsParameterSetter.cs
- PseudoWebRequest.cs
- Sql8ConformanceChecker.cs
- RewritingSimplifier.cs
- StickyNoteAnnotations.cs
- Tracking.cs
- TimeSpanConverter.cs
- ManagementEventWatcher.cs
- XmlCharCheckingReader.cs
- TriggerAction.cs
- SQLResource.cs
- ZipPackage.cs
- StyleBamlTreeBuilder.cs
- CultureData.cs