Exemplo n.º 1
0
 //The method which fires the event
 protected void OnInteractionOccured(object sender, InteractionInfoEventArgs interactInfo)
 {
     //Check if there are any objects that subscribe to this event, notify them
     if (InteractionOccursEvent != null)
     {
         //Notify subscribers
         InteractionOccursEvent(interactInfo);
     }
 }
Exemplo n.º 2
0
        private void btnClickMe_MouseCaptureChanged(object sender, EventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "MouseCaptureChanged";
            string eventText = "";
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }
Exemplo n.º 3
0
        public void AddItemToList(InteractionInfoEventArgs interactionInfo)
        {
            //Build log message
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Control: {0}, ", interactionInfo.ControlName);
            sb.AppendFormat("Event: {0}", interactionInfo.EventName);
            if (!String.IsNullOrEmpty(interactionInfo.EventText))
                sb.AppendFormat(", Info: {0}", interactionInfo.EventText);

            //Insert at first position, latest first
            lstLog.Items.Insert(0, sb.ToString());
        }
Exemplo n.º 4
0
        private void btnClickMe_MouseDown(object sender, MouseEventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "MouseDown";
            string mouseBtn = GetClickedMouse(e);

            string eventText = String.Format("Mouse down: {0}", mouseBtn);
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }
Exemplo n.º 5
0
        private void txtMouse_MouseLeave(object sender, EventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "MouseLeave";
            string eventText = "";
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }
Exemplo n.º 6
0
        private void txtKeyboard_TextChanged(object sender, EventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "TextChanged";
            string eventText = String.Format("Text changed to: {0}", txtKeyboard.Text);
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }
Exemplo n.º 7
0
        private void txtKeyboard_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "PreviewKeyDown";
            string eventText = String.Format("KeyCode: {0}, KeyValue: {1}", e.KeyCode.ToString(), e.KeyValue);
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }
Exemplo n.º 8
0
        private void txtKeyboard_KeyPress(object sender, KeyPressEventArgs e)
        {
            //Prepare params
            string controlName = ((Control)sender).Name;
            string eventName = "KeyPress";
            string eventText = String.Format("KeyChar: {0}", e.KeyChar);
            InteractionInfoEventArgs interactInfo = new InteractionInfoEventArgs(controlName, eventName, eventText);

            //Raise event
            OnInteractionOccured(sender, interactInfo);
        }