Пример #1
0
        //Открыть периодический поток
        public PeriodicThread OpenPeriodicThread(int id, string name, double periodMinutes, double lateMainutes = 0)
        {
            var t = new PeriodicThread(this, id, name, new AppIndicator(), periodMinutes, lateMainutes);

            Threads.Add(id, t, true);
            return(t);
        }
Пример #2
0
        public void StartInvalidArgumentTest()
        {
            var t = new PeriodicThread();

            Assert.Throws <ArgumentNullException>(() => t.Start(null, () => 0, false));
            Assert.Throws <ArgumentNullException>(() => t.Start(() => { }, null, false));
        }
Пример #3
0
        private ResponseType HandleResponse(PeriodicThread requester = null)
        {
            var command = (ResponseType)this.c.ReceiveByte();

            switch (command)
            {
            case ResponseType.FramebufferUpdate:
                requester?.Signal();
                if (!this.HandleFramebufferUpdate())
                {
                    command = ResponseType.DesktopSize;
                }

                break;

            case ResponseType.SetColorMapEntries:
                this.HandleSetColorMapEntries();
                break;

            case ResponseType.Bell:
                this.HandleBell();
                break;

            case ResponseType.ReceiveClipboardData:
                this.HandleReceiveClipboardData();
                break;

            default:
                VncStream.Require(
                    false,
                    "Unsupported command.",
                    VncFailureReason.UnrecognizedProtocolElement);
                break;
            }

            return(command);
        }
Пример #4
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PeriodicThread obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }