Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- MD5CryptoServiceProvider.cs
- LowerCaseStringConverter.cs
- CodeMemberField.cs
- EnumerableRowCollection.cs
- SerialStream.cs
- Window.cs
- DbBuffer.cs
- WebPartDeleteVerb.cs
- ChannelListenerBase.cs
- PointAnimation.cs
- X509Certificate.cs
- DSACryptoServiceProvider.cs
- DesignTimeXamlWriter.cs
- HeaderUtility.cs
- SimpleBitVector32.cs
- Int16AnimationBase.cs
- IntMinMaxAggregationOperator.cs
- storepermissionattribute.cs
- CalendarAutoFormat.cs
- XPathChildIterator.cs
- CommandHelpers.cs
- InputManager.cs
- ObjectSet.cs
- BindingObserver.cs
- Bits.cs
- ListMarkerSourceInfo.cs
- FilterException.cs
- SessionViewState.cs
- TreeViewEvent.cs
- ThreadWorkerController.cs
- PreservationFileWriter.cs
- DbProviderFactory.cs
- Separator.cs
- UnionCqlBlock.cs
- HtmlAnchor.cs
- FontNamesConverter.cs
- SqlPersonalizationProvider.cs
- regiisutil.cs
- TimeSpan.cs
- OpenTypeLayout.cs
- GenericRootAutomationPeer.cs
- UInt32.cs
- VersionValidator.cs
- SessionStateModule.cs
- HelpFileFileNameEditor.cs
- DeclarativeCatalogPart.cs
- Rotation3DAnimation.cs
- CultureSpecificCharacterBufferRange.cs
- ConnectionManager.cs
- ThrowHelper.cs
- ItemsChangedEventArgs.cs
- COAUTHIDENTITY.cs
- HttpRequestCacheValidator.cs
- SEHException.cs
- LogWriteRestartAreaState.cs
- DictionaryCustomTypeDescriptor.cs
- HtmlWindowCollection.cs
- IgnoreSectionHandler.cs
- FocusTracker.cs
- CodeSubDirectory.cs
- ITreeGenerator.cs
- SafeCancelMibChangeNotify.cs
- TrackingServices.cs
- DocumentXmlWriter.cs
- SecureConversationServiceCredential.cs
- _PooledStream.cs
- MetafileHeader.cs
- ColorTranslator.cs
- XamlFigureLengthSerializer.cs
- FontFamilyIdentifier.cs
- TreeNodeCollectionEditor.cs
- XmlDigitalSignatureProcessor.cs
- DispatcherObject.cs
- ProfilePropertyMetadata.cs
- FlowDocumentFormatter.cs
- RoutedUICommand.cs
- DataGridHeaderBorder.cs
- IApplicationTrustManager.cs
- BamlRecordReader.cs
- XmlSchemaSet.cs
- DBSqlParser.cs
- ResourcePermissionBaseEntry.cs
- EventProviderWriter.cs
- AnnotationResourceChangedEventArgs.cs
- SqlMethodCallConverter.cs
- WebPartDeleteVerb.cs
- RemotingSurrogateSelector.cs
- ProgressiveCrcCalculatingStream.cs
- ScheduleChanges.cs
- OrderByQueryOptionExpression.cs
- FlowThrottle.cs
- CompositeKey.cs
- BindingWorker.cs
- ConstraintCollection.cs
- ResXDataNode.cs
- BitmapEffectCollection.cs
- ComboBoxAutomationPeer.cs
- AvTraceFormat.cs
- NetworkAddressChange.cs
- DetailsViewPageEventArgs.cs