/// <summary> /// Call this method first. This initializes everything that is /// necessary to run the application. /// </summary> /// <param name="MyMeta"></param> /// <param name="zeus"></param> public void Init(MyMeta.dbRoot MyMeta, Zeus.IZeusContext zeus, IZeusInput input, Dnp.Utils.Utils dnp, Dnp.Utils.ProgressDialog progressDialog) { // Initialize the ScriptSettings and save the input values from the MyGeneration form. try { _scriptSettings = ScriptSettings.InitInstance(input, MyMeta, dnp, _version); //_scriptSettings = new ScriptSettings(input, MyMeta, dnp, _version); _scriptSettings.SaveSettings(); } catch (Exception ex) { if (ex.InnerException != null) { throw new Exception("Error Saving ScriptSettings (inner): " + ex.InnerException.Message); } throw new Exception("Error Saving ScriptSettings: " + ex.Message + " - " + ex.StackTrace.ToString()); } // Populate the RequestContext class with all the values // needed to be passed to every code generating class. RequestContext context = new RequestContext(); context.Zeus = zeus; // Pass along the MyGeneration output context for saving files context.MyMeta = MyMeta; // Pass along the Database meta properties context.FileList = _fileList; // Start the ArrayList for printing the generated files context.ScriptSettings = _scriptSettings; // Store the saved form values context.Dialog = new ProgressDialogWrapper(progressDialog); // Get instance of Dialog wrapper context.Database = MyMeta.Databases[_scriptSettings.DatabaseName]; // Get the selected database context.Utility = new CommonUtility(); // Get instance of helper utility _context = context; }