zaaReloaded2/zaaReloaded2/ExceptionHandler/ExceptionViewModel.cs
2015-08-09 20:52:35 +02:00

92 lines
2.3 KiB
C#
Executable File

/* ExceptionViewModel.cs
* part of zaaReloaded2
*
* Copyright 2015 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.CurrentVersion().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\";
}
#endregion
}
}