Analysis-Services/BismNormalizer/AlmToolkit/Utils.cs

72 lines
2.1 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;
}
}
2019-12-13 11:20:36 +08:00
public static string LatestVersionDownloadUrl
2019-12-13 08:52:35 +08:00
{
get
{
2019-12-13 11:20:36 +08:00
return "https://github.com/microsoft/Analysis-Services/releases/latest/download/AlmToolkitSetup.msi";
2019-12-13 08:52:35 +08:00
}
}
2019-11-28 06:09:36 +08:00
}
}