Ejemplo n.º 1
0
		public bool AttachEvent (string eventName, EventHandler<HtmlEventArgs> handler)
		{
			CheckEvent (eventName, null, handler);

			DOMEventListener listener = new DOMEventListener (this, eventName, handler);

			listener.AttachEvent();

			return AddListener (handler, listener);
		}
Ejemplo n.º 2
0
        public bool AttachEvent(string eventName, EventHandler <HtmlEventArgs> handler)
        {
            CheckEvent(eventName, null, handler);

            DOMEventListener listener = new DOMEventListener(this, eventName, handler);

            listener.AttachEvent();

            return(AddListener(handler, listener));
        }
Ejemplo n.º 3
0
		bool AddListener (object handler, DOMEventListener listener)
		{
			Dictionary<object,DOMEventListener> listeners;

			if (listener == null)
				return false;

			if (events == null)
				events = new Dictionary<string, Dictionary<object,DOMEventListener>> ();
			
			if (!events.TryGetValue (listener.EventName, out listeners)) {
				listeners = new Dictionary<object,DOMEventListener> ();
				events.Add (listener.EventName, listeners);
			}
			listeners[handler] = listener;
			return true;
		}
Ejemplo n.º 4
0
        bool AddListener(object handler, DOMEventListener listener)
        {
            Dictionary <object, DOMEventListener> listeners;

            if (listener == null)
            {
                return(false);
            }

            if (events == null)
            {
                events = new Dictionary <string, Dictionary <object, DOMEventListener> > ();
            }

            if (!events.TryGetValue(listener.EventName, out listeners))
            {
                listeners = new Dictionary <object, DOMEventListener> ();
                events.Add(listener.EventName, listeners);
            }
            listeners[handler] = listener;
            return(true);
        }