Exemple #1
0
 private void ButtonClearEvents_Activated(object sender, EventArgs e)
 {
     if (dataSource != null)
     {
         dataSource.Events.Clear();
         TableEvents.ReloadData();
     }
 }
        private void PushTableEvent(TableEvents events, uint userid, object data)
        {
            TableEventList.Add(new TableEvent()
            {
                Events = events, UserID = userid, Data = data
            });

            DispatchTableEvent();
        }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        trialStart = false;
        trialStop  = false;

        triggerCounter = this;
        triggerCount   = 0;

        // for use on trial screen to endtrial:
        endHitCounter = this;
        endHit        = 0;  // how many hits necessary to end trial minus 1

        // for use on ITI screen to start trial:
        startHitCounter = this;
        startHit        = 0;  // how many hits necessary to end trial minus 1
    }
    // Use this for initialization
    void Start()
    {
        triggerCounter = this;
        triggerCount   = 0;

        // for use on trial screen to endtrial:
        goalHitCounter = this;
        goalHit        = 0;  // how many hits necessary to end trial minus 1

        // for use on ITI screen to start trial:
        startHitCounter = this;
        startHit        = 0;  // how many hits necessary to end trial minus 1

        alignedHitCounter = this;
        alignHit          = 0;
    }
Exemple #5
0
        private void Adb_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (e.Data == null)
            {
                return;
            }

            if (!e.Data.Contains("ShadowOS"))
            {
                return;
            }

            // Got an event from ShadowOS
            Console.WriteLine("received output: {0}", e.Data);

            try
            {
                // Parse out the details
                int    start         = e.Data.IndexOf("{", StringComparison.CurrentCulture);
                string data          = e.Data.Substring(start);
                var    shadowOSEvent = JsonConvert.DeserializeObject <ShadowOSEvent>(data);

                string details = string.Empty;

                if (shadowOSEvent.EventType == "http")
                {
                    details = shadowOSEvent.Data.Uri;
                }
                else
                {
                    details = shadowOSEvent.Data.Data;
                }

                dataSource.Events.Insert(0, new Event(shadowOSEvent.EventType, shadowOSEvent.Data.Action, details));

                this.InvokeOnMainThread(() =>
                {
                    TableEvents.ReloadData();
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemple #6
0
        //框架事件入口
        private void OnTableUserEvent(TableEvents tevt, uint userid, object data)
        {
            if (CUIManger.Instance.SceneType != enSceneType.SCENE_GAME)
            {
                return;
            }
            //if (_bReqQuit == true) return;

            switch (tevt)
            {
            //用户进来
            case TableEvents.USER_COME:
            {
                PlayerInfo userdata = CGameEngine.Instance.GetTableUserItem((byte)CGameEngine.Instance.MySelf.DeskStation);
                if (userid != userdata.ID)
                {
                    int        temp_iCahirID = CGameEngine.Instance.UserIdToChairId(userid);
                    PlayerInfo userInfo      = CGameEngine.Instance.GetTableUserItem((ushort)temp_iCahirID);
                    if (userInfo != null)
                    {
                        int temp_iFaceID = (int)userInfo.HeadID;
                        CHeadManger._instance.ShowPlayerHead(temp_iCahirID, temp_iFaceID, userInfo.NickName);
                    }
                }
                break;
            }

            case TableEvents.USER_LEAVE:
            {
                for (int i = 0; i < 8; i++)
                {
                    if (CGameEngine.Instance.GetTableUserItem((ushort)i) == null)
                    {
                        CHeadManger._instance.PlayerExit(i);
                    }
                }
                break;
            }

            case TableEvents.GAME_ENTER:
            {
                CHeadManger._instance.SetAllFalse();
                for (int i = 0; i < 8; i++)
                {
                    PlayerInfo playerdata = CGameEngine.Instance.GetTableUserItem((ushort)i);
                    if (playerdata == null)
                    {
                        continue;
                    }
                    CHeadManger._instance.ShowPlayerHead(i, (int)playerdata.HeadID, playerdata.NickName);
                }

                break;
            }

            case TableEvents.GAME_START:
            {
                CHeadManger._instance.SetAllFalse();
                for (int i = 0; i < 8; i++)
                {
                    PlayerInfo playerdata = CGameEngine.Instance.GetTableUserItem((ushort)i);
                    if (playerdata == null)
                    {
                        continue;
                    }
                    CHeadManger._instance.ShowPlayerHead(i, (int)playerdata.HeadID, playerdata.NickName);
                }
                break;
            }
            }
        }