Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / WhiteSpaceTrimStringConverter.cs / 1305376 / WhiteSpaceTrimStringConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Collections.Specialized; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { public sealed class WhiteSpaceTrimStringConverter : ConfigurationConverterBase { public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) { ValidateType(value, typeof(string)); if (value == null) { return String.Empty; } return ((string)value).Trim(); } public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) { Debug.Assert(data is string, "data is string"); return ((string)data).Trim(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Collections.Specialized; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { public sealed class WhiteSpaceTrimStringConverter : ConfigurationConverterBase { public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) { ValidateType(value, typeof(string)); if (value == null) { return String.Empty; } return ((string)value).Trim(); } public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) { Debug.Assert(data is string, "data is string"); return ((string)data).Trim(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Model3D.cs
- Unit.cs
- AnchoredBlock.cs
- HyperLinkStyle.cs
- EntityException.cs
- NameNode.cs
- TreeViewCancelEvent.cs
- ReachSerializationCacheItems.cs
- FormCollection.cs
- WebSysDefaultValueAttribute.cs
- LinkLabelLinkClickedEvent.cs
- MappingMetadataHelper.cs
- safemediahandle.cs
- ToolStripSeparatorRenderEventArgs.cs
- ValueType.cs
- SafeFileMapViewHandle.cs
- FlowDocumentPageViewerAutomationPeer.cs
- objectquery_tresulttype.cs
- PropertySourceInfo.cs
- TableLayoutStyle.cs
- EmptyStringExpandableObjectConverter.cs
- CopyNodeSetAction.cs
- TypefaceMetricsCache.cs
- Win32MouseDevice.cs
- DeobfuscatingStream.cs
- WebProxyScriptElement.cs
- ListViewSelectEventArgs.cs
- HierarchicalDataBoundControl.cs
- ServiceAuthorizationManager.cs
- SubstitutionList.cs
- ProfileGroupSettings.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- Vector3DCollection.cs
- PostBackOptions.cs
- EventMappingSettings.cs
- MailHeaderInfo.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SponsorHelper.cs
- PixelShader.cs
- ParallelEnumerableWrapper.cs
- DispatcherObject.cs
- SetStoryboardSpeedRatio.cs
- CancellationHandlerDesigner.cs
- MetabaseSettings.cs
- WebPartAuthorizationEventArgs.cs
- ImageClickEventArgs.cs
- Transactions.cs
- DropShadowEffect.cs
- WebExceptionStatus.cs
- PageThemeCodeDomTreeGenerator.cs
- DatagridviewDisplayedBandsData.cs
- DataGridViewSortCompareEventArgs.cs
- DataTable.cs
- ComplexType.cs
- ToolStripPanel.cs
- HostingPreferredMapPath.cs
- FunctionQuery.cs
- TextServicesCompartment.cs
- ErrorsHelper.cs
- BaseParagraph.cs
- PropertyGeneratedEventArgs.cs
- ChildrenQuery.cs
- DurationConverter.cs
- OracleInfoMessageEventArgs.cs
- AdornedElementPlaceholder.cs
- SimpleTextLine.cs
- WindowsSspiNegotiation.cs
- TraceData.cs
- DoubleStorage.cs
- QilIterator.cs
- MediaElement.cs
- LineProperties.cs
- SimplePropertyEntry.cs
- WebSysDefaultValueAttribute.cs
- DirectionalLight.cs
- RequestSecurityTokenForGetBrowserToken.cs
- SlotInfo.cs
- EntityDataSourceView.cs
- ValidatingReaderNodeData.cs
- AssociationTypeEmitter.cs
- DetailsViewPageEventArgs.cs
- _OSSOCK.cs
- CodeTypeConstructor.cs
- EDesignUtil.cs
- InputChannelAcceptor.cs
- SoapTypeAttribute.cs
- WebPartDescription.cs
- ResourceDescriptionAttribute.cs
- BufferModeSettings.cs
- BackgroundWorker.cs
- PriorityChain.cs
- Misc.cs
- StateDesigner.LayoutSelectionGlyph.cs
- OutOfProcStateClientManager.cs
- XamlStyleSerializer.cs
- MessageOperationFormatter.cs
- TextCharacters.cs
- ContractMapping.cs
- CatalogPartCollection.cs
- FragmentQuery.cs