Exemplo n.º 1
0
    private void loadHistory()
    {
        List <DialogHistoryInfo> historyList = DialogHistoryInfo.getDialogHistoryList(sessionInfo.dialogScript);

        foreach (DialogHistoryInfo di in historyList)
        {
            this.showHistoryView(di);
        }
    }
Exemplo n.º 2
0
    public static DialogHistoryInfo dataToObject(SqliteDataReader reader)
    {
        DialogHistoryInfo dialogInfo = new DialogHistoryInfo();

        dialogInfo.id      = reader.GetInt16(reader.GetOrdinal("id"));
        dialogInfo.avatar  = reader.GetString(reader.GetOrdinal("avatar"));
        dialogInfo.name    = reader.GetString(reader.GetOrdinal("name"));
        dialogInfo.actorId = reader.GetInt16(reader.GetOrdinal("actorId"));
        dialogInfo.type    = reader.GetString(reader.GetOrdinal("type"));
        dialogInfo.delay   = reader.GetInt16(reader.GetOrdinal("delay"));
        dialogInfo.text    = reader.GetString(reader.GetOrdinal("text"));
        dialogInfo.voice   = reader.GetString(reader.GetOrdinal("voice"));
        dialogInfo.video   = reader.GetString(reader.GetOrdinal("video"));
        dialogInfo.image   = reader.GetString(reader.GetOrdinal("image"));
        dialogInfo.send    = reader.GetString(reader.GetOrdinal("send"));
        return(dialogInfo);
    }
Exemplo n.º 3
0
    public static void writeDialogHistory(DialogHistoryInfo di)
    {
        SQLiteUtils sqlUtils = new SQLiteUtils();

        string[] keys = new string[di.GetType().GetProperties().Length];
        for (int i = 0; i < di.GetType().GetProperties().Length; i++)
        {
            PropertyInfo pi = di.GetType().GetProperties() [i];
            keys [i] = pi.Name;
        }
        string[] values = new string[di.GetType().GetProperties().Length];
        for (int i = 0; i < di.GetType().GetProperties().Length; i++)
        {
            PropertyInfo p  = di.GetType().GetProperties() [i];
            PropertyInfo pi = di.GetType().GetProperty(p.Name);
            values [i] = pi.GetValue(pi, null).ToString();
        }
        sqlUtils.writeHistory(Constants.HistoryTable, keys, values);
        sqlUtils.closeConnection();
    }