Exemplo n.º 1
0
        private void timeButton_ReportTime(object sender, ReportTimeEventArgs e)
        {
            string timeStr = e.ClickTime.ToString("yyyy-mm-dd HH:mm:ss");
            string content = string.Format("{0}到达{1}", timeStr, (sender as FrameworkElement).Name);

            this.ListBox.Items.Add(content);
        }
Exemplo n.º 2
0
        protected override void OnClick()
        {
            base.OnClick();
            ReportTimeEventArgs args = new ReportTimeEventArgs(ReportTimeEvent, this);

            args.ClickTime = DateTime.Now;
            this.RaiseEvent(args);
        }