private void CreateLogEvent()
 {
     outputTextbox.AppendText("Logging event\n");
     Preact.Api api = new Preact.Api(codeTextbox.Text, secretTextbox.Text);
     try
     {
         Preact.ActionEventCreateRequest request = new Preact.ActionEventCreateRequest()
         {
             Account = new Preact.Account()
             {
                 Name           = accountNameTextbox.Text,
                 Id             = accountIdTextbox.Text,
                 LicenseType    = "paying",
                 LicenseRenewal = DateTime.UtcNow.ToString("yyyy-MM-dd")
             },
             Event = new Preact.ActionEvent()
             {
                 Name    = eventNameTextbox.Text,
                 Revenue = 99
             },
             Person = new Preact.Person()
             {
                 Email      = emailTextbox.Text,
                 Name       = personNameTextbox.Text,
                 Uid        = uidTextbox.Text,
                 CreatedAt  = DateTime.Now,
                 Properties = new Dictionary <string, object>()
                 {
                     { "created_at", (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds },
                     { "is_paying", true },
                     { "account_level", 2 },
                     { "account_level_name", "Pro" }
                 }
             }
         };
         outputTextbox.AppendText(JsonConvert.SerializeObject(request, Formatting.Indented) + "\n");
         api.LogEvent(request);
     }
     catch (Exception ex)
     {
         outputTextbox.AppendText("Log failure:" + ex.Message);
         outputTextbox.AppendText(ex.StackTrace);
     }
 }
 private void CreateLogEvent()
 {
     outputTextbox.AppendText("Logging event\n");
     Preact.Api api = new Preact.Api(codeTextbox.Text, secretTextbox.Text);
     try
     {
         Preact.ActionEventCreateRequest request = new Preact.ActionEventCreateRequest()
             {
                 Account = new Preact.Account()
                 {
                     Name = accountNameTextbox.Text,
                     Id = accountIdTextbox.Text,
                     LicenseType = "paying",
                     LicenseRenewal = DateTime.UtcNow.ToString("yyyy-MM-dd")
                 },
                 Event = new Preact.ActionEvent()
                 {
                     Name = eventNameTextbox.Text,
                     Revenue = 99
                 },
                 Person = new Preact.Person()
                 {
                     Email = emailTextbox.Text,
                     Name = personNameTextbox.Text,
                     Uid = uidTextbox.Text,
                     CreatedAt = DateTime.Now,
                     Properties = new Dictionary<string, object>()
                         {
                            {"created_at", (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds},
                            {"is_paying", true},
                            {"account_level", 2},
                            {"account_level_name", "Pro"}
                         }
                 }
             };
         outputTextbox.AppendText(JsonConvert.SerializeObject(request,Formatting.Indented) + "\n");
         api.LogEvent(request);
     }
     catch (Exception ex)
     {
         outputTextbox.AppendText("Log failure:" + ex.Message);
         outputTextbox.AppendText(ex.StackTrace);
     }
 }