예제 #1
0
        /// <summary>
        /// Notifies any subscribers an event was chosen.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void eventSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            DynamicEventItem item = (eventSelector.SelectedItem as DynamicEventItem);

            if (item == null)
            {
                return;
            }
            OnEventChosen(item.Constructor, parameterMap);
        }
예제 #2
0
        /// <summary>
        /// Posts the given event if allowed to.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void postButton_Click(object sender, EventArgs e)
        {
            DynamicEventItem item = (eventSelector.SelectedItem as DynamicEventItem);

            if (item == null)
            {
                return;
            }
            if (CanPost(item.Constructor, parameterMap))
            {
                PostEvent(item.Constructor.Instantiate());
            }
        }