Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / PeerTransportListenAddressConverter.cs / 1 / PeerTransportListenAddressConverter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Globalization; using System.Net; using System.ServiceModel; using System.ServiceModel.Diagnostics; class PeerTransportListenAddressConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (typeof(string) == sourceType) { return true; } return base.CanConvertFrom(context, sourceType); } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (typeof(IPAddress) == destinationType) { return true; } return base.CanConvertTo(context, destinationType); } public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value is string) { return IPAddress.Parse(value as string); } return base.ConvertFrom(context, culture, value); } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (typeof(string) == destinationType && value is IPAddress) { return ((IPAddress)value).ToString(); } return base.ConvertTo(context, culture, value, destinationType); } } } // 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
- TransactionScope.cs
- FontCacheUtil.cs
- WizardForm.cs
- MessageSmuggler.cs
- PackageRelationshipSelector.cs
- HijriCalendar.cs
- GeometryDrawing.cs
- GridItemPattern.cs
- PkcsUtils.cs
- SAPIEngineTypes.cs
- LinqDataSourceContextEventArgs.cs
- Triangle.cs
- ClientTargetCollection.cs
- UTF8Encoding.cs
- PnrpPermission.cs
- ClientTarget.cs
- XsdDataContractExporter.cs
- DragDrop.cs
- MetadataItem.cs
- ArgumentsParser.cs
- ImageFormatConverter.cs
- Symbol.cs
- UnsafeNativeMethods.cs
- DeclaredTypeValidator.cs
- DataGridViewCellStyleConverter.cs
- RecognizerStateChangedEventArgs.cs
- DayRenderEvent.cs
- InvalidTimeZoneException.cs
- TransactionFlowOption.cs
- Substitution.cs
- FileDialogCustomPlacesCollection.cs
- Profiler.cs
- SQLBoolean.cs
- PointAnimationUsingKeyFrames.cs
- SendingRequestEventArgs.cs
- _SingleItemRequestCache.cs
- TreeNodeStyle.cs
- AliasedSlot.cs
- OpenTypeMethods.cs
- DATA_BLOB.cs
- cookieexception.cs
- ElapsedEventArgs.cs
- NamespaceEmitter.cs
- InvokePattern.cs
- RectangleHotSpot.cs
- FixedSOMPage.cs
- ExternalCalls.cs
- XXXOnTypeBuilderInstantiation.cs
- FederatedMessageSecurityOverHttpElement.cs
- EntryWrittenEventArgs.cs
- BuildManager.cs
- XmlSchemaInclude.cs
- EpmSyndicationContentDeSerializer.cs
- FeatureAttribute.cs
- DrawingGroup.cs
- LookupBindingPropertiesAttribute.cs
- ConfigurationLocation.cs
- EnumMember.cs
- EventProperty.cs
- UnmanagedBitmapWrapper.cs
- ECDiffieHellmanPublicKey.cs
- XmlSchemaSimpleContentRestriction.cs
- HwndStylusInputProvider.cs
- TransformedBitmap.cs
- DynamicValidatorEventArgs.cs
- TableParaClient.cs
- TreeNode.cs
- DataTableNewRowEvent.cs
- EventSetter.cs
- StagingAreaInputItem.cs
- WorkflowItemsPresenter.cs
- ContainerAction.cs
- COM2ExtendedTypeConverter.cs
- messageonlyhwndwrapper.cs
- ChangesetResponse.cs
- ConfigurationManagerHelperFactory.cs
- ImageFormatConverter.cs
- HMAC.cs
- ParallelTimeline.cs
- Accessible.cs
- ServerValidateEventArgs.cs
- ZoneIdentityPermission.cs
- DuplicateDetector.cs
- CacheOutputQuery.cs
- DodSequenceMerge.cs
- MimeTypeMapper.cs
- ReferentialConstraint.cs
- GlobalizationAssembly.cs
- SafeArrayTypeMismatchException.cs
- PinnedBufferMemoryStream.cs
- TreeIterator.cs
- HostExecutionContextManager.cs
- InternalDuplexBindingElement.cs
- XmlChoiceIdentifierAttribute.cs
- JobStaple.cs
- TextAction.cs
- PointConverter.cs
- ArgumentDesigner.xaml.cs
- OpCellTreeNode.cs
- Dynamic.cs