/* ExceptionViewModel.cs * part of zaaReloaded2 * * Copyright 2015-2017 Daniel Kraus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Specialized; using System.Reflection; using Bovender.Unmanaged; using zaaReloaded2.Updater; namespace zaaReloaded2.ExceptionHandler { public class ExceptionViewModel : Bovender.ExceptionHandler.ExceptionViewModel { #region Additional properties for the exception report public string WordVersion { get { return Globals.ThisAddIn.Application.Build; } } public string WordBitness { get { return Environment.Is64BitProcess ? "64-bit" : "32-bit"; } } public string AddinVersion { get { return zaaReloaded2.Updater.Version.Current.ToString(); } } #endregion #region constructor public ExceptionViewModel(Exception e) : base(e) { } #endregion #region Overrides public override object RevealModelObject() { return Exception; } protected override NameValueCollection GetPostValues() { NameValueCollection v = base.GetPostValues(); v["excel_version"] = WordVersion; v["excel_bitness"] = ProcessBitness; v["toolbox_version"] = AddinVersion; return v; } protected override Uri GetPostUri() { return new Uri(Properties.Settings.Default.ExceptionPostUrl); } protected override string DevPath() { return @"x:\Code\zaaReloaded2\zaaReloaded2\"; } protected override Bovender.UserSettings.UserSettingsBase UserSettings { get { return zaaReloaded2.UserSettings.Default; } } #endregion } }