Esempio n. 1
0
        public TWindowState(TreeNode argsTree)
        {
            var valueList = argsTree.ValueList;
            var nodes     = argsTree.Nodes;

            if (nodes.Count == 2 && valueList.Count == 7)
            {
                this.Id     = new WinId(nodes[0]);
                this.ZAfter = new WinId(nodes[1]);

                this.Kind = (SubSystemKind)int.Parse(valueList[0]);

                this.State       = IntParser.Parse <uint>(valueList[1]);
                this.StateChange = IntParser.Parse <uint>(valueList[2]);

                this.x = int.Parse(valueList[3]);
                this.y = int.Parse(valueList[4]);
                this.w = int.Parse(valueList[5]);
                this.h = int.Parse(valueList[6]);
            }
            else
            {
                throw new ArgumentException("argsTree");
            }
        }
Esempio n. 2
0
        public async Task <bool> SetAutoDetectTiming(WinId winId, bool enable)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "SetAutoDetectTiming", winId, enable ? 1 : 0);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();
            return(response.Success);
        }
Esempio n. 3
0
        public async Task <bool> Freeze(WinId winId)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "Freeze", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();
            return(response.Success);
        }
Esempio n. 4
0
        public async Task <string> GrabImage(WinId winId)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "GrabImage", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();
            return(response.ValueList.Replace("\"", ""));
        }
Esempio n. 5
0
        public async Task <bool> SetChannel(WinId winId, int chNumber)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "SetChannel", winId, chNumber);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            return(response.Success);
        }
Esempio n. 6
0
        public async Task <bool> SelectInput(WinId winId, string inputName)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "SelectInput", winId, inputName);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            return(response.Success);
        }
Esempio n. 7
0
        public async Task <string> GetInput(WinId winId)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "GetInput", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            return(response.ValueList);
        }
Esempio n. 8
0
        public async Task <int> GetChannel(WinId winId)
        {
            ThrowIfClientNotReady();
            var request  = new CPRequest(ObjectName, "GetChannel", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            int chNumber = int.Parse(response.ValueList);

            return(chNumber);
        }
Esempio n. 9
0
        public async Task <CPRGBTiming> DetectTiming(WinId winId)
        {   // неработает
            // { 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 } <- сервер возвращает такую хрень...
            // вместо 12 аргументов - 15
            ThrowIfClientNotReady();

            var request  = new CPRequest(ObjectName, "DetectTiming", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            var data = response.ValueList;

            return(new CPRGBTiming(data));
        }
Esempio n. 10
0
        public async Task <PrevImage> GetPreview(WinId winId)
        {        // недокументированный метод...
            // судя повсему используется для получения эскизов форм в ContorlPoint-е
            //= 00000000 128 96DLE...

            ThrowIfClientNotReady();

            var request  = new CPRequest(ObjectName, "GetPreview", winId);
            var response = await client.SendAsync(request) as CPResponse;

            response.ThrowIfError();

            //=00000000 128 96DLE...
            return(response.Success ? new PrevImage(response.ValueList): null);
        }