| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544 |
- //------------------------------------------------------------
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //------------------------------------------------------------
- namespace System.ServiceModel
- {
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Runtime;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.ServiceModel.Diagnostics;
- using System.Threading;
- using System.ServiceModel.Diagnostics.Application;
- using System.Runtime.Remoting.Messaging;
- using System.ServiceModel.Dispatcher;
- using System.Security;
- public abstract class ClientBase<TChannel> : ICommunicationObject, IDisposable
- where TChannel : class
- {
- TChannel channel;
- ChannelFactoryRef<TChannel> channelFactoryRef;
- EndpointTrait<TChannel> endpointTrait;
- // Determine whether the proxy can share factory with others. It is false only if the public getters
- // are invoked.
- bool canShareFactory = true;
- // Determine whether the proxy is currently holding a cached factory
- bool useCachedFactory;
- // Determine whether we have locked down sharing for this proxy. This is turned on only when the channel
- // is created.
- bool sharingFinalized;
- // Determine whether the ChannelFactoryRef has been released. We should release it only once per proxy
- bool channelFactoryRefReleased;
- // Determine whether we have released the last ref count of the ChannelFactory so that we could abort it when it was closing.
- bool releasedLastRef;
- object syncRoot = new object();
- object finalizeLock = new object();
- // Cache at most 32 ChannelFactories
- const int maxNumChannelFactories = 32;
- static ChannelFactoryRefCache<TChannel> factoryRefCache = new ChannelFactoryRefCache<TChannel>(maxNumChannelFactories);
- static object staticLock = new object();
- static object cacheLock = new object();
- static CacheSetting cacheSetting = CacheSetting.Default;
- static bool isCacheSettingReadOnly;
- static AsyncCallback onAsyncCallCompleted = Fx.ThunkCallback(new AsyncCallback(OnAsyncCallCompleted));
- // IMPORTANT: any changes to the set of protected .ctors of this class need to be reflected
- // in ServiceContractGenerator.cs as well.
- protected ClientBase()
- {
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>("*"));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>("*", null, null);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(string endpointConfigurationName)
- {
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>(endpointConfigurationName));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, null, null);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(string endpointConfigurationName, string remoteAddress)
- {
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- EndpointAddress endpointAddress = new EndpointAddress(remoteAddress);
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>(endpointConfigurationName, endpointAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, endpointAddress, null);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(string endpointConfigurationName, EndpointAddress remoteAddress)
- {
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>(endpointConfigurationName, remoteAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, remoteAddress, null);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(Binding binding, EndpointAddress remoteAddress)
- {
- if (binding == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("binding");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOn)
- {
- this.endpointTrait = new ProgrammaticEndpointTrait<TChannel>(binding, remoteAddress, null);
- InitializeChannelFactoryRef();
- }
- else
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>(binding, remoteAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- }
- protected ClientBase(ServiceEndpoint endpoint)
- {
- if (endpoint == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpoint");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOn)
- {
- this.endpointTrait = new ServiceEndpointTrait<TChannel>(endpoint, null);
- this.InitializeChannelFactoryRef();
- }
- else
- {
- channelFactoryRef = new ChannelFactoryRef<TChannel>(new ChannelFactory<TChannel>(endpoint));
- channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- }
- protected ClientBase(InstanceContext callbackInstance)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, "*"));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>("*", null, callbackInstance);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(InstanceContext callbackInstance, string endpointConfigurationName)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, endpointConfigurationName));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, null, callbackInstance);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- EndpointAddress endpointAddress = new EndpointAddress(remoteAddress);
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, endpointConfigurationName, endpointAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, endpointAddress, callbackInstance);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(InstanceContext callbackInstance, string endpointConfigurationName, EndpointAddress remoteAddress)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- if (endpointConfigurationName == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointConfigurationName");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOff)
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, endpointConfigurationName, remoteAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- else
- {
- this.endpointTrait = new ConfigurationEndpointTrait<TChannel>(endpointConfigurationName, remoteAddress, callbackInstance);
- InitializeChannelFactoryRef();
- }
- }
- protected ClientBase(InstanceContext callbackInstance, Binding binding, EndpointAddress remoteAddress)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- if (binding == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("binding");
- if (remoteAddress == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("remoteAddress");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOn)
- {
- this.endpointTrait = new ProgrammaticEndpointTrait<TChannel>(binding, remoteAddress, callbackInstance);
- InitializeChannelFactoryRef();
- }
- else
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, binding, remoteAddress));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- }
- protected ClientBase(InstanceContext callbackInstance, ServiceEndpoint endpoint)
- {
- if (callbackInstance == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackInstance");
- if (endpoint == null)
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpoint");
- MakeCacheSettingReadOnly();
- if (cacheSetting == CacheSetting.AlwaysOn)
- {
- this.endpointTrait = new ServiceEndpointTrait<TChannel>(endpoint, callbackInstance);
- InitializeChannelFactoryRef();
- }
- else
- {
- this.channelFactoryRef = new ChannelFactoryRef<TChannel>(
- new DuplexChannelFactory<TChannel>(callbackInstance, endpoint));
- this.channelFactoryRef.ChannelFactory.TraceOpenAndClose = false;
- TryDisableSharing();
- }
- }
- protected T GetDefaultValueForInitialization<T>()
- {
- return default(T);
- }
- object ThisLock
- {
- get
- {
- return syncRoot;
- }
- }
- protected TChannel Channel
- {
- get
- {
- // created on demand, so that Mort can modify .Endpoint before calling methods on the client
- if (this.channel == null)
- {
- lock (ThisLock)
- {
- if (this.channel == null)
- {
- using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
- {
- if (DiagnosticUtility.ShouldUseActivity)
- {
- ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityOpenClientBase, typeof(TChannel).FullName), ActivityType.OpenClient);
- }
- if (this.useCachedFactory)
- {
- try
- {
- CreateChannelInternal();
- }
- #pragma warning suppress 56500 // covered by FxCOP
- catch (Exception ex)
- {
- if (this.useCachedFactory &&
- (ex is CommunicationException ||
- ex is ObjectDisposedException ||
- ex is TimeoutException))
- {
- DiagnosticUtility.TraceHandledException(ex, TraceEventType.Warning);
- InvalidateCacheAndCreateChannel();
- }
- else
- {
- #pragma warning suppress 56503 // [....], We throw only for unknown exceptions.
- throw;
- }
- }
- }
- else
- {
- CreateChannelInternal();
- }
- }
- }
- }
- }
- return channel;
- }
- }
- public static CacheSetting CacheSetting
- {
- get
- {
- return cacheSetting;
- }
- set
- {
- lock (cacheLock)
- {
- if (isCacheSettingReadOnly && cacheSetting != value)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxImmutableClientBaseCacheSetting, typeof(TChannel).ToString())));
- }
- else
- {
- cacheSetting = value;
- }
- }
- }
- }
- public ChannelFactory<TChannel> ChannelFactory
- {
- get
- {
- if (cacheSetting == CacheSetting.Default)
- {
- TryDisableSharing();
- }
- return GetChannelFactory();
- }
- }
- public ClientCredentials ClientCredentials
- {
- get
- {
- if (cacheSetting == CacheSetting.Default)
- {
- TryDisableSharing();
- }
- return this.ChannelFactory.Credentials;
- }
- }
- public CommunicationState State
- {
- get
- {
- IChannel channel = (IChannel)this.channel;
- if (channel != null)
- {
- return channel.State;
- }
- else
- {
- // we may have failed to create the channel under open, in which case we our factory wouldn't be open
- if (!this.useCachedFactory)
- {
- return GetChannelFactory().State;
- }
- else
- {
- return CommunicationState.Created;
- }
- }
- }
- }
- public IClientChannel InnerChannel
- {
- get
- {
- return (IClientChannel)Channel;
- }
- }
- public ServiceEndpoint Endpoint
- {
- get
- {
- if (cacheSetting == CacheSetting.Default)
- {
- TryDisableSharing();
- }
- return GetChannelFactory().Endpoint;
- }
- }
- public void Open()
- {
- ((ICommunicationObject)this).Open(GetChannelFactory().InternalOpenTimeout);
- }
- public void Abort()
- {
- IChannel channel = (IChannel)this.channel;
- if (channel != null)
- {
- channel.Abort();
- }
- if (!channelFactoryRefReleased)
- {
- lock (staticLock)
- {
- if (!channelFactoryRefReleased)
- {
- if (this.channelFactoryRef.Release())
- {
- this.releasedLastRef = true;
- }
- channelFactoryRefReleased = true;
- }
- }
- }
- // Abort the ChannelFactory if we released the last one. We should be able to abort it when another thread is closing it.
- if (this.releasedLastRef)
- {
- this.channelFactoryRef.Abort();
- }
- }
- public void Close()
- {
- ((ICommunicationObject)this).Close(GetChannelFactory().InternalCloseTimeout);
- }
- public void DisplayInitializationUI()
- {
- ((IClientChannel)this.InnerChannel).DisplayInitializationUI();
- }
- // This ensures that the cachesetting (on, off or default) cannot be modified by
- // another ClientBase instance of matching TChannel after the first instance is created.
- void MakeCacheSettingReadOnly()
- {
- if (isCacheSettingReadOnly)
- return;
- lock (cacheLock)
- {
- isCacheSettingReadOnly = true;
- }
- }
- void CreateChannelInternal()
- {
- try
- {
- this.channel = this.CreateChannel();
- if (this.sharingFinalized)
- {
- if (this.canShareFactory && !this.useCachedFactory)
- {
- // It is OK to add ChannelFactory to the cache now.
- TryAddChannelFactoryToCache();
- }
- }
- }
- finally
- {
- if (!this.sharingFinalized && cacheSetting == CacheSetting.Default)
- {
- // this.CreateChannel() is not called. For safety, we disable sharing.
- TryDisableSharing();
- }
- }
- }
- protected virtual TChannel CreateChannel()
- {
- if (this.sharingFinalized)
- return GetChannelFactory().CreateChannel();
- lock (this.finalizeLock)
- {
- this.sharingFinalized = true;
- return GetChannelFactory().CreateChannel();
- }
- }
- void IDisposable.Dispose()
- {
- this.Close();
- }
- void ICommunicationObject.Open(TimeSpan timeout)
- {
- TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);
- if (!this.useCachedFactory)
- {
- GetChannelFactory().Open(timeoutHelper.RemainingTime());
- }
- this.InnerChannel.Open(timeoutHelper.RemainingTime());
- }
- void ICommunicationObject.Close(TimeSpan timeout)
- {
- using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
- {
- if (DiagnosticUtility.ShouldUseActivity)
- {
- ServiceModelActivity.Start(activity, SR.GetString(SR.ActivityCloseClientBase, typeof(TChannel).FullName), ActivityType.Close);
- }
- TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);
- if (this.channel != null)
- {
- InnerChannel.Close(timeoutHelper.RemainingTime());
- }
- if (!channelFactoryRefReleased)
- {
- lock (staticLock)
- {
- if (!channelFactoryRefReleased)
- {
- if (this.channelFactoryRef.Release())
- {
- this.releasedLastRef = true;
- }
- this.channelFactoryRefReleased = true;
- }
- }
- // Close the factory outside of the lock so that we can abort from a different thread.
- if (this.releasedLastRef)
- {
- if (this.useCachedFactory)
- {
- this.channelFactoryRef.Abort();
- }
- else
- {
- this.channelFactoryRef.Close(timeoutHelper.RemainingTime());
- }
- }
- }
- }
- }
- event EventHandler ICommunicationObject.Closed
- {
- add
- {
- this.InnerChannel.Closed += value;
- }
- remove
- {
- this.InnerChannel.Closed -= value;
- }
- }
- event EventHandler ICommunicationObject.Closing
- {
- add
- {
- this.InnerChannel.Closing += value;
- }
- remove
- {
- this.InnerChannel.Closing -= value;
- }
- }
- event EventHandler ICommunicationObject.Faulted
- {
- add
- {
- this.InnerChannel.Faulted += value;
- }
- remove
- {
- this.InnerChannel.Faulted -= value;
- }
- }
- event EventHandler ICommunicationObject.Opened
- {
- add
- {
- this.InnerChannel.Opened += value;
- }
- remove
- {
- this.InnerChannel.Opened -= value;
- }
- }
- event EventHandler ICommunicationObject.Opening
- {
- add
- {
- this.InnerChannel.Opening += value;
- }
- remove
- {
- this.InnerChannel.Opening -= value;
- }
- }
- IAsyncResult ICommunicationObject.BeginClose(AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this).BeginClose(GetChannelFactory().InternalCloseTimeout, callback, state);
- }
- IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return new ChainedAsyncResult(timeout, callback, state, BeginChannelClose, EndChannelClose, BeginFactoryClose, EndFactoryClose);
- }
- void ICommunicationObject.EndClose(IAsyncResult result)
- {
- ChainedAsyncResult.End(result);
- }
- IAsyncResult ICommunicationObject.BeginOpen(AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this).BeginOpen(GetChannelFactory().InternalOpenTimeout, callback, state);
- }
- IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return new ChainedAsyncResult(timeout, callback, state, BeginFactoryOpen, EndFactoryOpen, BeginChannelOpen, EndChannelOpen);
- }
- void ICommunicationObject.EndOpen(IAsyncResult result)
- {
- ChainedAsyncResult.End(result);
- }
- //ChainedAsyncResult methods for opening and closing ChannelFactory<T>
- internal IAsyncResult BeginFactoryOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- if (this.useCachedFactory)
- {
- return new CompletedAsyncResult(callback, state);
- }
- else
- {
- return GetChannelFactory().BeginOpen(timeout, callback, state);
- }
- }
- internal void EndFactoryOpen(IAsyncResult result)
- {
- if (this.useCachedFactory)
- {
- CompletedAsyncResult.End(result);
- }
- else
- {
- GetChannelFactory().EndOpen(result);
- }
- }
- internal IAsyncResult BeginChannelOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return this.InnerChannel.BeginOpen(timeout, callback, state);
- }
- internal void EndChannelOpen(IAsyncResult result)
- {
- this.InnerChannel.EndOpen(result);
- }
- internal IAsyncResult BeginFactoryClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- if (this.useCachedFactory)
- {
- return new CompletedAsyncResult(callback, state);
- }
- else
- {
- return GetChannelFactory().BeginClose(timeout, callback, state);
- }
- }
- internal void EndFactoryClose(IAsyncResult result)
- {
- if (typeof(CompletedAsyncResult).IsAssignableFrom(result.GetType()))
- {
- CompletedAsyncResult.End(result);
- }
- else
- {
- GetChannelFactory().EndClose(result);
- }
- }
- internal IAsyncResult BeginChannelClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- if (this.channel != null)
- {
- return this.InnerChannel.BeginClose(timeout, callback, state);
- }
- else
- {
- return new CompletedAsyncResult(callback, state);
- }
- }
- internal void EndChannelClose(IAsyncResult result)
- {
- if (typeof(CompletedAsyncResult).IsAssignableFrom(result.GetType()))
- {
- CompletedAsyncResult.End(result);
- }
- else
- {
- this.InnerChannel.EndClose(result);
- }
- }
- ChannelFactory<TChannel> GetChannelFactory()
- {
- return this.channelFactoryRef.ChannelFactory;
- }
- void InitializeChannelFactoryRef()
- {
- Fx.Assert(this.channelFactoryRef == null, "The channelFactory should have never been assigned");
- Fx.Assert(this.canShareFactory, "GetChannelFactoryFromCache can be called only when canShareFactory is true");
- lock (staticLock)
- {
- ChannelFactoryRef<TChannel> factoryRef;
- if (factoryRefCache.TryGetValue(this.endpointTrait, out factoryRef))
- {
- if (factoryRef.ChannelFactory.State != CommunicationState.Opened)
- {
- // Remove the bad ChannelFactory.
- factoryRefCache.Remove(this.endpointTrait);
- }
- else
- {
- this.channelFactoryRef = factoryRef;
- this.channelFactoryRef.AddRef();
- useCachedFactory = true;
- if (TD.ClientBaseChannelFactoryCacheHitIsEnabled())
- {
- TD.ClientBaseChannelFactoryCacheHit(this);
- }
- return;
- }
- }
- }
- if (this.channelFactoryRef == null)
- {
- // Creating the ChannelFactory at initial time to catch configuration exception earlier.
- this.channelFactoryRef = CreateChannelFactoryRef(this.endpointTrait);
- }
- }
- static ChannelFactoryRef<TChannel> CreateChannelFactoryRef(EndpointTrait<TChannel> endpointTrait)
- {
- Fx.Assert(endpointTrait != null, "The endpointTrait should not be null when the factory can be shared.");
- ChannelFactory<TChannel> channelFactory = endpointTrait.CreateChannelFactory();
- channelFactory.TraceOpenAndClose = false;
- return new ChannelFactoryRef<TChannel>(channelFactory);
- }
- // Once the channel is created, we can't disable caching.
- // This method can be called safely multiple times.
- // this.sharingFinalized is set the first time the method is called.
- // Subsequent calls are essentially no-ops.
- void TryDisableSharing()
- {
- if (this.sharingFinalized)
- return;
- lock (this.finalizeLock)
- {
- if (this.sharingFinalized)
- return;
- this.canShareFactory = false;
- this.sharingFinalized = true;
- if (this.useCachedFactory)
- {
- ChannelFactoryRef<TChannel> pendingFactoryRef = this.channelFactoryRef;
- this.channelFactoryRef = CreateChannelFactoryRef(this.endpointTrait);
- this.useCachedFactory = false;
- lock (staticLock)
- {
- if (!pendingFactoryRef.Release())
- {
- pendingFactoryRef = null;
- }
- }
- if (pendingFactoryRef != null)
- pendingFactoryRef.Abort();
- }
- }
- // can be done outside the lock since the lines below do not access shared data.
- // also the use of this.sharingFinalized in the lines above ensures that tracing
- // happens only once and only when needed.
- if (TD.ClientBaseUsingLocalChannelFactoryIsEnabled())
- {
- TD.ClientBaseUsingLocalChannelFactory(this);
- }
- }
- void TryAddChannelFactoryToCache()
- {
- Fx.Assert(this.canShareFactory, "This should be called only when this proxy can share ChannelFactory.");
- Fx.Assert(this.channelFactoryRef.ChannelFactory.State == CommunicationState.Opened,
- "The ChannelFactory must be in Opened state for caching.");
- // Lock the cache and add the item to synchronize with lookup.
- lock (staticLock)
- {
- ChannelFactoryRef<TChannel> cfRef;
- if (!factoryRefCache.TryGetValue(this.endpointTrait, out cfRef))
- {
- // Increment the ref count before adding to the cache.
- this.channelFactoryRef.AddRef();
- factoryRefCache.Add(this.endpointTrait, this.channelFactoryRef);
- this.useCachedFactory = true;
- if (TD.ClientBaseCachedChannelFactoryCountIsEnabled())
- {
- TD.ClientBaseCachedChannelFactoryCount(factoryRefCache.Count, maxNumChannelFactories, this);
- }
- }
- }
- }
- // NOTE: This should be called inside ThisLock
- void InvalidateCacheAndCreateChannel()
- {
- RemoveFactoryFromCache();
- TryDisableSharing();
- CreateChannelInternal();
- }
- void RemoveFactoryFromCache()
- {
- lock (staticLock)
- {
- ChannelFactoryRef<TChannel> factoryRef;
- if (factoryRefCache.TryGetValue(this.endpointTrait, out factoryRef))
- {
- if (object.ReferenceEquals(this.channelFactoryRef, factoryRef))
- {
- factoryRefCache.Remove(this.endpointTrait);
- }
- }
- }
- }
- // WARNING: changes in the signature/name of the following delegates must be applied to the
- // ClientClassGenerator.cs as well, otherwise the ClientClassGenerator would generate wrong code.
- protected delegate IAsyncResult BeginOperationDelegate(object[] inValues, AsyncCallback asyncCallback, object state);
- protected delegate object[] EndOperationDelegate(IAsyncResult result);
- // WARNING: Any changes in the signature/name of the following type and its ctor must be applied to the
- // ClientClassGenerator.cs as well, otherwise the ClientClassGenerator would generate wrong code.
- protected class InvokeAsyncCompletedEventArgs : AsyncCompletedEventArgs
- {
- object[] results;
- internal InvokeAsyncCompletedEventArgs(object[] results, Exception error, bool cancelled, object userState)
- : base(error, cancelled, userState)
- {
- this.results = results;
- }
- public object[] Results
- {
- get
- {
- return this.results;
- }
- }
- }
- // WARNING: Any changes in the signature/name of the following method ctor must be applied to the
- // ClientClassGenerator.cs as well, otherwise the ClientClassGenerator would generate wrong code.
- protected void InvokeAsync(BeginOperationDelegate beginOperationDelegate, object[] inValues,
- EndOperationDelegate endOperationDelegate, SendOrPostCallback operationCompletedCallback, object userState)
- {
- if (beginOperationDelegate == null)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("beginOperationDelegate");
- }
- if (endOperationDelegate == null)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endOperationDelegate");
- }
- AsyncOperation asyncOperation = AsyncOperationManager.CreateOperation(userState);
- AsyncOperationContext context = new AsyncOperationContext(asyncOperation, endOperationDelegate, operationCompletedCallback);
- Exception error = null;
- object[] results = null;
- IAsyncResult result = null;
- try
- {
- result = beginOperationDelegate(inValues, onAsyncCallCompleted, context);
- if (result.CompletedSynchronously)
- {
- results = endOperationDelegate(result);
- }
- }
- catch (Exception e)
- {
- if (Fx.IsFatal(e))
- {
- throw;
- }
- error = e;
- }
- if (error != null || result.CompletedSynchronously) /* result cannot be null if error == null */
- {
- CompleteAsyncCall(context, results, error);
- }
- }
- static void OnAsyncCallCompleted(IAsyncResult result)
- {
- if (result.CompletedSynchronously)
- {
- return;
- }
- AsyncOperationContext context = (AsyncOperationContext)result.AsyncState;
- Exception error = null;
- object[] results = null;
- try
- {
- results = context.EndDelegate(result);
- }
- catch (Exception e)
- {
- if (Fx.IsFatal(e))
- {
- throw;
- }
- error = e;
- }
- CompleteAsyncCall(context, results, error);
- }
- static void CompleteAsyncCall(AsyncOperationContext context, object[] results, Exception error)
- {
- if (context.CompletionCallback != null)
- {
- InvokeAsyncCompletedEventArgs e = new InvokeAsyncCompletedEventArgs(results, error, false, context.AsyncOperation.UserSuppliedState);
- context.AsyncOperation.PostOperationCompleted(context.CompletionCallback, e);
- }
- else
- {
- context.AsyncOperation.OperationCompleted();
- }
- }
- class AsyncOperationContext
- {
- AsyncOperation asyncOperation;
- EndOperationDelegate endDelegate;
- SendOrPostCallback completionCallback;
- internal AsyncOperationContext(AsyncOperation asyncOperation, EndOperationDelegate endDelegate, SendOrPostCallback completionCallback)
- {
- this.asyncOperation = asyncOperation;
- this.endDelegate = endDelegate;
- this.completionCallback = completionCallback;
- }
- internal AsyncOperation AsyncOperation
- {
- get
- {
- return this.asyncOperation;
- }
- }
- internal EndOperationDelegate EndDelegate
- {
- get
- {
- return this.endDelegate;
- }
- }
- internal SendOrPostCallback CompletionCallback
- {
- get
- {
- return this.completionCallback;
- }
- }
- }
- protected class ChannelBase<T> : IClientChannel, IOutputChannel, IRequestChannel, IChannelBaseProxy
- where T : class
- {
- ServiceChannel channel;
- System.ServiceModel.Dispatcher.ImmutableClientRuntime runtime;
- protected ChannelBase(ClientBase<T> client)
- {
- if (client.Endpoint.Address == null)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxChannelFactoryEndpointAddressUri)));
- }
- ChannelFactory<T> cf = client.ChannelFactory;
- cf.EnsureOpened(); // to prevent the NullReferenceException that is thrown if the ChannelFactory is not open when cf.ServiceChannelFactory is accessed.
- this.channel = cf.ServiceChannelFactory.CreateServiceChannel(client.Endpoint.Address, client.Endpoint.Address.Uri);
- this.channel.InstanceContext = cf.CallbackInstance;
- this.runtime = this.channel.ClientRuntime.GetRuntime();
- }
- [Fx.Tag.SecurityNote(Critical = "Accesses the critical IMethodCallMessage interface.",
- Safe = "The implementation of IMethodCallMessage is local and is created locally as weell; i.e. not passed in from Remoting.")]
- [SecuritySafeCritical]
- protected IAsyncResult BeginInvoke(string methodName, object[] args, AsyncCallback callback, object state)
- {
- object[] inArgs = new object[args.Length + 2];
- Array.Copy(args, inArgs, args.Length);
- inArgs[inArgs.Length - 2] = callback;
- inArgs[inArgs.Length - 1] = state;
- IMethodCallMessage methodCall = new MethodCallMessage(inArgs);
- ProxyOperationRuntime op = GetOperationByName(methodName);
- object[] ins = op.MapAsyncBeginInputs(methodCall, out callback, out state);
- return this.channel.BeginCall(op.Action, op.IsOneWay, op, ins, callback, state);
- }
- [Fx.Tag.SecurityNote(Critical = "Accesses the critical IMethodCallMessage interface.",
- Safe = "The implementation of IMethodCallMessage is local and is created locally as weell; i.e. not passed in from Remoting.")]
- [SecuritySafeCritical]
- protected object EndInvoke(string methodName, object[] args, IAsyncResult result)
- {
- object[] inArgs = new object[args.Length + 1];
- Array.Copy(args, inArgs, args.Length);
- inArgs[inArgs.Length - 1] = result;
- IMethodCallMessage methodCall = new MethodCallMessage(inArgs);
- ProxyOperationRuntime op = GetOperationByName(methodName);
- object[] outs;
- op.MapAsyncEndInputs(methodCall, out result, out outs);
- object ret = this.channel.EndCall(op.Action, outs, result);
- object[] retArgs = op.MapAsyncOutputs(methodCall, outs, ref ret);
- if (retArgs != null)
- {
- Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length");
- Array.Copy(retArgs, args, args.Length);
- }
- return ret;
- }
- System.ServiceModel.Dispatcher.ProxyOperationRuntime GetOperationByName(string methodName)
- {
- ProxyOperationRuntime op = this.runtime.GetOperationByName(methodName);
- if (op == null)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SFxMethodNotSupported1, methodName)));
- }
- return op;
- }
- bool IClientChannel.AllowInitializationUI
- {
- get { return ((IClientChannel)this.channel).AllowInitializationUI; }
- set { ((IClientChannel)this.channel).AllowInitializationUI = value; }
- }
- bool IClientChannel.DidInteractiveInitialization
- {
- get { return ((IClientChannel)this.channel).DidInteractiveInitialization; }
- }
- Uri IClientChannel.Via
- {
- get { return ((IClientChannel)this.channel).Via; }
- }
- event EventHandler<UnknownMessageReceivedEventArgs> IClientChannel.UnknownMessageReceived
- {
- add { ((IClientChannel)this.channel).UnknownMessageReceived += value; }
- remove { ((IClientChannel)this.channel).UnknownMessageReceived -= value; }
- }
- void IClientChannel.DisplayInitializationUI()
- {
- ((IClientChannel)this.channel).DisplayInitializationUI();
- }
- IAsyncResult IClientChannel.BeginDisplayInitializationUI(AsyncCallback callback, object state)
- {
- return ((IClientChannel)this.channel).BeginDisplayInitializationUI(callback, state);
- }
- void IClientChannel.EndDisplayInitializationUI(IAsyncResult result)
- {
- ((IClientChannel)this.channel).EndDisplayInitializationUI(result);
- }
- bool IContextChannel.AllowOutputBatching
- {
- get { return ((IContextChannel)this.channel).AllowOutputBatching; }
- set { ((IContextChannel)this.channel).AllowOutputBatching = value; }
- }
- IInputSession IContextChannel.InputSession
- {
- get { return ((IContextChannel)this.channel).InputSession; }
- }
- EndpointAddress IContextChannel.LocalAddress
- {
- get { return ((IContextChannel)this.channel).LocalAddress; }
- }
- TimeSpan IContextChannel.OperationTimeout
- {
- get { return ((IContextChannel)this.channel).OperationTimeout; }
- set { ((IContextChannel)this.channel).OperationTimeout = value; }
- }
- IOutputSession IContextChannel.OutputSession
- {
- get { return ((IContextChannel)this.channel).OutputSession; }
- }
- EndpointAddress IContextChannel.RemoteAddress
- {
- get { return ((IContextChannel)this.channel).RemoteAddress; }
- }
- string IContextChannel.SessionId
- {
- get { return ((IContextChannel)this.channel).SessionId; }
- }
- TProperty IChannel.GetProperty<TProperty>()
- {
- return ((IChannel)this.channel).GetProperty<TProperty>();
- }
- CommunicationState ICommunicationObject.State
- {
- get { return ((ICommunicationObject)this.channel).State; }
- }
- event EventHandler ICommunicationObject.Closed
- {
- add { ((ICommunicationObject)this.channel).Closed += value; }
- remove { ((ICommunicationObject)this.channel).Closed -= value; }
- }
- event EventHandler ICommunicationObject.Closing
- {
- add { ((ICommunicationObject)this.channel).Closing += value; }
- remove { ((ICommunicationObject)this.channel).Closing -= value; }
- }
- event EventHandler ICommunicationObject.Faulted
- {
- add { ((ICommunicationObject)this.channel).Faulted += value; }
- remove { ((ICommunicationObject)this.channel).Faulted -= value; }
- }
- event EventHandler ICommunicationObject.Opened
- {
- add { ((ICommunicationObject)this.channel).Opened += value; }
- remove { ((ICommunicationObject)this.channel).Opened -= value; }
- }
- event EventHandler ICommunicationObject.Opening
- {
- add { ((ICommunicationObject)this.channel).Opening += value; }
- remove { ((ICommunicationObject)this.channel).Opening -= value; }
- }
- void ICommunicationObject.Abort()
- {
- ((ICommunicationObject)this.channel).Abort();
- }
- void ICommunicationObject.Close()
- {
- ((ICommunicationObject)this.channel).Close();
- }
- void ICommunicationObject.Close(TimeSpan timeout)
- {
- ((ICommunicationObject)this.channel).Close(timeout);
- }
- IAsyncResult ICommunicationObject.BeginClose(AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this.channel).BeginClose(callback, state);
- }
- IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this.channel).BeginClose(timeout, callback, state);
- }
- void ICommunicationObject.EndClose(IAsyncResult result)
- {
- ((ICommunicationObject)this.channel).EndClose(result);
- }
- void ICommunicationObject.Open()
- {
- ((ICommunicationObject)this.channel).Open();
- }
- void ICommunicationObject.Open(TimeSpan timeout)
- {
- ((ICommunicationObject)this.channel).Open(timeout);
- }
- IAsyncResult ICommunicationObject.BeginOpen(AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this.channel).BeginOpen(callback, state);
- }
- IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return ((ICommunicationObject)this.channel).BeginOpen(timeout, callback, state);
- }
- void ICommunicationObject.EndOpen(IAsyncResult result)
- {
- ((ICommunicationObject)this.channel).EndOpen(result);
- }
- IExtensionCollection<IContextChannel> IExtensibleObject<IContextChannel>.Extensions
- {
- get { return ((IExtensibleObject<IContextChannel>)this.channel).Extensions; }
- }
- void IDisposable.Dispose()
- {
- ((IDisposable)this.channel).Dispose();
- }
- Uri IOutputChannel.Via
- {
- get { return ((IOutputChannel)this.channel).Via; }
- }
- EndpointAddress IOutputChannel.RemoteAddress
- {
- get { return ((IOutputChannel)this.channel).RemoteAddress; }
- }
- void IOutputChannel.Send(Message message)
- {
- ((IOutputChannel)this.channel).Send(message);
- }
- void IOutputChannel.Send(Message message, TimeSpan timeout)
- {
- ((IOutputChannel)this.channel).Send(message, timeout);
- }
- IAsyncResult IOutputChannel.BeginSend(Message message, AsyncCallback callback, object state)
- {
- return ((IOutputChannel)this.channel).BeginSend(message, callback, state);
- }
- IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state)
- {
- return ((IOutputChannel)this.channel).BeginSend(message, timeout, callback, state);
- }
- void IOutputChannel.EndSend(IAsyncResult result)
- {
- ((IOutputChannel)this.channel).EndSend(result);
- }
- Uri IRequestChannel.Via
- {
- get { return ((IRequestChannel)this.channel).Via; }
- }
- EndpointAddress IRequestChannel.RemoteAddress
- {
- get { return ((IRequestChannel)this.channel).RemoteAddress; }
- }
- Message IRequestChannel.Request(Message message)
- {
- return ((IRequestChannel)this.channel).Request(message);
- }
- Message IRequestChannel.Request(Message message, TimeSpan timeout)
- {
- return ((IRequestChannel)this.channel).Request(message, timeout);
- }
- IAsyncResult IRequestChannel.BeginRequest(Message message, AsyncCallback callback, object state)
- {
- return ((IRequestChannel)this.channel).BeginRequest(message, callback, state);
- }
- IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state)
- {
- return ((IRequestChannel)this.channel).BeginRequest(message, timeout, callback, state);
- }
- Message IRequestChannel.EndRequest(IAsyncResult result)
- {
- return ((IRequestChannel)this.channel).EndRequest(result);
- }
- ServiceChannel IChannelBaseProxy.GetServiceChannel()
- {
- return this.channel;
- }
- class MethodCallMessage : IMethodCallMessage
- {
- readonly object[] args;
- public MethodCallMessage(object[] args)
- {
- this.args = args;
- }
- public object[] Args
- {
- get { return this.args; }
- }
- public int ArgCount
- {
- get { return this.args.Length; }
- }
- public LogicalCallContext LogicalCallContext
- {
- get { return null; }
- }
- public object GetInArg(int argNum)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- public string GetInArgName(int index)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- public int InArgCount
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public object[] InArgs
- {
- get { return this.args; }
- }
- public object GetArg(int argNum)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- public string GetArgName(int index)
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- public bool HasVarArgs
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public Reflection.MethodBase MethodBase
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public string MethodName
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public object MethodSignature
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public string TypeName
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public string Uri
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- public Collections.IDictionary Properties
- {
- get
- {
- throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
- }
- }
- }
- }
- }
- }
|