Analysis-Services/BismNormalizer/AlmToolkit/Utils.cs

89 lines
2.6 KiB
C#
Raw Normal View History

2019-11-28 06:09:36 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace AlmToolkit
{
public static class Utils
{
public static string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
2019-12-13 08:52:35 +08:00
public static string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public static string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public static string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public static string LatestVersionDownloadUrl
{
get
{
return "https://github.com/microsoft/Analysis-Services/releases/latest/download/AlmToolkitSetup.msi";
}
}
public static string ReleaseHistoryUrl
{
get
{
return "https://github.com/microsoft/Analysis-Services/releases/latest";
}
}
public static string DocumentationUrl
{
get
{
return "https://github.com/microsoft/Analysis-Services/blob/master/BismNormalizer/Model%20Comparison%20and%20Merging%20for%20Analysis%20Services.pdf";
}
}
2019-11-28 06:09:36 +08:00
}
}