Ejemplo n.º 1
0
 public void OnNewChannelConnection(
     IWTSVirtualChannel pChannel,
     [MarshalAs(UnmanagedType.BStr)] string data,
     [MarshalAs(UnmanagedType.Bool)] out bool pAccept,
     out IWTSVirtualChannelCallback pCallback)
 {
     pAccept   = true;
     pCallback = new DemoWtsChannelCallback(pChannel);
 }
            // Called from parent
            public void CloseWriteChannel()
            {
                if (NativeChannel == null)
                {
                    throw new ObjectDisposedException(nameof(NativeChannel));
                }

                NativeChannel.Close();
                NativeChannel = null;
            }
Ejemplo n.º 3
0
        // IWTSListenerCallback
        //
        public void OnNewChannelConnection(
            IWTSVirtualChannel pChannel,
            string data,
            out bool pbAccept,
            out IWTSVirtualChannelCallback ppCallback)
        {
            System.Diagnostics.Debug.WriteLine("[WTSPlugin1] WTSPlugin1.OnNewChannelConnection()");

            _channel = pChannel;

            pbAccept   = true;
            ppCallback = this;
        }
Ejemplo n.º 4
0
        // Called from COM
        void IWTSListenerCallback.OnNewChannelConnection(IWTSVirtualChannel pChannel,
                                                         [MarshalAs(UnmanagedType.BStr)] string data,
                                                         [MarshalAs(UnmanagedType.Bool)] out bool pAccept, out IWTSVirtualChannelCallback pCallback)
        {
            try
            {
                var channel = new DvcClientChannel(ChannelName, pChannel);
                AcceptChannel(channel);

                pAccept   = true;
                pCallback = channel.Proxy;
            }
            catch (Exception ex)
            {
                PluginApplication.Log($"Failure while creating client channel for '{ChannelName}': {ex}");

                pAccept   = false;
                pCallback = null;
            }
        }
 public DelegateWtsVirtualChannelCallback(IWTSVirtualChannel pChannel, DvcClientChannel parent)
 {
     this.NativeChannel = pChannel ?? throw new ArgumentNullException(nameof(pChannel));
     this.Parent        = parent ?? throw new ArgumentNullException(nameof(parent));
 }
 internal DvcClientChannel(string channelName, IWTSVirtualChannel callback)
 {
     this.ReadQueue   = new MessageQueue();
     this.ChannelName = channelName;
     this._Proxy      = new DelegateWtsVirtualChannelCallback(callback, this);
 }
Ejemplo n.º 7
0
        // IWTSListenerCallback
        //
        public void OnNewChannelConnection(
            IWTSVirtualChannel pChannel,
            string data,
            out bool pbAccept,
            out IWTSVirtualChannelCallback ppCallback)
        {
            System.Diagnostics.Debug.WriteLine("[WTSPlugin1] WTSPlugin1.OnNewChannelConnection()");

            pbAccept = true;
            ppCallback = this;
        }