• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IConstructionCallMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: IsContextOK

		public override bool IsContextOK (Context ctx, IConstructionCallMessage msg)
		{
			SyncContext sctx = SyncContext.GetContext ();
			if (sctx == null || (sctx.GetType() != contextType)) {
				syncContext = (SyncContext) Activator.CreateInstance (contextType);
				return false;
			}
			else {
				syncContext = sctx;
				return true;
			}
		}
开发者ID:KseniaVensko,项目名称:gap-develop,代码行数:12,代码来源:SyncContextAttribute.cs


示例17: IsContextOK

        //Le runtime .NET interroge l'attribut pour savoir si le contexte courant est valide.
        //Si cette fonction renvoi 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'une propriété
        public override bool IsContextOK(Context ctx,IConstructionCallMessage ctorMsg)
        {
            //le return false permet de forcer systématiquement un nouveau contexte pour chaqueinstance
            // utilise si une instance d'un type créé des instance de ce meme type : vous pouvez intercepter
            // les appels entre instance d'un meme type ( car il y aura changement de contexte )
            //return false;

            InterceptionAppelProperty prop=ctx.GetProperty("InterceptionAppelProperty") as InterceptionAppelProperty;
            if (prop!=null)	// on a une propriété appelé InterceptionAppelProperty dans le contexte ?
                return true;	// Oui -> on accepte le contexte

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


示例18: Activate

		public IConstructionReturnMessage Activate (IConstructionCallMessage msg)
		{
			if (!RemotingConfiguration.IsActivationAllowed (msg.ActivationType))
				throw new RemotingException ("The type " + msg.ActivationTypeName + " is not allowed to be client activated");

			object[] activationAttributes = new object[] { new RemoteActivationAttribute (msg.ContextProperties) };
			MarshalByRefObject newObject = (MarshalByRefObject) Activator.CreateInstance (msg.ActivationType, msg.Args, activationAttributes);

			// The activator must return a ConstructionResponse with an ObjRef as return value.
			// It avoids the automatic creation of a proxy in the client.

			ObjRef objref = RemotingServices.Marshal (newObject);
			return new ConstructionResponse (objref, null, msg);
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:14,代码来源:RemoteActivator.cs


示例19: DoRemoteActivation

 internal static IConstructionReturnMessage DoRemoteActivation(IConstructionCallMessage ctorMsg)
 {
     IActivator activator = null;
     string url = (string) ctorMsg.Properties["Remote"];
     try
     {
         activator = (IActivator) RemotingServices.Connect(typeof(IActivator), url);
     }
     catch (Exception exception)
     {
         throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Activation_ConnectFailed"), new object[] { exception }));
     }
     ctorMsg.Properties.Remove("Remote");
     return activator.Activate(ctorMsg);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:LocalActivator.cs


示例20: ConnectionTypeValidation

 /// <summary>
 /// Проверка типа подключения при создании объекта
 /// </summary>
 /// <param name="msg">Дескриптор конструктора объекта</param>
 private void ConnectionTypeValidation(IConstructionCallMessage msg)
 {
     if (msg.ArgCount > 0)
     {
         foreach (var arg in msg.Args)
         {
             if (arg is IDbConnection)
             {
                 Type type = arg.GetType();
                 Require.That(connectionType.IsAssignableFrom(type),
                     "Данный провайдер использует подключения типа [{0}]. При инициализации провайдера было указано подключение типа [{1}]", connectionType.FullName, type.FullName);
             }
         }
     }
 }
开发者ID:svn2github,项目名称:ecm7migrator,代码行数:19,代码来源:ProviderValidationProxy.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IConstructor类代码示例发布时间:2022-05-24
下一篇:
C# IConstraint类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap