Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Activation / ListenerChannelContext.cs / 1 / ListenerChannelContext.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
namespace System.ServiceModel.Activation
{
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Net.Sockets;
using System.ServiceModel.Dispatcher;
[DataContract]
class ListenerChannelContext
{
[DataMember]
string appKey;
[DataMember]
int listenerChannelId;
[DataMember]
Guid token;
internal ListenerChannelContext(string appKey, int listenerChannelId, Guid token)
{
this.appKey = appKey;
this.listenerChannelId = listenerChannelId;
this.token = token;
}
internal string AppKey { get { return appKey; } }
internal int ListenerChannelId { get { return listenerChannelId; } }
internal Guid Token { get { return token; } }
public static ListenerChannelContext Hydrate(byte[] blob)
{
using (MemoryStream memoryStream = new MemoryStream(blob))
{
DataContractSerializer serializer = new DataContractSerializer(typeof(ListenerChannelContext));
return (ListenerChannelContext)serializer.ReadObject(memoryStream);
}
}
public byte[] Dehydrate()
{
using (MemoryStream memoryStream = new MemoryStream())
{
DataContractSerializer serializer = new DataContractSerializer(typeof(ListenerChannelContext));
serializer.WriteObject(memoryStream, this);
return memoryStream.ToArray();
}
}
}
}
// 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
- SqlTriggerAttribute.cs
- RowUpdatingEventArgs.cs
- RuntimeArgument.cs
- TagNameToTypeMapper.cs
- PerspectiveCamera.cs
- NetTcpSectionData.cs
- XmlSchemaException.cs
- XPathNodeList.cs
- ListControl.cs
- ServiceControllerDesigner.cs
- XmlSchemaFacet.cs
- DataGridViewSelectedCellCollection.cs
- RouteItem.cs
- CompiledQueryCacheEntry.cs
- InputLangChangeRequestEvent.cs
- MimeBasePart.cs
- DocumentPropertiesDialog.cs
- DataGridViewImageColumn.cs
- BulletedList.cs
- QilVisitor.cs
- DispatcherHooks.cs
- RuleConditionDialog.cs
- StandardToolWindows.cs
- SpecialTypeDataContract.cs
- DefaultBindingPropertyAttribute.cs
- WindowExtensionMethods.cs
- FamilyMapCollection.cs
- BindingCompleteEventArgs.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- EventMappingSettings.cs
- Viewport3DAutomationPeer.cs
- M3DUtil.cs
- LabelAutomationPeer.cs
- WebPartZoneAutoFormat.cs
- KeyboardNavigation.cs
- XmlSortKeyAccumulator.cs
- NullableBoolConverter.cs
- MobileListItem.cs
- DataRelation.cs
- DataServiceHost.cs
- AsyncOperationManager.cs
- HttpRuntimeSection.cs
- FormsAuthenticationTicket.cs
- AggregateNode.cs
- ChangeToolStripParentVerb.cs
- CompilerCollection.cs
- HttpContext.cs
- BuilderInfo.cs
- Socket.cs
- securitymgrsite.cs
- DataGridView.cs
- CommittableTransaction.cs
- TypeConstant.cs
- BitmapEffectDrawingContextState.cs
- MailAddressCollection.cs
- BindingExpressionUncommonField.cs
- Camera.cs
- AnimatedTypeHelpers.cs
- ParserExtension.cs
- MergeExecutor.cs
- ValidationError.cs
- MemoryMappedFileSecurity.cs
- FileRecordSequenceHelper.cs
- TrackingRecordPreFilter.cs
- PageStatePersister.cs
- XPathBinder.cs
- ConfigXmlElement.cs
- PermissionToken.cs
- WebSysDefaultValueAttribute.cs
- Bitmap.cs
- CheckBoxStandardAdapter.cs
- RealProxy.cs
- GridProviderWrapper.cs
- HtmlInputReset.cs
- EncodingNLS.cs
- XPathNodeList.cs
- LambdaCompiler.cs
- PermissionAttributes.cs
- SafeNativeMemoryHandle.cs
- ConfigurationElementProperty.cs
- PixelFormats.cs
- WebPartDescriptionCollection.cs
- KeyProperty.cs
- HostProtectionPermission.cs
- ValidationErrorEventArgs.cs
- PublisherIdentityPermission.cs
- FixedDocument.cs
- EntityDataSourceValidationException.cs
- HttpModulesSection.cs
- ParserStack.cs
- ContextMenu.cs
- IisHelper.cs
- ScriptResourceInfo.cs
- TreeNodeStyle.cs
- DataServiceException.cs
- BuildResultCache.cs
- UInt16.cs
- SHA256Managed.cs
- AttributeUsageAttribute.cs
- ISAPIApplicationHost.cs