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

C# Proxies.RealProxy类代码示例

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

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



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

示例1: ServicedComponentMarshaler

 protected ServicedComponentMarshaler(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     byte[] buffer = null;
     Type type = null;
     bool flag = false;
     ComponentServices.InitializeRemotingChannels();
     SerializationInfoEnumerator enumerator = info.GetEnumerator();
     while (enumerator.MoveNext())
     {
         if (enumerator.Name.Equals("servertype"))
         {
             type = (Type) enumerator.Value;
         }
         else
         {
             if (enumerator.Name.Equals("dcomInfo"))
             {
                 buffer = (byte[]) enumerator.Value;
                 continue;
             }
             if (enumerator.Name.Equals("fIsMarshalled"))
             {
                 int num = 0;
                 object obj2 = enumerator.Value;
                 if (obj2.GetType() == typeof(string))
                 {
                     num = ((IConvertible) obj2).ToInt32(null);
                 }
                 else
                 {
                     num = (int) obj2;
                 }
                 if (num == 0)
                 {
                     flag = true;
                 }
             }
         }
     }
     if (!flag)
     {
         this._marshalled = true;
     }
     this._um = new SCUnMarshaler(type, buffer);
     this._rt = type;
     if (base.IsFromThisProcess() && !ServicedComponentInfo.IsTypeEventSource(type))
     {
         this._rp = RemotingServices.GetRealProxy(base.GetRealObject(context));
     }
     else
     {
         if (ServicedComponentInfo.IsTypeEventSource(type))
         {
             this.TypeInfo = new SCMTypeName(type);
         }
         object realObject = base.GetRealObject(context);
         this._rp = RemotingServices.GetRealProxy(realObject);
     }
     this._um.Dispose();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:60,代码来源:ServicedComponentMarshaler.cs


示例2: RedirectionProxy

 internal RedirectionProxy(MarshalByRefObject proxy, Type serverType)
 {
     _proxy = proxy;
     _realProxy = RemotingServices.GetRealProxy(_proxy);
     _serverType = serverType;
     _objectMode = WellKnownObjectMode.Singleton;
 } // RedirectionProxy
开发者ID:ArildF,项目名称:masters,代码行数:7,代码来源:redirectionproxy.cs


示例3: GetRealProxy

 internal RealProxy GetRealProxy()
 {
     if ((this._rp == null) && !this._fUnMarshaled)
     {
         this._rp = this.UnmarshalRemoteReference();
     }
     return this._rp;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SCUnMarshaler.cs


示例4: SwitchWrappers

 public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp)
 {
     object transparentProxy = oldcp.GetTransparentProxy();
     object tp = newcp.GetTransparentProxy();
     RemotingServices.GetServerContextForProxy(transparentProxy);
     RemotingServices.GetServerContextForProxy(tp);
     Marshal.InternalSwitchCCW(transparentProxy, tp);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:EnterpriseServicesHelper.cs


示例5: RemotingInvocation

        public RemotingInvocation(RealProxy proxy, IMethodCallMessage message)
        {
            this.message = message;
            this.proxy = proxy;

            arguments = message.Args;
            if (arguments == null)
                arguments = new object[0];
        }
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:9,代码来源:RemotingInvocation.cs


示例6: NeverCallThis

        private IntPtr _stub;           // Unmanaged code that decides whether to short circuit calls or not
     
 		// This method should never be called.  Its sole purpose is to shut up the compiler
		//	because it warns about private fields that are never used.  Most of these fields
		//	are used in unmanaged code.
#if _DEBUG
		private int NeverCallThis()
		{
			BCLDebug.Assert(false,"NeverCallThis");
			_rp = null;
			_pMT = new IntPtr(RemotingServices.TrashMemory);
			_pInterfaceMT = new IntPtr(RemotingServices.TrashMemory);
            _stub = new IntPtr(RemotingServices.TrashMemory);
			RealProxy rp = _rp;
			return _pInterfaceMT.ToInt32();
		}
开发者ID:ArildF,项目名称:masters,代码行数:16,代码来源:__transparentproxy.cs


示例7: InvokeRealProxy

		private static void InvokeRealProxy(RealProxy realProxy, WcfInvocation wcfInvocation)
		{
			var message = new MethodCallMessage(wcfInvocation.Method, wcfInvocation.Arguments);
			var returnMessage = (IMethodReturnMessage)realProxy.Invoke(message);
			if (returnMessage.Exception != null)
			{
				throw returnMessage.Exception;
			}
			wcfInvocation.ReturnValue = returnMessage.ReturnValue;
		}
开发者ID:rtr0mdrn,项目名称:Windsor,代码行数:10,代码来源:WcfRemotingInterceptor.cs


示例8: ObjectCall

 public ObjectCall(
     RealProxy proxy,
     IMessage callMessage,
     Action<IConstructionCallMessage> validationOnInit = null,
     Action<IMethodCallMessage> validationOnAction = null)
 {
     this.proxy = proxy;
     this.callMessage = callMessage;
     this.validationOnInit = validationOnInit;
     this.validationOnAction = validationOnAction;
 }
开发者ID:svn2github,项目名称:ecm7migrator,代码行数:11,代码来源:ObjectCall.cs


示例9: SwitchWrappers

        [System.Security.SecurityCritical]  // auto-generated_required
        public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp)
        {
            Object oldtp = oldcp.GetTransparentProxy(); 
            Object newtp = newcp.GetTransparentProxy();
 
            IntPtr oldcontextId = RemotingServices.GetServerContextForProxy(oldtp); 
            IntPtr newcontextId = RemotingServices.GetServerContextForProxy(newtp);
 
            // switch the CCW from oldtp to new tp
            Marshal.InternalSwitchCCW(oldtp, newtp);
        }
开发者ID:wsky,项目名称:System.Runtime.Remoting,代码行数:12,代码来源:EnterpriseServicesHelper.cs


示例10: InvokeRealProxy

		private static void InvokeRealProxy(RealProxy realProxy, WcfInvocation wcfInvocation)
		{
			var message = new MethodCallMessage(wcfInvocation.Method, wcfInvocation.Arguments);
			var returnMessage = (IMethodReturnMessage)realProxy.Invoke(message);
			if (returnMessage.Exception != null)
			{
				var exception = ExceptionHelper.PreserveStackTrace(returnMessage.Exception);
				throw exception;
			}
			wcfInvocation.ReturnValue = returnMessage.ReturnValue;
		}
开发者ID:castleproject,项目名称:Windsor,代码行数:11,代码来源:WcfRemotingInterceptor.cs


示例11: CreateTransparentProxy

 internal static extern Object CreateTransparentProxy( 
                                     RealProxy rp, 
                                     RuntimeType typeToProxy,
                                     IntPtr stub, 
                                     Object stubData);
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:RemotingServices.cs


示例12: ProxyCheckCast

 [System.Security.SecurityCritical]  // auto-generated
 internal static bool ProxyCheckCast(RealProxy rp, RuntimeType castType)
 {
     return CheckCast(rp, castType); 
 } // ProxyCheckCast
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:RemotingServices.cs


示例13: CheckCast

        [System.Security.SecurityCritical]  // auto-generated 
        private static bool CheckCast(RealProxy rp, RuntimeType castType)
        { 
            // NOTE: This is the point where JIT_CheckCastClass ultimately 
            // lands up in the managed world if the object being cast is
            // a transparent proxy. 
            // If we are here, it means that walking the current EEClass
            // up the chain inside the EE was unable to verify the cast.

            Message.DebugOut("Entered CheckCast for type " + castType); 
            bool fCastOK = false;
 
            BCLDebug.Assert(rp != null, "Shouldn't be called with null real proxy."); 

            // Always return true if cast is to System.Object 
            if (castType == typeof(Object))
                return true;

            // We do not allow casting to non-interface types that do not extend 
            // from System.MarshalByRefObject
            if (!castType.IsInterface && !castType.IsMarshalByRef) 
                return false; 

            // Note: this is a bit of a hack to allow deserialization of WellKnown 
            // object refs (in the well known cases, we always return TRUE for
            // interface casts but doing so messes us up in the case when
            // the object manager is trying to resolve object references since
            // it ends up thinking that the proxy we returned needs to be resolved 
            // further).
            if (castType != typeof(IObjectReference)) 
            { 
                IRemotingTypeInfo typeInfo = rp as IRemotingTypeInfo;
                if(null != typeInfo) 
                {
                    fCastOK = typeInfo.CanCastTo(castType, rp.GetTransparentProxy());
                }
                else 
                {
                    // The proxy does not implement IRemotingTypeInfo, so we should 
                    //   try to do casting based on the ObjRef type info. 
                    Identity id = rp.IdentityObject;
                    if (id != null) 
                    {
                        ObjRef objRef = id.ObjectRef;
                        if (objRef != null)
                        { 
                            typeInfo = objRef.TypeInfo;
                            if (typeInfo != null) 
                            { 
                                fCastOK = typeInfo.CanCastTo(castType, rp.GetTransparentProxy());
                            } 
                        }
                    }
                }
            } 

            Message.DebugOut("CheckCast returning " + fCastOK); 
            return fCastOK; 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:59,代码来源:RemotingServices.cs


示例14: GetStubData

 public static extern Object GetStubData(RealProxy rp); 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:1,代码来源:RealProxy.cs


示例15: SetStubData

 public static extern void SetStubData(RealProxy rp, Object stubData);
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:1,代码来源:RealProxy.cs


示例16: RemotingIntermediary

 internal RemotingIntermediary(RealProxy pxy) : base(pxy.GetProxiedType())
 {
     this._pxy = pxy;
     this._blind = new BlindMBRO((MarshalByRefObject) this.GetTransparentProxy());
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:RemotingIntermediary.cs


示例17: SetStubData

	// Set the stub data for a particular proxy.
	public static void SetStubData(RealProxy rp, Object stubData)
			{
				if(rp != null)
				{
					rp.stubData = stubData;
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:RealProxy.cs


示例18: SetStubData

		public static void SetStubData (RealProxy rp, object stubData)
		{
			rp._stubData = stubData;
		}
开发者ID:ngraziano,项目名称:mono,代码行数:4,代码来源:RealProxy.cs


示例19: ProxyCheckCast

		internal static bool ProxyCheckCast (RealProxy rp, RuntimeType castType)
		{
			// TODO: What should it do?
			return true;
		}
开发者ID:REALTOBIZ,项目名称:mono,代码行数:5,代码来源:RemotingServices.cs


示例20: MbrObject

 internal MbrObject(RealProxy proxy, System.Type targetType)
 {
     this.proxy = proxy;
     this.targetType = targetType;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:ServiceChannelProxy.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Serialization.DataContract类代码示例发布时间:2022-05-26
下一篇:
C# Messaging.ReturnMessage类代码示例发布时间: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