Creates new type of event or returns existing one, if it was created before.
@param {string} eventName
@return {function(..eventArgs)}
513792
function createDispatcher(eventName){
    var eventFunction = events[eventName];

    if (!eventFunction)
    {
      eventFunction = function(){
        var cursor = this;
        var args;
        var fn;

        while (cursor = cursor.handler)
        {
          // callback call
          fn = cursor.callbacks[eventName];
          if (typeof fn == 'function')
          {
            if (!args)
            {
              // it should be better for browser optimizations
              // (instead of [this].concat(slice.call(arguments)))
              args = [this];
              for (var i = 0; i < arguments.length; i++)
                args.push(arguments[i]);
            }

            fn.apply(cursor.context || this, args);
          }

          // any event callback call
          fn = cursor.callbacks['*'];
          if (typeof fn == 'function')
          {
            if (!args)
            {
              // it should be better for browser optimizations
              // (instead of [this].concat(slice.call(arguments)))
              args = [this];
              for (var i = 0; i < arguments.length; i++)
                args.push(arguments[i]);
            }

            fn.call(cursor.context || this, {
              sender: this,
              type: eventName,
              args: args
            });
          }
        }

        // feature available in development mode only
        /** @cut */ if (this.debug_emit)
        /** @cut */ {
        /** @cut */   args = [];  // avoid optimization warnings about arguments
        /** @cut */   for (var i = 0; i < arguments.length; i++)
        /** @cut */     args.push(arguments[i]);
        /** @cut */   this.debug_emit({
        /** @cut */     sender: this,
        /** @cut */     type: eventName,
        /** @cut */     args: args
        /** @cut */   });
        /** @cut */ }
      };

      // function wrapper for more verbose in development mode
      /** @cut */ eventFunction = new Function(
      /** @cut */   'return {"' + namespace + '.events.' + eventName + '":\n\n      ' +
      /** @cut */
      /** @cut */     'function(' + basis.array(arguments, 1).join(', ') + '){' +
      /** @cut */       eventFunction.toString()
      /** @cut */         .replace(/\beventName\b/g, '"' + eventName + '"')
      /** @cut */         .replace(/^function[^(]*\(\)[^{]*\{|\}$/g, '') +
      /** @cut */     '}' +
      /** @cut */
      /** @cut */   '\n\n}["' + namespace + '.events.' + eventName + '"];'
      /** @cut */ )();

      events[eventName] = eventFunction;
    }

    return eventFunction;
  }
793282
function event(eventName, callingFunction) {
        if (typeof eventName !== 'string') {
            self.showError(self.errCodes.DEVELOPER_ERR, callingFunction + " called without a string as the first argument");
            throw "developer error";
        }
        if (!allowedEvents[eventName]) {
            self.showError(self.errCodes.DEVELOPER_ERR, callingFunction + " called with a bad event name = " + eventName);
            throw "developer error";
        }
    }
1113660
public function invokeGlobalEvent($eventName, EventArgs $event)
    {
        if ($this->eventManager->hasListeners($eventName)) {
            $this->eventManager->dispatchEvent($eventName, $event);
        }
    }
544461
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.prependListener(handler))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
615321
function(el, eventName, data)
    {
        var ev;

        if (document.createEvent) {
            ev = document.createEvent('HTMLEvents');
            ev.initEvent(eventName, true, false);
            ev = extend(ev, data);
            el.dispatchEvent(ev);
        } else if (document.createEventObject) {
            ev = document.createEventObject();
            ev = extend(ev, data);
            el.fireEvent('on' + eventName, ev);
        }
    }
92193
function eventListenerHub(emitter, eventName) {
  var self = object.create(eventListenerHub.prototype);

  self.emitter = emitter;
  self.eventName = eventName;
  self.handlers = [];
  self.defaultHandlerFn = null;

  return self;
}
217489
function(events, name, callback, options) {
    if (callback) {
      var handlers = events[name] || (events[name] = []);
      var context = options.context, ctx = options.ctx, listening = options.listening;
      if (listening) listening.count++;

      handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
    }
    return events;
  }
142516
function(name) {
      var args = _.toArray(arguments);
      args.shift();

      if (this._events && this._events[name]) {
        _.each(this._events[name], function(subscription) {
          subscription.callback.apply(subscription.context || this, args);
        }, this);
      }
      return this;
    }
21946
function( event ) {
            if( event ){
                $.getEvent = function( event ) {
                    return event;
                };
            } else {
                $.getEvent = function() {
                    return window.event;
                };
            }
            return $.getEvent( event );
        }
52406
function ( eventName, handler ) {
        var events = this.events[ eventName ],
            handlers = [],
            i;
        if ( !events ) {
            return;
        }
        if ( $.isArray( events ) ) {
            for ( i = 0; i < events.length; i++ ) {
                if ( events[i].handler !== handler ) {
                    handlers.push( events[ i ] );
                }
            }
            this.events[ eventName ] = handlers;
        }
    }
1291299
function MouseEvent(eventType, params) {
    params = params || { bubbles: false, cancelable: false };
    var mouseEvent = document.createEvent('MouseEvent');
    mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);

    return mouseEvent;
  }
318770
public function fireEvent($eventName, Event $event = null)
    {
        /** @var EventDispatcher $events */
        $events = $this['events'];

        return $events->dispatch($eventName, $event);
    }
541222
public void InvokeEvent(String eventName, JSONArray args)
    {
        HubOnDataCallback subscription;
        if(mSubscriptions.containsKey(eventName))
        {
        	subscription = mSubscriptions.get(eventName);
            subscription.OnReceived(args);
        }
    }
133761
function(event) {
            var args = Array.prototype.slice.call(arguments);
            (this.emitter || (this.emitter = new emitter())).emit.apply(this, args);
        }
20503
function trigger(eventType, ...args) {

    let event = new Event(event);
    args.length ? event[eventType] = args : null;
    this.dispatchEvent(event);
}
1286557
function(event, name) {
            var that = this;

            if (!(event in that.__events)) {
                that.__events[event] = {};
            }

            if (!_.isUndefined(name)) {
                if (!that.__hasEventListener(event, name)) {
                    throw new Error('There is no "' + event +  (name ? '"::"' + name : '') + '" event callback!');
                }

                that.__events[event][name] = undefined;
            }
            else {

                _.each(that.__getEventListeners(event), function(listener, name) {
                    that.__events[event][name] = undefined;
                });
            }

            return that;
        }
290328
function ( eventName ) {
        var events = this.events[ eventName ];
        if ( !events || !events.length ) {
            return null;
        }
        events = events.length === 1 ?
            [ events[ 0 ] ] :
            Array.apply( null, events );
        return function ( source, args ) {
            var i,
                length = events.length;
            for ( i = 0; i < length; i++ ) {
                if ( events[ i ] ) {
                    args.eventSource = source;
                    args.userData = events[ i ].userData;
                    events[ i ].handler( args );
                }
            }
        };
    }