72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
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;
|
|
}
|
|
}
|
|
|
|
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";
|
|
}
|
|
}
|
|
}
|
|
}
|