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
- AuthenticationModulesSection.cs
- TimeSpanParse.cs
- ConvertEvent.cs
- XmlWriterSettings.cs
- SuppressMessageAttribute.cs
- mediapermission.cs
- SqlInternalConnectionTds.cs
- RenameRuleObjectDialog.Designer.cs
- PropertyIdentifier.cs
- DoubleAnimationClockResource.cs
- SqlBinder.cs
- DBParameter.cs
- metadatamappinghashervisitor.cs
- BindingExpressionBase.cs
- XmlSerializerFactory.cs
- CharEnumerator.cs
- StdValidatorsAndConverters.cs
- SubMenuStyle.cs
- MdImport.cs
- RawAppCommandInputReport.cs
- RelatedView.cs
- WebPartEditorOkVerb.cs
- ToolStripHighContrastRenderer.cs
- XmlDataSource.cs
- XsdValidatingReader.cs
- CodeArrayCreateExpression.cs
- ProfileManager.cs
- connectionpool.cs
- EdmSchemaAttribute.cs
- PresentationAppDomainManager.cs
- CalendarDateChangedEventArgs.cs
- PaintEvent.cs
- XmlSerializationWriter.cs
- SpinLock.cs
- StorageTypeMapping.cs
- HtmlMeta.cs
- TextFragmentEngine.cs
- XPathNavigator.cs
- DiscoveryMessageProperty.cs
- RegionIterator.cs
- Attachment.cs
- PerformanceCounterPermission.cs
- MissingFieldException.cs
- ImageListStreamer.cs
- AddInEnvironment.cs
- TransferRequestHandler.cs
- WebPartVerbsEventArgs.cs
- Shared.cs
- TableLayout.cs
- AudioFormatConverter.cs
- ControlPaint.cs
- UrlPath.cs
- dataprotectionpermissionattribute.cs
- ModelTreeManager.cs
- ContentDesigner.cs
- AssertSection.cs
- TransformerInfoCollection.cs
- SymLanguageType.cs
- FormClosingEvent.cs
- ErrorCodes.cs
- PageTheme.cs
- MenuAutomationPeer.cs
- MaterialGroup.cs
- glyphs.cs
- SmtpClient.cs
- SchemaNames.cs
- JsonSerializer.cs
- x509utils.cs
- SiteMap.cs
- StringConverter.cs
- MethodImplAttribute.cs
- MetadataArtifactLoaderResource.cs
- hresults.cs
- GroupBoxDesigner.cs
- Privilege.cs
- HitTestFilterBehavior.cs
- UIElementCollection.cs
- _BasicClient.cs
- InvalidEnumArgumentException.cs
- XslAstAnalyzer.cs
- LineServices.cs
- Matrix3DValueSerializer.cs
- CodeDirectoryCompiler.cs
- ExplicitDiscriminatorMap.cs
- DataKeyCollection.cs
- SchemeSettingElementCollection.cs
- ValidationRuleCollection.cs
- UpdateException.cs
- MarkupCompilePass1.cs
- AutomationPatternInfo.cs
- EntityConnectionStringBuilder.cs
- SqlDataSourceFilteringEventArgs.cs
- documentsequencetextcontainer.cs
- Scheduler.cs
- WebReferenceOptions.cs
- RuleSetBrowserDialog.cs
- SourceElementsCollection.cs
- IsolatedStorageFile.cs
- _BufferOffsetSize.cs
- Command.cs