示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        void WorkflowViewHost_ZoomChanged(object sender, ViewHost.ZoomChangedEventArgs e)
        {
            // Fires when control is resized via combo box or Fit to Size button.
            // If the dropdown is already correct, return.
            if (e.Zoom.ToString().Equals(this.toolStripComboBoxZoom.Text.Trim(new Char[] {'%'})))
                return;

            //Return dropdown to 100 percent
            this.toolStripComboBoxZoom.SelectedIndex = 2;
        }