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
- TableLayoutPanelCellPosition.cs
- Ppl.cs
- SingleSelectRootGridEntry.cs
- CompoundFileReference.cs
- WebColorConverter.cs
- _AuthenticationState.cs
- SafeFileMappingHandle.cs
- OrderedHashRepartitionEnumerator.cs
- BamlLocalizationDictionary.cs
- ExtendedProperty.cs
- keycontainerpermission.cs
- TextComposition.cs
- ObjectDataSourceSelectingEventArgs.cs
- xml.cs
- controlskin.cs
- PackUriHelper.cs
- SessionStateContainer.cs
- EpmSourceTree.cs
- GetParentChain.cs
- VisualTreeHelper.cs
- SmiContext.cs
- DbProviderServices.cs
- DbgUtil.cs
- ChannelManagerBase.cs
- ModifyActivitiesPropertyDescriptor.cs
- SqlCachedBuffer.cs
- EdmEntityTypeAttribute.cs
- altserialization.cs
- SafeNativeHandle.cs
- EpmTargetPathSegment.cs
- COM2ExtendedUITypeEditor.cs
- InProcStateClientManager.cs
- dsa.cs
- MulticastIPAddressInformationCollection.cs
- DiagnosticStrings.cs
- Variable.cs
- IdentityReference.cs
- BinaryMessageFormatter.cs
- BitmapEffectrendercontext.cs
- MetadataItemCollectionFactory.cs
- StringToken.cs
- MessageFilter.cs
- CellParagraph.cs
- WebConvert.cs
- ListArgumentProvider.cs
- XamlFrame.cs
- RightsManagementUser.cs
- QueryAccessibilityHelpEvent.cs
- PropertyChangedEventManager.cs
- ParamArrayAttribute.cs
- SequenceFullException.cs
- DataGridViewCellStateChangedEventArgs.cs
- ExcCanonicalXml.cs
- ReversePositionQuery.cs
- ToolStripLocationCancelEventArgs.cs
- WindowsListViewItemCheckBox.cs
- HMACSHA256.cs
- RequestCachePolicy.cs
- ReadWriteSpinLock.cs
- SpeakInfo.cs
- WebConfigurationHost.cs
- WinFormsSecurity.cs
- DesignerAttribute.cs
- PermissionSetEnumerator.cs
- StreamResourceInfo.cs
- BooleanKeyFrameCollection.cs
- StreamHelper.cs
- ListBoxItemAutomationPeer.cs
- serverconfig.cs
- XPathNodeIterator.cs
- EdmToObjectNamespaceMap.cs
- ReaderOutput.cs
- XamlDesignerSerializationManager.cs
- BoundingRectTracker.cs
- MailAddress.cs
- ScrollItemPattern.cs
- SimpleHandlerFactory.cs
- GlobalItem.cs
- GrammarBuilderDictation.cs
- SerializableAttribute.cs
- ManifestSignatureInformation.cs
- TiffBitmapDecoder.cs
- FormView.cs
- XmlILIndex.cs
- MemberMaps.cs
- GeneralTransform3DTo2D.cs
- BaseCAMarshaler.cs
- BypassElementCollection.cs
- ExpressionBindingCollection.cs
- _NegoStream.cs
- IgnoreSectionHandler.cs
- StructuredCompositeActivityDesigner.cs
- AppearanceEditorPart.cs
- HtmlTitle.cs
- DefaultTraceListener.cs
- WebPageTraceListener.cs
- GuidConverter.cs
- RelationshipConstraintValidator.cs
- Operand.cs
- XmlUtf8RawTextWriter.cs