Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / Converters / Generated / SizeValueSerializer.cs / 1 / SizeValueSerializer.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // This file was generated, please do not edit it directly. // // Please see [....]/default.aspx/Microsoft.Projects.Avalon/MilCodeGen.html for more information. // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.WindowsBase; using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.ComponentModel.Design.Serialization; using System.Windows.Markup; using System.Windows.Converters; using System.Windows; #pragma warning disable 1634, 1691 // suppressing PreSharp warnings namespace System.Windows.Converters { ////// SizeValueSerializer - ValueSerializer class for converting instances of strings to and from Size instances /// This is used by the MarkupWriter class. /// public class SizeValueSerializer : ValueSerializer { ////// Returns true. /// public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } ////// Returns true if the given value can be converted into a string /// public override bool CanConvertToString(object value, IValueSerializerContext context) { // Validate the input type if (!(value is Size)) { throw new ArgumentException(SR.Get(SRID.General_Expected_Type, "Size"), "value"); } return true; } ////// Converts a string into a Size. /// public override object ConvertFromString(string value, IValueSerializerContext context) { if (value != null) { return Size.Parse(value ); } else { return base.ConvertFromString( value, context ); } } ////// Converts the value into a string. /// public override string ConvertToString(object value, IValueSerializerContext context) { if (value is Size) { Size instance = (Size) value; #pragma warning suppress 6506 // instance is obviously not null return instance.ConvertToString(null, CultureInfo.GetCultureInfo("en-us") ); } 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
- Columns.cs
- RewritingProcessor.cs
- MimeFormatter.cs
- EntityDataSourceSelectedEventArgs.cs
- WindowsSpinner.cs
- CqlLexerHelpers.cs
- ArglessEventHandlerProxy.cs
- TableCellAutomationPeer.cs
- StorageFunctionMapping.cs
- OraclePermission.cs
- CustomValidator.cs
- DesignTimeXamlWriter.cs
- ValueUtilsSmi.cs
- PointAnimationUsingPath.cs
- AtomEntry.cs
- xamlnodes.cs
- BitmapEffectGroup.cs
- DoubleStorage.cs
- ParameterBuilder.cs
- Single.cs
- TextInfo.cs
- CacheVirtualItemsEvent.cs
- ExpressionBindingCollection.cs
- GlyphInfoList.cs
- documentsequencetextview.cs
- SQLBinaryStorage.cs
- RadioButton.cs
- DataMisalignedException.cs
- ExecutedRoutedEventArgs.cs
- PageAsyncTaskManager.cs
- FormattedText.cs
- SrgsNameValueTag.cs
- BehaviorEditorPart.cs
- DataObject.cs
- COM2ICategorizePropertiesHandler.cs
- PathNode.cs
- PasswordRecoveryAutoFormat.cs
- MainMenu.cs
- DataListItemCollection.cs
- DeferredElementTreeState.cs
- DateTimeEditor.cs
- Vector.cs
- EventsTab.cs
- HtmlProps.cs
- FilePrompt.cs
- ToolStripItemBehavior.cs
- ListView.cs
- InputLangChangeEvent.cs
- MetadataItemSerializer.cs
- EntityClientCacheEntry.cs
- CroppedBitmap.cs
- FileIOPermission.cs
- OdbcDataAdapter.cs
- DomainConstraint.cs
- ConfigUtil.cs
- UnsafeNativeMethodsCLR.cs
- IdentityManager.cs
- InstancePersistenceException.cs
- RegexMatch.cs
- RootBuilder.cs
- Transactions.cs
- SevenBitStream.cs
- AdapterUtil.cs
- PublisherMembershipCondition.cs
- TransformCollection.cs
- FixedSOMElement.cs
- EllipticalNodeOperations.cs
- StreamBodyWriter.cs
- DataColumnSelectionConverter.cs
- GridEntryCollection.cs
- AsyncStreamReader.cs
- Funcletizer.cs
- XmlNullResolver.cs
- EventPropertyMap.cs
- FigureHelper.cs
- ExpressionTable.cs
- TextEditor.cs
- AdornedElementPlaceholder.cs
- StringBuilder.cs
- XmlSchemaAppInfo.cs
- ModelTreeManager.cs
- precedingsibling.cs
- DataTableTypeConverter.cs
- RouteData.cs
- LineBreak.cs
- FlowLayoutPanelDesigner.cs
- TextViewBase.cs
- BinaryUtilClasses.cs
- RelatedView.cs
- WebControl.cs
- MsmqIntegrationOutputChannel.cs
- SafeHandle.cs
- DataStorage.cs
- DocumentPageTextView.cs
- Part.cs
- RepeatButton.cs
- NullableIntMinMaxAggregationOperator.cs
- ViewManager.cs
- Base64Stream.cs
- TableLayoutSettingsTypeConverter.cs