Exemplo n.º 1
0
        public override void ParseData(string command)
        {
            var jObject = JObject.Parse(command);

            if (jObject[LeftChannel] != null)
            {
                StatusLeft = jObject[LeftChannel].Value <string>();
                if (StatusLeft == "click")
                {
                    OnLeftClick?.Invoke(this, new WallSwitchEventArgs(StatusLeft));
                }
                else if (StatusLeft == "double_click")
                {
                    OnLeftDoubleClick?.Invoke(this, new WallSwitchEventArgs(StatusLeft));
                }
                else if (StatusLeft == "long_click")
                {
                    OnLeftLongClick?.Invoke(this, new WallSwitchEventArgs(StatusLeft));
                }
            }

            if (jObject[RightChannel] != null)
            {
                StatusRight = jObject[RightChannel].Value <string>();
                if (StatusRight == "click")
                {
                    OnRightClick?.Invoke(this, new WallSwitchEventArgs(StatusRight));
                }
                else if (StatusRight == "double_click")
                {
                    OnRightDoubleClick?.Invoke(this, new WallSwitchEventArgs(StatusRight));
                }
                else if (StatusRight == "long_click")
                {
                    OnRightLongClick?.Invoke(this, new WallSwitchEventArgs(StatusRight));
                }
            }
        }
Exemplo n.º 2
0
        public override void ParseData(string command)
        {
            var jObject = JObject.Parse(command);

            if (jObject[LeftChannel] != null)
            {
                if (jObject[LeftChannel].Value <string>() == "click")
                {
                    OnLeftClick?.Invoke(new EventArgs());
                }
                else if (jObject[LeftChannel].Value <string>() == "double_click")
                {
                    OnLeftDoubleClick?.Invoke(new EventArgs());
                }
                else if (jObject[LeftChannel].Value <string>() == "long_click")
                {
                    OnLeftLongClick?.Invoke(new EventArgs());
                }
            }

            if (jObject[RightChannel] != null)
            {
                if (jObject[RightChannel].Value <string>() == "click")
                {
                    OnRightClick?.Invoke(new EventArgs());
                }
                else if (jObject[RightChannel].Value <string>() == "double_click")
                {
                    OnRightDoubleClick?.Invoke(new EventArgs());
                }
                else if (jObject[RightChannel].Value <string>() == "long_click")
                {
                    OnRightLongClick?.Invoke(new EventArgs());
                }
            }
        }
Exemplo n.º 3
0
 public virtual void RightDoubleClick(UIMouseEvent evt)
 {
     OnRightDoubleClick?.Invoke(evt, this);
     Parent?.RightDoubleClick(evt);
 }
Exemplo n.º 4
0
 public virtual void RightDoubleClick(UIMouseEventArgs e)
 {
     OnRightDoubleClick?.Invoke(this, e);
     Parent?.RightDoubleClick(e);
 }