示例#1
0
        private void HandleException(Exception e)
        {
            try
            {
                string crashID  = Guid.NewGuid().ToString();
                String filename = String.Format(CultureInfo.InvariantCulture, "{0}{1}.log", HockeyConstants.CrashFilePrefix, crashID);

                CrashLogInformation logInfo = new CrashLogInformation()
                {
                    PackageName     = Application.Current.GetType().Namespace,
                    Version         = HockeyClient.Current.AsInternal().VersionInfo,
                    OperatingSystem = Environment.OSVersion.Platform.ToString(),
                    Windows         = Environment.OSVersion.Version.ToString() + Environment.OSVersion.ServicePack,
                    Manufacturer    = "",
                    Model           = ""
                };

                ICrashData crash = HockeyClient.Current.AsInternal().CreateCrashData(e, logInfo);
                using (FileStream stream = File.Create(Path.Combine(HockeyConstants.GetPathToHockeyCrashes(), filename)))
                {
                    crash.Serialize(stream);
                    stream.Flush();
                }
            }
            catch (Exception ex)
            {
                HockeyClient.Current.AsInternal().HandleInternalUnhandledException(ex);
            }
        }
示例#2
0
 internal string[] GetCrashFiles()
 {
     return(Directory.GetFiles(HockeyConstants.GetPathToHockeyCrashes(), HockeyConstants.CrashFilePrefix + "*.log"));
 }