static void FeedbackSendablePosted(FeedbackCommon.SendableBase obj) { Application.Log("Feedback posted", obj.GetDescription()); var old = FeedbackOnline; FeedbackOnline = true; if (old != FeedbackOnline) { if (FeedbackOnlineChanged != null) FeedbackOnlineChanged(); if (Instance != null) Instance.UpdateFeedbackOnlineControl(); } }
public static Profile New(String name, String email, FeedbackCommon.ProfileType type) { Profile p = new Profile(); // This should only run when creating the profile so the ID doesn't change between runs p.FeedbackInfo = new FeedbackCommon.Profile { Name = name, EMail = email, HWID = Common.Utils.GetMac(), Type = type }; p.FeedbackInfo.HttpPost(Settings.StatisticsURI); p.Name = name; p.EmailAddress = email; p.Save(); return p; }
static void FeedbackSendablePostingError(FeedbackCommon.SendableBase arg1, Exception arg2) { Application.Log("Feedback posting error", arg1.GetDescription(), "Error:", arg2.ToString()); var old = FeedbackOnline; FeedbackOnline = false; if (old != FeedbackOnline) { if(FeedbackOnlineChanged != null) FeedbackOnlineChanged(); if (Instance != null) Instance.UpdateFeedbackOnlineControl(); } // store error on system if (!System.IO.Directory.Exists(Graphics.Application.ApplicationDataFolder + crashStorageDirectory)) System.IO.Directory.CreateDirectory(Graphics.Application.ApplicationDataFolder + crashStorageDirectory); string filePath = ""; do { filePath = Graphics.Application.ApplicationDataFolder + crashStorageDirectory + System.IO.Path.GetRandomFileName(); } while (System.IO.File.Exists(filePath)); using (StreamWriter sw = new StreamWriter(filePath)) { sw.WriteLine(arg1.LastSendURI); sw.WriteLine(arg1.ParameterString); } }