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


C# Contexts.Context类代码示例

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


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


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