Ejemplo n.º 1
0
        void OnSend()
        {
#if UNITY_EDITOR || UNITY_STANDALONE
            onSend.Invoke(inputEditor.text);
            _message = string.Empty;
#else
            string messageText = string.Empty;
            if (!string.IsNullOrEmpty(_message) && !_message.Equals(_placeholderText))
            {
                onSend.Invoke(_message);
                inputMobile.text = _placeholderText;
                _message         = string.Empty;
                ChangeInputFieldColorAlpha(false);
            }
#endif
        }
Ejemplo n.º 2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            var mouse = (MouseEventArgs)e;
            //label1.Text=mouse.Location.ToString();
            var          x   = mouse.Location.X / width;
            var          y   = (mouse.Location.Y - yoffset) / height;
            const string bs  = "000";
            var          str = bs + x + bs + y;

            vcode += str;

            pick[ClickCount] = new System.Drawing.Bitmap(width - xoffset, height);
            var       pickedG = System.Drawing.Graphics.FromImage(pick[ClickCount]);
            Rectangle from    = new Rectangle(x * width + xoffset, y * height + yoffset, width - xoffset, height);
            Rectangle to      = new Rectangle(0, 0, width - xoffset, height);

            pickedG.DrawImage(pictureBox1.Image, to, from, GraphicsUnit.Pixel);
            picture[ClickCount].Image = pick[ClickCount];
            CanClick = picture[ClickCount];
            ClickCount++;
            if (ClickCount == 4)
            {
                /*for(int i=0;i<4;i++)
                 * {
                 *  string s = i + ".png";
                 *  pick[i].Save(s);
                 * }*/
                SendEvent?.Invoke(vcode);
                vcode             = string.Empty;
                pictureBox1.Image = null;
                this.Close();
            }
        }
Ejemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     SendEvent?.Invoke(textBox1.Text.Trim());
     pictureBox1.Image = null;
     textBox1.Text     = string.Empty;
     this.Close();
 }
Ejemplo n.º 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     SendEvent?.Invoke(ContentBox.Text);
     ContentBox.Text = string.Empty;
     label1.Text     = string.Empty;
     this.Close();
 }
Ejemplo n.º 5
0
 private void Start()
 {
     if (sendEvent == null)
     {
         sendEvent = new SendEvent();
     }
     sendEvent.Invoke("This is a message from sender");
 }
 private void rbFirstSelect_CheckedChanged(object sender, EventArgs e)
 {
     if (rbFirstSelect.Checked)
     {
         SendEvent?.Invoke(this, new SendEventArgs()
         {
             TypeEvent = SendEventArgs.TypeEventE.RbtnClick
         });
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 绑定的数据源数据变化触发
 /// </summary>
 /// <param name="value"></param>
 /// <param name="index"></param>
 public void ValueUpdate(T value, int index)
 {
     if (index < _length)
     {
         if (!_value[index].Equals(value))
         {
             _value[index] = value;
             SendEvent?.Invoke(this, index, false);
         }
     }
 }
Ejemplo n.º 8
0
 // BeginSend callback
 private void HandleSend(IAsyncResult ar)
 {
     try
     {
         _clientsock.EndSend(ar);
         SendEvent?.Invoke(this, new IPCSendEventArgs(_clientsock, _buffer.OriginalData));
     }
     catch (Exception ex)
     {
         _ex = ex;
     }
     signal_write.Set();
     //return ar;
 }
Ejemplo n.º 9
0
        public void Update(int delta)
        {
            UpdatePingTime(delta);
            while (true)
            {
                ServerClass c = pool.HasSendMessages();
                if (c == null)
                {
                    break;
                }
                Queue <object> messages = c.messages;
                Socket         client   = pool.GetClientById(c.id);
                if (client != null)
                {
                    while (messages.Count > 0)
                    {
                        mSendEvent.Invoke(client, messages.Dequeue());
                    }
                }
            }

            while (true)
            {
                ServerClass c = pool.HasReciveMessages();
                if (c == null)
                {
                    break;
                }
                Queue <object> messages = c.messages;
                Socket         client   = pool.GetClientById(c.id);
                if (client != null)
                {
                    while (messages.Count > 0)
                    {
                        object obj = messages.Dequeue();
                        if (obj is PingClass)
                        {
                            pool.ResetPing(c.id);
                        }
                        else
                        {
                            OnEvent(obj);
                        }
                    }
                }
            }
        }
 protected virtual void _chartControl_ViewChanged(object sender, ChartArea e)
 {
     if (e == null)
     {
         SendEvent?.Invoke(this, new SendEventArgs()
         {
             TypeEvent = SendEventArgs.TypeEventE.ResetZoom
         });
     }
     else
     {
         SendEvent?.Invoke(this, new SendEventArgs()
         {
             Rect = new ChartRect(e), TypeEvent = SendEventArgs.TypeEventE.ChangeZoom
         });
     }
 }
Ejemplo n.º 11
0
 public bool SetValue(T[] value)
 {
     if (value.Length <= _value.Length)
     {
         for (int i = 0; i < value.Length; i++)
         {
             if (!_value[i].Vaule.Equals(value))
             {
                 _value[i].Vaule = value[i];
                 OnValueChange(i);
                 SendEvent?.Invoke(this, i, false);
             }
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 12
0
 public bool SetValue(T value, byte index)
 {
     if (index < _length)
     {
         if (!_value[index].Vaule.Equals(value))
         {
             _value[index].Vaule = value;
             OnValueChange(index);
             SendEvent?.Invoke(this, index, false);
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 13
0
 private void RaiseSendEvent(string message, IPEndPoint ipep)
 {
     SendEvent?.Invoke(message, ipep);
 }
Ejemplo n.º 14
0
        private void SendBtn_Click(object sender, EventArgs e)
        {
            string pattern = GetTestPattern();

            SendEvent?.Invoke(pattern);
        }
Ejemplo n.º 15
0
 public void OnSendEvent(ISendEventInfo sendCompleteEventArgs)
 {
     SendEvent?.Invoke(this, new SendEventArgs(sendCompleteEventArgs));
 }
Ejemplo n.º 16
0
 public void MakeEvent(object sender, Article <TData> article)
 {
     SendEvent?.Invoke(SendEvent, article);
 }