Ejemplo n.º 1
0
        public CrashReportForm(Event ev) {
            InitializeComponent();

            Event = ev;
            Text = String.Format("{0} Error", AssemblyHelper.GetAssemblyTitle());
            InformationHeaderLabel.Text = String.Format("{0} has encountered a problem and needs to close.  We are sorry for the inconvenience.", AssemblyHelper.GetAssemblyTitle());

            // TODO: Implement this once the client has persisted storage.
            var userInfo = ev.GetUserIdentity();
            if (userInfo != null && !String.IsNullOrEmpty(userInfo.Identity))
                EmailAddressTextBox.Text = userInfo.Identity;
            //else
            //    EmailAddressTextBox.Text = ExceptionlessClient.Default.LocalConfiguration.EmailAddress;

            DescriptionTextBox.Text = Event.GetUserDescription();
        }
Ejemplo n.º 2
0
        public CrashReportForm(ExceptionlessClient client, Event ev) {
            InitializeComponent();

            Client = client;
            Event = ev;
            Text = String.Concat(AssemblyHelper.GetAssemblyTitle(), " Error");
            InformationHeaderLabel.Text = String.Concat(AssemblyHelper.GetAssemblyTitle(), " has encountered a problem and needs to close.  We are sorry for the inconvenience.");

            var userInfo = ev.GetUserIdentity(client.Configuration.Resolver.GetJsonSerializer());
            if (userInfo != null && !String.IsNullOrEmpty(userInfo.Identity)) {
                EmailAddressTextBox.Text = userInfo.Identity;
            } else {
                var storage = client.Configuration.Resolver.Resolve<PersistedDictionary>();
                string emailAddress;
                if (storage != null && storage.TryGetValue("EmailAddress", out emailAddress))
                    EmailAddressTextBox.Text = emailAddress;
            }

            var userDescription = Event.GetUserDescription(client.Configuration.Resolver.GetJsonSerializer());
            if (userDescription != null)
                DescriptionTextBox.Text = userDescription.Description;
        }