TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file EventHandler.php

Documentation is available at EventHandler.php

  1. <?php
  2.  
  3.  /**
  4.  * EventHandler class
  5.  *
  6.  * Description:
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage events
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16. class EventHandler {
  17.  
  18.      private $event;
  19.      private $callback;
  20.  
  21.      public function GetEventName()
  22.      {
  23.           return $this->event->GetName();
  24.      }
  25.  
  26.      public function __construct($event$callback)
  27.      {
  28.           $this->event $event;
  29.           $this->callback $this->PrepareCallback($callback);
  30.      }
  31.  
  32.      public function Raise($sender$args)
  33.      {
  34.           if ($this->callback)
  35.               eval($this->callback);
  36.      }
  37.  
  38.      private function PrepareCallback($callback)
  39.      {
  40.           if ($pos strpos($callback'('))
  41.               $callback substr($callback0$pos);
  42.  
  43.           $callback .= '($sender, $args);';
  44.  
  45.           return $callback;
  46.      }
  47. }
  48. ?>

Documentation generated on Wed, 16 Jun 2010 12:05:09 +0200 by phpDocumentor 1.4.1