protected override emBusiCallbackResult_t InnerOnUIEvtHandle(IUIService iUI, UIEventArg argUIEvent)
        {
            Debug.Assert(null != iUI && null != argUIEvent);

            emBusiCallbackResult_t result = base.InnerOnUIEvtHandle(iUI, argUIEvent);

            if (emBusiCallbackResult_t.Swallowd == result)
            {
                return(result);
            }

            try
            {
                if (argUIEvent.EventName == UIEventNames.s_ClickEvent)
                {
                    if (null != argUIEvent.Key)
                    {
                        Log.Action.LogInfoFormat("UI event: the key {0}({1}) pressed", argUIEvent.ElementName, argUIEvent.Key);
                    }
                    return(emBusiCallbackResult_t.Swallowd);
                }
            }
            catch (System.Exception ex)
            {
                Log.Action.LogError(ex.Message, ex);
            }

            return(emBusiCallbackResult_t.Bypass);
        }
Ejemplo n.º 2
0
        public static object GetArg(UIEventArg key)
        {
            ValueArg tempArg;

            if (g_argDict.TryGetValue(key, out tempArg))
            {
                return(tempArg.GetValue());
            }
            else
            {
                return("null");
            }
        }
Ejemplo n.º 3
0
        private bool ObjImp_UIEvent(IUIService argiService, UIEventArg argArg)
        {
            //  Log.Action.LogInfoFormat("UI event: the key {0}({1}) pressed", argUIEvent.ElementName, argUIEvent.Key);
            string key     = argArg.Key == null ? string.Empty : argArg.Key.ToString();
            string message = $"ui event: element name: {argArg.ElementName}, key: {key}";

            UpdateLog(message);
            if (currentActivity != null)
            {
                currentActivity.OnUIEvtHandle(argiService, argArg);
            }
            return(true);
        }
Ejemplo n.º 4
0
        public static void SetArg(UIEventArg key, double value)
        {
            ValueArg temp = new ValueArg();

            temp.SetValue(value);

            if (g_argDict.ContainsKey(key))
            {
                g_argDict[key] = temp;
            }
            else
            {
                g_argDict.Add(key, temp);
            }
        }
Ejemplo n.º 5
0
        private void onClick(UIEventArg arg)
        {
            if (arg.Component == load)
            {
                GameManager.GetInstance().ChangeScreen(ScreenState.GAME);

                if (File.Exists("Save/Load.sav"))
                {
                    GameScreen g = (GameScreen)(GameManager.GetInstance().Screen);
                    g.LoadGame();
                }
            }
            else if (arg.Component == start)
            {
                GameManager.GetInstance().ChangeScreen(ScreenState.GAME);
            }
            else if (arg.Component == minigame)
            {
                GameManager.GetInstance().ChangeScreen(ScreenState.MINIGAME);
            }
        }
Ejemplo n.º 6
0
 protected virtual emBusiCallbackResult_t InnerOnUIEvtHandle(IUIService iUI,
                                                             UIEventArg objArg)
 {
     return(emBusiCallbackResult_t.Bypass);
 }
Ejemplo n.º 7
0
 public emBusiCallbackResult_t OnUIEvtHandle(IUIService iSender,
                                             UIEventArg objArg)
 {
     return(InnerOnUIEvtHandle(iSender, objArg));
 }