Ejemplo n.º 1
0
 public ValueBinder(InputElement target, Expression expression)
     : base(target, "value", expression)
 {
     _target = target;
     _changeListener = OnChanged;
     target.AddEventListener("change", _changeListener, false);
 }
Ejemplo n.º 2
0
 public ValueBinder(InputElement target, Expression expression)
     : base(target, "value", expression)
 {
     _target         = target;
     _changeListener = OnChanged;
     target.AddEventListener("change", _changeListener, false);
 }
Ejemplo n.º 3
0
 public static void RegisterClick2(string[] Elemes, ElementEventListener elementEventListener)
 {
     foreach (string E in Elemes)
     {
         RegisterEvent2(Document.GetElementById(E), Events.Click, elementEventListener);
     }
 }
Ejemplo n.º 4
0
 public override void Init(Scene level)
 {
     _level = (RaceLevel)level;
     _playThroughListener = SoundLoaded;
     _timeUpdatedListener = TimeUpdated;
     if (jQuery.Browser.Mozilla || jQuery.Browser.Opera)
         _engine = _level.LoadAudio("Audio/Race/engine.ogg");
     else
         _engine = _level.LoadAudio("Audio/Race/engine.mp3");
     _engine.AddEventListener("canplaythrough", _playThroughListener, false);
 }
Ejemplo n.º 5
0
 private Element BuildMenuButton(string label, int position, ElementEventListener clickListener)
 {
     Element wrapper = Document.CreateElement("DIV");
     _overlay.AppendChild(wrapper);
     wrapper.ClassName = "MenuButton";
     wrapper.Style.Top = position + "px";
     Element button = Document.CreateElement("SPAN");
     wrapper.AppendChild(button);
     button.InnerHTML = label;
     if (clickListener != null) button.AddEventListener("click", clickListener, false);
     return wrapper;
 }
Ejemplo n.º 6
0
 public override void Dispose()
 {
     if (_engine != null)
     {
         _engine.Pause();
         _engine.RemoveEventListener("timeupdate", _timeUpdatedListener, false);
     }
     _playThroughListener = null;
     _timeUpdatedListener = null;
     _level = null;
     _engine = null;
 }
Ejemplo n.º 7
0
 public override void Dispose()
 {
     if (_engine != null)
     {
         _engine.Pause();
         _engine.RemoveEventListener("timeupdate", _timeUpdatedListener, false);
     }
     _playThroughListener = null;
     _timeUpdatedListener = null;
     _level  = null;
     _engine = null;
 }
Ejemplo n.º 8
0
        public Scene(Game game)
        {
            CurrentGame = game;

            _blurListener    = OnBlur;
            _focusListener   = OnFocus;
            _keyDownListener = OnKeyDown;
            _keyUpListener   = OnKeyUp;

            _resourceLoaded       = ResourceLoaded;
            _maskedResourceLoaded = MaskedResourceLoaded;
        }
Ejemplo n.º 9
0
        public Scene(Game game)
        {
            CurrentGame = game;

            _blurListener = OnBlur;
            _focusListener = OnFocus;
            _keyDownListener = OnKeyDown;
            _keyUpListener = OnKeyUp;

            _resourceLoaded = ResourceLoaded;
            _maskedResourceLoaded = MaskedResourceLoaded;
        }
Ejemplo n.º 10
0
        private Element BuildMenuButton(string label, int position, ElementEventListener clickListener)
        {
            Element wrapper = Document.CreateElement("DIV");

            _overlay.AppendChild(wrapper);
            wrapper.ClassName = "MenuButton";
            wrapper.Style.Top = position + "px";
            Element button = Document.CreateElement("SPAN");

            wrapper.AppendChild(button);
            button.InnerHTML = label;
            button.AddEventListener("click", clickListener, false);
            return(wrapper);
        }
Ejemplo n.º 11
0
 public override void Init(Scene level)
 {
     _level = (RaceLevel)level;
     _playThroughListener = SoundLoaded;
     _timeUpdatedListener = TimeUpdated;
     if (jQuery.Browser.Mozilla || jQuery.Browser.Opera)
     {
         _engine = _level.LoadAudio("Audio/Race/engine.ogg");
     }
     else
     {
         _engine = _level.LoadAudio("Audio/Race/engine.mp3");
     }
     _engine.AddEventListener("canplaythrough", _playThroughListener, false);
 }
Ejemplo n.º 12
0
        public virtual void Dispose()
        {
            _initialized = false;
            StopTimer();
            DisposeSystems();

            _resourcesLoadedLabel = null;
            _resourcesToLoadLabel = null;

            Document.RemoveEventListener("blur", _blurListener, true);
            Document.RemoveEventListener("focus", _focusListener, true);

            Document.RemoveEventListener("keydown", _keyDownListener, true);
            Document.RemoveEventListener("keyup", _keyUpListener, true);

            _canvas               = null;
            _resourceLoaded       = null;
            _maskedResourceLoaded = null;

            GameObject.Clear();
        }
Ejemplo n.º 13
0
        public static void RegisterEvent2(Element E, string eventName, ElementEventListener elementEventListener)
        {
            if (E == null)
            {
                return;
            }

            //Don't depened on Try-Catch for Business Logic
            try
            {
                if ((bool)Script.Literal("E.addEventListener!=null"))
                {
                    E.AddEventListener(eventName, elementEventListener, false);
                }
                else
                {
                    Script.Literal("{0}.attachEvent('on{1}', {2})", E, eventName, elementEventListener);
                }
            }
            catch
            {
                Script.Literal("{0}.attachEvent('on{1}', {2})", E, eventName, elementEventListener);
            }
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Removes a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 /// <param name="useCapture">Whether the listener wants to initiate capturing the event.</param>
 public void RemoveEventListener(string eventName, ElementEventListener listener, bool useCapture) {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Adds a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 public void AddEventListener(string eventName, ElementEventListener listener) {
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Removes a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 public void RemoveEventListener(string eventName, ElementEventListener listener) {
 }
Ejemplo n.º 17
0
 public EventBinder(Element source, string eventName, ElementEventListener eventHandler)
 {
     _source       = source;
     _eventName    = eventName;
     _eventHandler = eventHandler;
 }
Ejemplo n.º 18
0
        public static void SubscribeKey(string id, ElementEventListener listener)
        {
            Element e = Document.GetElementById(id);

            e.AddEventListener("keyup", listener, false);
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Removes a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 public static void RemoveEventListener(string eventName, ElementEventListener listener)
 {
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Removes a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 /// <param name="useCapture">Whether the listener wants to initiate capturing the event.</param>
 public static void RemoveEventListener(string eventName, ElementEventListener listener, bool useCapture)
 {
 }
Ejemplo n.º 21
0
 public void RemoveEventListener(ApplicationCacheEvent eventName, ElementEventListener listener, bool useCapture)
 {
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Adds a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 /// <param name="useCapture">Whether the listener wants to initiate capturing the event.</param>
 public void AddEventListener(string eventName, ElementEventListener listener, bool useCapture)
 {
 }
Ejemplo n.º 23
0
        public virtual void Dispose()
        {
            _initialized = false;
            StopTimer();
            DisposeSystems();

            _resourcesLoadedLabel = null;
            _resourcesToLoadLabel = null;

            Document.RemoveEventListener("blur", _blurListener, true);
            Document.RemoveEventListener("focus", _focusListener, true);

            Document.RemoveEventListener("keydown", _keyDownListener, true);
            Document.RemoveEventListener("keyup", _keyUpListener, true);

            _canvas = null;
            _resourceLoaded = null;
            _maskedResourceLoaded = null;

            GameObject.Clear();
        }
Ejemplo n.º 24
0
 public static void RegisterChange(string E, ElementEventListener elementEventListener)
 {
     RegisterEvent2(Document.GetElementById(E), Events.Change, elementEventListener);
 }
Ejemplo n.º 25
0
 public void RemoveEventListener(ApplicationCacheEvent eventName, ElementEventListener listener, bool useCapture) {
 }
Ejemplo n.º 26
0
 public static void RegisterEvent(string E, string eventName, ElementEventListener elementEventListener)
 {
     RegisterEvent2(Document.GetElementById(E), eventName, elementEventListener);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Adds a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 /// <param name="useCapture">Whether the listener wants to initiate capturing the event.</param>
 public static void AddEventListener(string eventName, ElementEventListener listener, bool useCapture)
 {
 }
Ejemplo n.º 28
0
 public static void RegisterClick3(Element Elem, ElementEventListener elementEventListener)
 {
     RegisterEvent2(Elem, Events.Click, elementEventListener);
 }
Ejemplo n.º 29
0
 public static void SubscribeKey(string id, ElementEventListener listener) {
     Element e = Document.GetElementById(id);
     e.AddEventListener("keyup", listener, false);
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Adds a listener for the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event such as 'load'.</param>
 /// <param name="listener">The listener to be invoked in response to the event.</param>
 public void AddEventListener(string eventName, ElementEventListener listener)
 {
 }
Ejemplo n.º 31
0
 public EventBinder(Element source, string eventName, ElementEventListener eventHandler)
 {
     _source = source;
     _eventName = eventName;
     _eventHandler = eventHandler;
 }