Used by CpProxy to represent a service offered by a remote device. Only intended for use by auto-generated proxies.
Ejemplo n.º 1
0
 protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
 {
     IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain);
     IntPtr name = InteropUtils.StringToHGlobalUtf8(aName);
     iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
     Marshal.FreeHGlobal(domain);
     Marshal.FreeHGlobal(name);
     IntPtr serviceHandle = CpProxyService(iHandle);
     iService = new CpService(serviceHandle);
     iGchProxy = GCHandle.Alloc(this);
     iSubscriptionStatusLock = new Mutex();
 }
Ejemplo n.º 2
0
 protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
 {
     char* domain = (char*)Marshal.StringToHGlobalAnsi(aDomain);
     char* name = (char*)Marshal.StringToHGlobalAnsi(aName);
     iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
     Marshal.FreeHGlobal((IntPtr)domain);
     Marshal.FreeHGlobal((IntPtr)name);
     IntPtr serviceHandle = CpProxyService(iHandle);
     iService = new CpService(serviceHandle);
     iGchProxy = GCHandle.Alloc(this);
     iSubscriptionStatusLock = new Mutex();
 }
Ejemplo n.º 3
0
        protected CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
        {
            IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain);
            IntPtr name   = InteropUtils.StringToHGlobalUtf8(aName);

            iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
            Marshal.FreeHGlobal(domain);
            Marshal.FreeHGlobal(name);
            IntPtr serviceHandle = CpProxyService(iHandle);

            iService  = new CpService(serviceHandle);
            iGchProxy = GCHandle.Alloc(this);
            iSubscriptionStatusLock = new Mutex();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor.  Not intended for external use (use CpService.Invocation instead)
        /// </summary>
        /// <param name="aService">Service the action is being invoked on</param>
        /// <param name="aAction">Handle to the action being invoked</param>
        /// <param name="aCallback">Callback to run when the action completes</param>
        internal Invocation(CpService aService, IntPtr aAction, CpProxy.CallbackAsyncComplete aCallback)
        {
            iService    = aService;
            iInputArgs  = new List <Argument>();
            iOutputArgs = new List <Argument>();
            GCHandle gch = GCHandle.Alloc(this); /* no need to store gch as a member as AsyncComplete is guaranteed
                                                  * to be called, even in error cases */

            iAsyncComplete         = aCallback;
            iCallbackAsyncComplete = new CpProxy.CallbackActionComplete(AsyncComplete);
            IntPtr ptr = GCHandle.ToIntPtr(gch);

            iHandle = CpServiceInvocation(aService.Handle(), aAction, iCallbackAsyncComplete, ptr);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructor.  Not intended for external use (use CpService.Invocation instead)
 /// </summary>
 /// <param name="aService">Service the action is being invoked on</param>
 /// <param name="aAction">Handle to the action being invoked</param>
 /// <param name="aCallback">Callback to run when the action completes</param>
 internal Invocation(CpService aService, IntPtr aAction, CpProxy.CallbackAsyncComplete aCallback)
 {
     iService = aService;
     iInputArgs = new List<Argument>();
     iOutputArgs = new List<Argument>();
     GCHandle gch = GCHandle.Alloc(this); /* no need to store gch as a member as AsyncComplete is guaranteed
                                             to be called, even in error cases */
     iAsyncComplete = aCallback;
     iCallbackAsyncComplete = new CpProxy.CallbackActionComplete(AsyncComplete);
     IntPtr ptr = GCHandle.ToIntPtr(gch);
     iHandle = CpServiceInvocation(aService.Handle(), aAction, iCallbackAsyncComplete, ptr);
 }