internal SettingsForm(Mainform owner) { InitializeComponent(); this.Owner = owner; this.monitorSettings = owner.MonitorSettings; this.Database_Textbox.Text = monitorSettings.DatabaseName; this.Machine_TextBox.Text = monitorSettings.ServerName; this.Polling_TextBox.Text = monitorSettings.PollingInterval.ToString(); this.AutoSelectLatest_Checkbox.Checked = monitorSettings.AutoSelectLatest; }
public Mainform() { InitializeComponent(); this.toolStripTextBoxFrom.Text = statusFromDateTime.ToString(); this.toolStripTextBoxUntil.Text = statusUntilDateTime.ToString(); this.toolStripTextBoxWorkflowInstanceId.Text = Guid.Empty.ToString(); this.listViewWorkflows.ListViewItemSorter = new ListViewItemComparer(0, false); this.listViewActivities.ListViewItemSorter = new ListViewItemComparer(0, false); workflowViewHost = new ViewHost(this); workflowViewHost.ZoomChanged += new EventHandler<ViewHost.ZoomChangedEventArgs>(WorkflowViewHost_ZoomChanged); this.trackingSurface.Panel2.SuspendLayout(); this.trackingSurface.Panel2.Controls.Clear(); this.trackingSurface.Panel2.Controls.Add(viewHostLabel); this.trackingSurface.Panel2.Controls.Add(workflowViewHost); this.trackingSurface.Panel2.Controls.Add(workflowViewErrorText); this.trackingSurface.Panel2.ResumeLayout(true); this.monitorSettingsValue = new ApplicationSettings(); this.monitorDatabaseServiceValue = new DatabaseService(); this.workflowStatusList = new Dictionary<string, WorkflowStatusInfo>(); this.activityStatusListValue = new Dictionary<string, ActivityStatusInfo>(); this.monitorSettingsValue.DatabaseName = monitorDatabaseServiceValue.DatabaseName; this.monitorSettingsValue.ServerName = monitorDatabaseServiceValue.ServerName; //Read app settings if (monitorSettingsValue.LoadAppSettings(Application.LocalUserAppDataPath + @"\workflowmonitor.config")) { monitorDatabaseServiceValue.DatabaseName = monitorSettingsValue.DatabaseName; monitorDatabaseServiceValue.ServerName = monitorSettingsValue.ServerName; } else { //If no application settings default to localhost and Tracking for server and database monitorSettingsValue.DatabaseName = "Tracking"; monitorSettingsValue.ServerName = "LocalHost"; monitorSettingsValue.PollingInterval = 5000; monitorSettingsValue.AutoSelectLatest = false; monitorDatabaseServiceValue.DatabaseName = monitorSettingsValue.DatabaseName; monitorDatabaseServiceValue.ServerName = monitorSettingsValue.ServerName; } this.statusLabelDatabaseName.Text = "Connected to: " + monitorDatabaseServiceValue.ServerName + "/" + monitorDatabaseServiceValue.DatabaseName; DisplayWorkflows(selectedWorkflowEvent); }