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
- initElementDictionary.cs
- IteratorFilter.cs
- MailDefinitionBodyFileNameEditor.cs
- ReadingWritingEntityEventArgs.cs
- UserNameSecurityTokenProvider.cs
- DataGridViewAdvancedBorderStyle.cs
- NullableDoubleMinMaxAggregationOperator.cs
- BindingBase.cs
- PageThemeCodeDomTreeGenerator.cs
- MaskedTextBoxTextEditorDropDown.cs
- SaveFileDialog.cs
- Perspective.cs
- VariableBinder.cs
- ToolStripPanelRenderEventArgs.cs
- ThreadSafeList.cs
- OledbConnectionStringbuilder.cs
- EditingCommands.cs
- SolidBrush.cs
- DelegateSerializationHolder.cs
- AlphabetConverter.cs
- Normalizer.cs
- PropertyMapper.cs
- Stream.cs
- CodeDOMUtility.cs
- HtmlContainerControl.cs
- ConditionBrowserDialog.cs
- Expression.DebuggerProxy.cs
- EntityClientCacheEntry.cs
- SingleTagSectionHandler.cs
- MobileUserControlDesigner.cs
- ThreadAbortException.cs
- RemoteWebConfigurationHost.cs
- OperatorExpressions.cs
- PropertyDescriptorComparer.cs
- CultureInfoConverter.cs
- Compiler.cs
- ImpersonationContext.cs
- Keyboard.cs
- NetCodeGroup.cs
- ExtensionWindowHeader.cs
- BinaryFormatter.cs
- ProtocolsSection.cs
- HtmlHistory.cs
- NamedPipeActivation.cs
- ColorKeyFrameCollection.cs
- ProviderIncompatibleException.cs
- WSFederationHttpBindingCollectionElement.cs
- UpDownBase.cs
- WebConfigurationHostFileChange.cs
- TableLayoutRowStyleCollection.cs
- Expression.cs
- XamlBrushSerializer.cs
- TypedTableBase.cs
- BaseServiceProvider.cs
- DefaultValueTypeConverter.cs
- ChangeBlockUndoRecord.cs
- WindowsFormsLinkLabel.cs
- SqlFacetAttribute.cs
- PersistNameAttribute.cs
- ExpressionPrefixAttribute.cs
- PageWrapper.cs
- Win32SafeHandles.cs
- SafeCryptoHandles.cs
- Interlocked.cs
- FaultContractInfo.cs
- ButtonFieldBase.cs
- IndexedEnumerable.cs
- PageThemeParser.cs
- SchemaEntity.cs
- DisableDpiAwarenessAttribute.cs
- COM2ExtendedBrowsingHandler.cs
- WebResourceUtil.cs
- X509IssuerSerialKeyIdentifierClause.cs
- CachedCompositeFamily.cs
- UpWmlPageAdapter.cs
- Stacktrace.cs
- sqlser.cs
- TableLayoutPanelCellPosition.cs
- DrawingServices.cs
- OciHandle.cs
- Delay.cs
- ResourceAssociationTypeEnd.cs
- DataGridCell.cs
- RadioButton.cs
- SystemColorTracker.cs
- ColorAnimationUsingKeyFrames.cs
- Preprocessor.cs
- Graph.cs
- WpfPayload.cs
- DateTimeConverter.cs
- SequentialWorkflowHeaderFooter.cs
- AccessDataSourceWizardForm.cs
- ChannelSinkStacks.cs
- DbMetaDataFactory.cs
- CrossContextChannel.cs
- PinProtectionHelper.cs
- EntityFrameworkVersions.cs
- CommandEventArgs.cs
- LogLogRecord.cs
- EncoderReplacementFallback.cs