Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Input / Command / MouseActionValueSerializer.cs / 1 / MouseActionValueSerializer.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: MouseActionConverter - Serializes a MouseAction // // History: // 08/04/2005 : Chuck Jazdzewski - Created // //--------------------------------------------------------------------------- using System; using System.ComponentModel; // for TypeConverter using System.Globalization; // for CultureInfo using System.Reflection; using System.Windows; using System.Windows.Markup; using System.Windows.Input; namespace System.Windows.Input { ////// MouseActionValueSerializer - Serializes a MouseAction /// public class MouseActionValueSerializer : ValueSerializer { ////// CanConvertFromString() /// /// /// ////// public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } /// /// CanConvertToString() /// /// /// ////// public override bool CanConvertToString(object value, IValueSerializerContext context) { return value is MouseAction && MouseActionConverter.IsDefinedMouseAction((MouseAction)value); } /// /// ConvertFromString() /// /// /// ///public override object ConvertFromString(string value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertFromString(value); else return base.ConvertFromString(value, context); } /// /// ConvertToString() /// /// /// ///public override string ConvertToString(object value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertToInvariantString(value); else return base.ConvertToString(value, context); } } } // 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. // // // Description: MouseActionConverter - Serializes a MouseAction // // History: // 08/04/2005 : Chuck Jazdzewski - Created // //--------------------------------------------------------------------------- using System; using System.ComponentModel; // for TypeConverter using System.Globalization; // for CultureInfo using System.Reflection; using System.Windows; using System.Windows.Markup; using System.Windows.Input; namespace System.Windows.Input { ////// MouseActionValueSerializer - Serializes a MouseAction /// public class MouseActionValueSerializer : ValueSerializer { ////// CanConvertFromString() /// /// /// ////// public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } /// /// CanConvertToString() /// /// /// ////// public override bool CanConvertToString(object value, IValueSerializerContext context) { return value is MouseAction && MouseActionConverter.IsDefinedMouseAction((MouseAction)value); } /// /// ConvertFromString() /// /// /// ///public override object ConvertFromString(string value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertFromString(value); else return base.ConvertFromString(value, context); } /// /// ConvertToString() /// /// /// ///public override string ConvertToString(object value, IValueSerializerContext context) { TypeConverter converter = TypeDescriptor.GetConverter(typeof(MouseAction)); if (converter != null) return converter.ConvertToInvariantString(value); else return base.ConvertToString(value, context); } } } // 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
- DefaultTextStoreTextComposition.cs
- QueryAccessibilityHelpEvent.cs
- VerificationAttribute.cs
- XMLDiffLoader.cs
- DataGridDetailsPresenterAutomationPeer.cs
- HostVisual.cs
- ProxyAttribute.cs
- XsltException.cs
- AvTraceFormat.cs
- EntityDataSourceViewSchema.cs
- KeyboardNavigation.cs
- HttpResponseWrapper.cs
- HMAC.cs
- MenuItem.cs
- Inline.cs
- SubclassTypeValidatorAttribute.cs
- PathFigure.cs
- HttpClientCertificate.cs
- TemplateControlCodeDomTreeGenerator.cs
- CompilationSection.cs
- Certificate.cs
- InternalRelationshipCollection.cs
- Line.cs
- columnmapkeybuilder.cs
- RuleEngine.cs
- ColumnResizeUndoUnit.cs
- InputLanguageEventArgs.cs
- LocalizationComments.cs
- Byte.cs
- HttpModuleCollection.cs
- DrawTreeNodeEventArgs.cs
- DetailsViewUpdatedEventArgs.cs
- BaseDataListDesigner.cs
- DataServiceKeyAttribute.cs
- Registration.cs
- DataGridViewColumnCollectionDialog.cs
- FrameworkRichTextComposition.cs
- SamlSubject.cs
- SendingRequestEventArgs.cs
- DiscoveryServiceExtension.cs
- Attributes.cs
- Cursor.cs
- TreeNodeCollection.cs
- NameService.cs
- CodeTypeReference.cs
- activationcontext.cs
- ListItemCollection.cs
- SqlDataReaderSmi.cs
- CommandPlan.cs
- WinFormsSpinner.cs
- ToolStripLocationCancelEventArgs.cs
- Errors.cs
- _RegBlobWebProxyDataBuilder.cs
- EditBehavior.cs
- HttpRequestWrapper.cs
- DbProviderFactories.cs
- EntityContainer.cs
- x509store.cs
- XmlSchema.cs
- SmiTypedGetterSetter.cs
- SchemaNamespaceManager.cs
- ObjectConverter.cs
- FunctionMappingTranslator.cs
- ChainedAsyncResult.cs
- ColumnHeaderConverter.cs
- SessionStateContainer.cs
- DataGridViewColumnEventArgs.cs
- FtpCachePolicyElement.cs
- NameSpaceExtractor.cs
- ConfigurationCollectionAttribute.cs
- ProxyAttribute.cs
- XsdValidatingReader.cs
- IxmlLineInfo.cs
- ListBindingConverter.cs
- NavigationWindow.cs
- GenerateTemporaryTargetAssembly.cs
- MsmqIntegrationInputChannel.cs
- WebServiceEnumData.cs
- InputLanguageCollection.cs
- VectorCollection.cs
- NameValueFileSectionHandler.cs
- EmptyControlCollection.cs
- LowerCaseStringConverter.cs
- VectorAnimationBase.cs
- DrawingDrawingContext.cs
- WebPartMenuStyle.cs
- TableRowCollection.cs
- CfgArc.cs
- LinkedResourceCollection.cs
- IResourceProvider.cs
- Quaternion.cs
- CreateInstanceBinder.cs
- TableRowGroup.cs
- FontUnitConverter.cs
- LongSumAggregationOperator.cs
- CollectionViewGroupRoot.cs
- PathTooLongException.cs
- UnsafeNetInfoNativeMethods.cs
- RequestCacheManager.cs
- StdValidatorsAndConverters.cs