예제 #1
0
        public NowKeyboard(NowSharee sharee)
            : base(NowKeyboard_New())
        {
            this.sharee = sharee;

            RegisterCallbacks();
        }
예제 #2
0
        private static int OnSurfaceListReqCallback(IntPtr context, IntPtr listReq)
        {
            NowSharee nowSharee = (NowSharee)context;

            if (nowSharee == null)
            {
                return(0);
            }

            return(1);
        }
예제 #3
0
        private static int OnVerifyCertificateCallback(IntPtr context, IntPtr cert, int result, int flags)
        {
            NowSharee nowSharee = (NowSharee)context;

            if (nowSharee == null)
            {
                return(0);
            }

            return(1);
        }
예제 #4
0
        private static int OnTerminatedCallback(IntPtr context, IntPtr sharee)
        {
            NowSharee nowSharee = (NowSharee)context;

            if (nowSharee == null)
            {
                return(0);
            }

            return(1);
        }
예제 #5
0
        private static int OnChannelCloseCallback(IntPtr context, string name, int id, IntPtr iface)
        {
            NowSharee sharee = (NowSharee)context;
            NowObject obj    = iface;

            if (obj != null && obj is NowChannel channel)
            {
                channel.Stop();
            }

            return(1);
        }
예제 #6
0
        private static int OnGraphicsUpdateCallback(IntPtr context, ref NativeNowUpdateGraphicsMsg graphics)
        {
            NowSharee nowSharee = (NowSharee)context;

            if (nowSharee == null)
            {
                return(0);
            }

            nowSharee.OnGraphicsUpdate?.Invoke(nowSharee, new NowGraphicsUpdateEventArgs(graphics));

            return(1);
        }
예제 #7
0
        private static int OnChannelOpenCallback(IntPtr context, string name, int id, IntPtr iface)
        {
            NowSharee  sharee  = (NowSharee)context;
            NowChannel channel = null;

            switch (name)
            {
            case "NowClipboard":
                channel = new NowClipboardChannel(iface);
                break;

            case "NowFileTransfer":
                channel = new NowFileTransferChannel(iface);
                break;

            case "NowExec":
                channel = new NowExecChannel(iface);
                break;
            }

            channel?.Start();

            return(1);
        }