Exemplo n.º 1
0
 /// <summary>
 /// 事件处理
 /// </summary>
 /// <param name="obj"></param>
 void PagerControlTest_PageChangeWithObject(object obj)
 {
     PagerLib.PagerControl pager = obj as PagerLib.PagerControl;
     //if (pager != null)
     //{
     //    Console.WriteLine(pager.Name);
     //}
 }
        /// <summary>
        /// 触发有对象事件
        /// </summary>
        /// <param name="sender">对象</param>
        private void OnPageChange(PagerControl sender)
        {
            Action <object> temp = Interlocked.CompareExchange(ref PageChangeWithObject, null, null);

            if (temp != null)
            {
                temp(sender);
            }
        }
 /// <summary>
 /// 触发有对象事件
 /// </summary>
 /// <param name="sender">对象</param>
 private void OnPageChange(PagerControl sender)
 {
     Action<object> temp = Interlocked.CompareExchange(ref PageChangeWithObject, null, null);
     if (temp != null)
     {
         temp(sender);
     }
 }