using System; using System.Reflection; using System.Windows.Forms; namespace SchedulerTool { /// /// This is the main form to get alled from Program.cs file /// public partial class frmScheduler : Form { /// /// Constructor to call respective operations based on argument passed. /// /// Need to pass commandline arguments here, based on arguments scheduler will decide which method to execute public frmScheduler(string[] args) { try { InitializeComponent(); this.Visible = false; if (args?.Length == 0) { return; } if(args[0].Contains("googlesheetimport")) { var googleSheetImports = new GoogleSheetImports(); googleSheetImports.ExecuteGoogleSheetImportMethods(args); } } catch (Exception ex) { LogWriter.LogInfo($"{ex.Message}\r\n {ex.StackTrace}", $"{MethodBase.GetCurrentMethod().Name} - {args[0]}"); return; } finally { this.Close(); } } } }