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

C# Contexts.Context类代码示例

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

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



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

示例1: IsContextOK

 public override bool IsContextOK(Context ctx, System.Runtime.Remoting.Activation.IConstructionCallMessage ctorMsg)
 {
     InterceptProperty p = ctx.GetProperty("Intercept") as InterceptProperty;
     if (p == null)
         return false;
     return true;
 }
开发者ID:WrongDog,项目名称:Aspect,代码行数:7,代码来源:Intercept.cs


示例2: CreateProxy

	public virtual RealProxy CreateProxy(ObjRef objRef, Type serverType,
										 Object serverObject,
										 Context serverContext)
			{
				// TODO
				return null;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:ProxyAttribute.cs


示例3: TestDoCallback

		public void TestDoCallback ()
		{
			otherCtx = cbo.GetContext ();
			Assert.IsTrue (Thread.CurrentContext != otherCtx, "New context not created");
			
			otherCtx.DoCallBack (new CrossContextDelegate (DelegateTarget));
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:ContextTest.cs


示例4: IsNewContextOK

		public bool IsNewContextOK(Context newCtx)
		{
			var p = newCtx.GetProperty("Reporting") as ReportingProperty;
			if (p == null)
				return false;
			return true;
		}
开发者ID:kirkchen,项目名称:SpecFlow.Reporting,代码行数:7,代码来源:ReportingProperty.cs


示例5: CreateProxy

        [System.Security.SecurityCritical]  // auto-generated 
        public virtual RealProxy CreateProxy(ObjRef objRef,
                                             Type serverType, 
                                             Object serverObject,
                                             Context serverContext)
        {
            RemotingProxy rp =  new RemotingProxy(serverType); 

            // If this is a serverID, set the native context field in the TP 
            if (null != serverContext) 
            {
                RealProxy.SetStubData(rp, serverContext.InternalContextID); 
            }

            if (objRef != null && objRef.GetServerIdentity().IsAllocated)
            { 
                rp.SetSrvInfo(objRef.GetServerIdentity(), objRef.GetDomainID());
            } 
 
            // Set the flag indicating that the fields of the proxy
            // have been initialized 
            rp.Initialized = true;

            // Sanity check
            Type t = serverType; 
            if (!t.IsContextful &&
                !t.IsMarshalByRef && 
                (null != serverContext)) 
            {
                throw new RemotingException( 
                    Environment.GetResourceString(
                        "Remoting_Activation_MBR_ProxyAttribute"));
            }
 
            return rp;
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:36,代码来源:ProxyAttribute.cs


示例6: IsNewContextOK

 public bool IsNewContextOK(Context newCtx)
 {
     InterceptProperty p = newCtx.GetProperty("Intercept") as InterceptProperty;
     if(p == null)
         return false;
     return true;
 }
开发者ID:royosherove,项目名称:dotnet-test-extensions,代码行数:7,代码来源:InterceptProperty.cs


示例7: AsyncWorkItem

 internal AsyncWorkItem(IMessage reqMsg, IMessageSink replySink, Context oldCtx, ServerIdentity srvID)
 {
     this._reqMsg = reqMsg;
     this._replySink = replySink;
     this._oldCtx = oldCtx;
     this._callCtx = CallContext.GetLogicalCallContext();
     this._srvID = srvID;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AsyncWorkItem.cs


示例8: IsNewContextOK

        /// <summary>
        /// permet de vérifier que le context est ok apres son initialisation
        /// </summary>
        /// <param name="newCtx">le context qui vient d'etre créé</param>
        /// <returns>True : le contexte contient bien une propriété appelé "ValidationData". False sinon.</returns>
        public bool IsNewContextOK(Context newCtx)
        {
            DataValidationProperty prop=newCtx.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,代码行数:13,代码来源:DataValidationProperty.cs


示例9: AddDynamicProperty

 internal static bool AddDynamicProperty(Context ctx, IDynamicProperty prop)
 {
     if (ctx != null)
     {
         return ctx.AddPerContextDynamicProperty(prop);
     }
     return AddGlobalDynamicProperty(prop);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:Context.cs


示例10: 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


示例11: 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


示例12: CheckContext

		public SynchRes CheckContext (Context ctx)
		{
			object otherp = ctx.GetProperty ("Synchronization");
			object thisp = Thread.CurrentContext.GetProperty ("Synchronization");

			if (thisp == null) return SynchRes.NoSync;
			if (thisp == otherp) return SynchRes.SameSync;
			return SynchRes.NewSync;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:SynchronizationAttributeTest.cs


示例13: IsNewContextOK

 public bool IsNewContextOK(Context ctx)
 {
     AOPProperty newContextLogProperty = ctx.GetProperty("AOP") as AOPProperty;
     if (newContextLogProperty == null) {
         Debug.Assert(false);
         return false;
     }
     return (true);
 }
开发者ID:liaoyu45,项目名称:LYCodes,代码行数:9,代码来源:AOPProperty.cs


示例14: ProviderValidationProxy

        public ProviderValidationProxy(Type type, Type connectionType, bool schemaNameSupported)
            : base(type)
        {
            context = new Context();
            context.Freeze();

            this.connectionType = connectionType;
            this.schemaNameSupported = schemaNameSupported;
        }
开发者ID:svn2github,项目名称:ecm7migrator,代码行数:9,代码来源:ProviderValidationProxy.cs


示例15: 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


示例16: toIdle

        public static bool toIdle(Context context)
        {
            // check for parent modes

            MetaWatchService.WatchModes.IDLE = true;
            MetaWatchService.watchState = MetaWatchService.WatchStates.IDLE;

            sendLcdIdle();
            //Protocol.updateDisplay(0);

            return true;
        }
开发者ID:Reddds,项目名称:MetaWatchBluetoothClient,代码行数:12,代码来源:Idle.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: CreateProxy

		public override RealProxy CreateProxy(ObjRef objRef, Type serverType, Object serverObject, Context serverContext)
		{
			var proxy = new InterceptionRealProxy(serverType);

			if (serverContext != null)
			{
				RealProxy.SetStubData(proxy, serverContext);
			}

			if ((serverType.IsMarshalByRef == false) && (serverContext == null))
			{
				throw new RemotingException("Bad Type for CreateProxy");
			}

			return (proxy);
		}
开发者ID:rjperes,项目名称:DevelopmentWithADot.Interception,代码行数:16,代码来源:InterceptionProxyAttribute.cs


示例19: ServerIdentity

 internal ServerIdentity(MarshalByRefObject obj, Context serverCtx) : base(obj is ContextBoundObject)
 {
     if (obj != null)
     {
         if (!RemotingServices.IsTransparentProxy(obj))
         {
             this._srvType = obj.GetType();
         }
         else
         {
             this._srvType = RemotingServices.GetRealProxy(obj).GetProxiedType();
         }
     }
     this._srvCtx = serverCtx;
     this._serverObjectChain = null;
     this._stackBuilderSink = null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:ServerIdentity.cs


示例20: CreateProxy

 public virtual RealProxy CreateProxy(ObjRef objRef, Type serverType, object serverObject, Context serverContext)
 {
     RemotingProxy rp = new RemotingProxy(serverType);
     if (serverContext != null)
     {
         RealProxy.SetStubData(rp, serverContext.InternalContextID);
     }
     if ((objRef != null) && objRef.GetServerIdentity().IsAllocated)
     {
         rp.SetSrvInfo(objRef.GetServerIdentity(), objRef.GetDomainID());
     }
     rp.Initialized = true;
     Type type = serverType;
     if ((!type.IsContextful && !type.IsMarshalByRef) && (serverContext != null))
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Activation_MBR_ProxyAttribute"));
     }
     return rp;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:ProxyAttribute.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Messaging.Header类代码示例发布时间:2022-05-26
下一篇:
C# Tcp.TcpChannel类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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