Analysis-Services/BismNormalizer/AlmToolkit/Program.cs

56 lines
1.6 KiB
C#
Raw Normal View History

2019-12-08 11:53:15 +08:00
using Microsoft.AnalysisServices;
using System;
2019-09-14 13:26:01 +08:00
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AlmToolkit
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args != null && args.Length > 0)
{
2019-12-08 11:53:15 +08:00
if (args.Length > 1)
//User opened from Desktop with server/db name
2019-09-14 13:26:01 +08:00
{
2019-12-08 11:53:15 +08:00
string serverName = args[0];
string databaseName = args[1];
2019-09-14 13:26:01 +08:00
ComparisonForm MainFrom = new ComparisonForm();
2019-12-08 11:53:15 +08:00
MainFrom.LoadFromDesktop(serverName, databaseName);
2019-09-14 13:26:01 +08:00
Application.Run(MainFrom);
2019-12-08 11:53:15 +08:00
return;
2019-09-14 13:26:01 +08:00
}
else
2019-12-08 11:53:15 +08:00
//User opened file with the program
2019-09-14 13:26:01 +08:00
{
2019-12-08 11:53:15 +08:00
string fileName = args[0];
//Check file exists, if not will run without args below
if (File.Exists(fileName))
{
ComparisonForm MainFrom = new ComparisonForm();
MainFrom.LoadFile(fileName);
Application.Run(MainFrom);
return;
}
2019-09-14 13:26:01 +08:00
}
}
2019-12-08 11:53:15 +08:00
//Without valid args
Application.Run(new ComparisonForm());
2019-09-14 13:26:01 +08:00
}
}
}