Exemplo n.º 1
0
 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()
                 {
                     Id = accountIdTextbox.Text,
                     Name = accountNameTextbox.Text,
                     Properties = new Dictionary<string, object> {{"Lifetime Sent Emails",1000}}
                 },
                 Event = new ActionEvent
                 {
                     Name = eventNameTextbox.Text
                 }
             };
         outputTextbox.AppendText(JsonConvert.SerializeObject(request,Formatting.Indented) + "\n");
         api.LogEvent(request);
     }
     catch (Exception ex)
     {
         outputTextbox.AppendText("Log failure:" + ex.Message);
         outputTextbox.AppendText(ex.StackTrace);
     }
 }
Exemplo n.º 2
0
 public static ActionEventCreateRequest WithEvent(this ActionEventCreateRequest req, ActionEvent actionEvent)
 {
     req.Event = actionEvent;
     return(req);
 }
Exemplo n.º 3
0
 public static ActionEventCreateRequest ForPerson(this ActionEventCreateRequest req, Person person)
 {
     req.Person = person;
     return(req);
 }
Exemplo n.º 4
0
 public void LogEvent(ActionEventCreateRequest request)
 {
     JObject param = JObject.FromObject(request);
     Helpers.SendData(ProjectCode, ProjectApiSecret, api_endpoint_events, "POST", param);
 }
Exemplo n.º 5
0
        public void LogEvent(ActionEventCreateRequest request)
        {
            JObject param = JObject.FromObject(request);

            Helpers.SendData(ProjectCode, ProjectApiSecret, api_endpoint_events, "POST", param);
        }