public BatchRvtGuiForm() { InitializeComponent(); this.Settings = new BatchRvtSettings(); this.UIConfiguration = new UIConfig(GetUIConfigItems()); }
private bool LoadSettings(string filePath = null) { var newBatchRvtSettings = new BatchRvtSettings(); bool isLoaded = newBatchRvtSettings.LoadFromFile(filePath); if (isLoaded) { this.Settings = newBatchRvtSettings; } this.UIConfiguration.UpdateUI(); VerifyExcelInstallation(this.revitFileListTextBox.Text); return(isLoaded); }
private void startButton_Click(object sender, EventArgs e) { this.UIConfiguration.UpdateConfig(); bool validated = ValidateConfig(); if (validated) { bool isSaved = SaveSettings(); // TODO: show error message if save failed!! var settingsFilePath = BatchRvtSettings.GetDefaultSettingsFilePath(); this.batchRvtProcess = BatchRvt.StartBatchRvt(settingsFilePath); this.readBatchRvtOutput_Timer = new Timer() { Interval = READ_OUTPUT_INTERVAL_IN_MS }; this.readBatchRvtOutput_Timer.Tick += readBatchRvtOutput_Timer_Tick; this.isBatchRvtRunning = true; this.settingsGroupBox.Enabled = false; this.importSettingsButton.Enabled = false; this.startButton.Enabled = false; this.startButton.Text = "Running..."; this.batchRvtOutputGroupBox.Visible = true; this.MinimumSize = RUNNING_MINIMUM_SIZE; this.MaximumSize = RUNNING_MAXIMUM_SIZE; this.Size = RUNNING_INITIAL_SIZE; this.MaximizeBox = true; UpdateAdvancedSettings(); AdjustWindowSizeForDisplaySetting(); readBatchRvtOutput_Timer.Start(); } }