Пример #1
0
        private void ReportTimeEventHandler(object sender, ReportTimeEventArgs e)
        {
            FrameworkElement element = sender as FrameworkElement;
            string           time    = e.ClickTime.ToLongTimeString();
            string           content = $"{time} 到达 {element.Name}";

            this.lbox.Items.Add(content);
        }
Пример #2
0
        protected override void OnClick()
        {
            base.OnClick();

            ReportTimeEventArgs args = new ReportTimeEventArgs(ReportTimeEvent, this)
            {
                ClickTime = DateTime.Now
            };

            this.RaiseEvent(args);
        }