当前位置: 首页>>代码示例>>C#>>正文


C# IConstructionCallMessage类代码示例

本文整理汇总了C#中IConstructionCallMessage的典型用法代码示例。如果您正苦于以下问题:C# IConstructionCallMessage类的具体用法?C# IConstructionCallMessage怎么用?C# IConstructionCallMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IConstructionCallMessage类属于命名空间,在下文中一共展示了IConstructionCallMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPropertiesForNewContext

 public virtual void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
 {
     for (int i = 0; i < this._cp.Count; i++)
     {
         ctorMsg.ContextProperties.Add(this._cp[i]);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:RemotePropertyHolderAttribute.cs

示例2: GetPropertiesForNewContext

 public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
 {
     if (ctorMsg.Properties.Contains("Remote"))
     {
         string remActivatorURL = (string) ctorMsg.Properties["Remote"];
         AppDomainLevelActivator activator = new AppDomainLevelActivator(remActivatorURL);
         IActivator nextActivator = ctorMsg.Activator;
         if (nextActivator.Level < ActivatorLevel.AppDomain)
         {
             activator.NextActivator = nextActivator;
             ctorMsg.Activator = activator;
         }
         else if (nextActivator.NextActivator != null)
         {
             while (nextActivator.NextActivator.Level >= ActivatorLevel.AppDomain)
             {
                 nextActivator = nextActivator.NextActivator;
             }
             activator.NextActivator = nextActivator.NextActivator;
             nextActivator.NextActivator = activator;
         }
         else
         {
             nextActivator.NextActivator = activator;
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:LocalActivator.cs

示例3: GetPropertiesForNewContext

		/// <summary>
		/// Adds the current context property to the given message.
		/// </summary>
		/// <param name="ctorMsg">The <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage"/> to which to add the context property.</param>
		/// <exception cref="T:System.ArgumentNullException">
		/// The <paramref name="ctorMsg"/> parameter is null.
		/// </exception>
		/// <PermissionSet>
		/// 	<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure"/>
		/// </PermissionSet>
		public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
		{
			if (AspectConfiguration.Instance.Enabled)
			{
				ctorMsg.ContextProperties.Add(new AspectProperty());
			}
		}
开发者ID:treytomes,项目名称:ILExperiments,代码行数:17,代码来源:AspectObjectAttribute.cs

示例4: Activate

		public IConstructionReturnMessage Activate (IConstructionCallMessage ctorCall)
		{
			IConstructionReturnMessage response;

			// Create the object by calling the remote activation service

			IActivator remoteActivator = (IActivator) RemotingServices.Connect (typeof (IActivator), _activationUrl);
			ctorCall.Activator = ctorCall.Activator.NextActivator;

			try
			{
				response = remoteActivator.Activate (ctorCall);
			}
			catch (Exception ex)
			{
				return new ConstructionResponse (ex, ctorCall);
			}

			// Create the client identity for the remote object

			ObjRef objRef = (ObjRef) response.ReturnValue;
			if (RemotingServices.GetIdentityForUri (objRef.URI) != null)
				throw new RemotingException("Inconsistent state during activation; there may be two proxies for the same object");

			object proxy;
			
			// We pass null for proxyType because we don't really to attach the identity
			// to a proxy, we already have one.
			Identity identity = RemotingServices.GetOrCreateClientIdentity (objRef, null, out proxy);
			RemotingServices.SetMessageTargetIdentity (ctorCall, identity);
			return response;
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:32,代码来源:AppDomainLevelActivator.cs

示例5: Activate

 internal static IConstructionReturnMessage Activate(RemotingProxy remProxy, IConstructionCallMessage ctorMsg)
 {
     IConstructionReturnMessage message = null;
     if (((ConstructorCallMessage) ctorMsg).ActivateInContext)
     {
         message = ctorMsg.Activator.Activate(ctorMsg);
         if (message.Exception != null)
         {
             throw message.Exception;
         }
         return message;
     }
     GetPropertiesFromAttributes(ctorMsg, ctorMsg.CallSiteActivationAttributes);
     GetPropertiesFromAttributes(ctorMsg, ((ConstructorCallMessage) ctorMsg).GetWOMAttributes());
     GetPropertiesFromAttributes(ctorMsg, ((ConstructorCallMessage) ctorMsg).GetTypeAttributes());
     IMethodReturnMessage message2 = (IMethodReturnMessage) Thread.CurrentContext.GetClientContextChain().SyncProcessMessage(ctorMsg);
     message = message2 as IConstructionReturnMessage;
     if (message2 == null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Activation_Failed"));
     }
     if (message2.Exception != null)
     {
         throw message2.Exception;
     }
     return message;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:ActivationServices.cs

示例6: GetPropertiesForNewContext

		public void GetPropertiesForNewContext(IConstructionCallMessage ctor)
		{
			if (_contextProperties != null)
			{
				foreach (object prop in _contextProperties)
					ctor.ContextProperties.Add (prop);
			}
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:8,代码来源:RemoteActivationAttribute.cs

示例7: GetPropertiesForNewContext

        public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
        {
            if (ctorMsg == null)
                throw new ArgumentNullException("ctorMsg");

            IContextProperty cachedProperty = new CachedContextProperty();
            ctorMsg.ContextProperties.Add(cachedProperty);
        }
开发者ID:jeremysimmons,项目名称:sixpack-library,代码行数:8,代码来源:CachedAttribute.cs

示例8: GetPropertiesForNewContext

 public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
 {
     // We are not interested in contributing any properties to the
     // new context since the only purpose of this property is to force
     // the creation of the context and the server object inside it at
     // the specified URL.
     return;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:URLAttribute.cs

示例9: ArgumentNullException

	// Get the properties for a new construction context.
	public virtual void GetPropertiesForNewContext
				(IConstructionCallMessage ctorMsg)
			{
				if(ctorMsg == null)
				{
					throw new ArgumentNullException("ctorMsg");
				}
				ctorMsg.ContextProperties.Add(this);
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:ContextAttribute.cs

示例10: GetMethodBase

 private static MethodBase GetMethodBase(IConstructionCallMessage msg)
 {
     MethodBase methodBase = msg.MethodBase;
     if (null == methodBase)
     {
         throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Message_MethodMissing"), new object[] { msg.MethodName, msg.TypeName }));
     }
     return methodBase;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:LocalActivator.cs

示例11: IsContextOK

 public override bool IsContextOK(Context ctx, IConstructionCallMessage ctorMsg)
 {
     var p = ctx.GetProperty("Reporting") as ReportingProperty;
     if (p == null)
     {
         return false;
     }
     return true;
 }
开发者ID:shuai-zh,项目名称:SpecResults,代码行数:9,代码来源:ReportingAttribute.cs

示例12: IsContextOK

        //Le runtime .NET interroge pour savoir si le contexte courant est valide.
        //Si cette fonction false, le runtime créé un nouveau contexte et appelle GetPropertiesForNewContext()
        // pour vérifier si le context est valid, on vérifie la présence (et la validité si besoin) d'un propriété
        public override bool IsContextOK(Context ctx,IConstructionCallMessage ctorMsg)
        {
            //return false;	// Seulement si vous souhaitez un contexte par instance !
            DataValidationProperty prop=ctx.GetProperty("DataValidation") as DataValidationProperty;
            if (prop!=null)	// on a une propriété appelé ValidationData dans le contexte ?
                return true;	// Oui -> on accepte le contexte

            return false;	// Non -> on refuse le contexte
        }
开发者ID:flyingoverclouds,项目名称:sfinx,代码行数:12,代码来源:DataValidationAttribute.cs

示例13: RemoteActivate

		public static IMessage RemoteActivate (IConstructionCallMessage ctorCall)
		{
			try 
			{
				return ctorCall.Activator.Activate (ctorCall);
			}
			catch (Exception ex) 
			{
				return new ReturnMessage (ex, ctorCall);
			}		
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:11,代码来源:ActivationServices.cs

示例14: CreateConstructionReturnMessage

        public static IConstructionReturnMessage CreateConstructionReturnMessage(IConstructionCallMessage ctorMsg, MarshalByRefObject retObj) 
        {
            IConstructionReturnMessage ctorRetMsg = null; 

            // Create the return message
            ctorRetMsg = new ConstructorReturnMessage(retObj, null, 0, null, ctorMsg);
 
            // NOTE: WE ALLOW ONLY DEFAULT CTORs on SERVICEDCOMPONENTS
 
            return ctorRetMsg; 
        }
开发者ID:wsky,项目名称:System.Runtime.Remoting,代码行数:11,代码来源:EnterpriseServicesHelper.cs

示例15: GetPropertiesForNewContext

        public override void GetPropertiesForNewContext(IConstructionCallMessage msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("msg");
            }

            msg.ContextProperties.Add(new CoreTestProperty<TestTimerAspect>());
            msg.ContextProperties.Add(new CoreTestProperty<TestTransactionAspect>());
            msg.ContextProperties.Add(new CoreTestProperty<ExpectedExceptionMessageAspect>());
        }
开发者ID:StealFocus,项目名称:Core,代码行数:11,代码来源:CoreTestAttribute.cs


注:本文中的IConstructionCallMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。