Exemplo n.º 1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (ControlsHelper.IsDesignMode(this))
            {
                return;
            }
            // List which contains all issues.
            var scheduler = TaskScheduler.FromCurrentSynchronizationContext();

            IssueList = new BindingListInvoked <IssueItem>();
            UpdateIgnoreAllButton();
            // List which is bound to the grid and displays issues, which needs user attention.
            Warnings = new BindingListInvoked <IssueItem>();
            Warnings.SynchronizingObject = scheduler;
            MainDataGrid.ItemsSource     = Warnings;
            UpdateIgnoreButton();
            // Timer which checks for the issues.
            var ai    = new JocysCom.ClassLibrary.Configuration.AssemblyInfo();
            var title = ai.GetTitle(true, true, true, true, false) + " - Issues";

            TasksTimer                    = new QueueTimer <object>(0, 0);
            TasksTimer.DoWork            += queueTimer_DoWork;
            TasksTimer.Queue.ListChanged += Data_ListChanged;
            // Start monitoring tasks queue.
            QueueMonitorTimer       = new System.Windows.Forms.Timer();
            QueueMonitorTimer.Tick += QueueMonitorTimer_Tick;
            QueueMonitorTimer.Start();
        }
Exemplo n.º 2
0
        public CloudUserControl()
        {
            InitializeComponent();
            if (IsDesignMode)
            {
                return;
            }
            JocysCom.ClassLibrary.Controls.ControlsHelper.ApplyBorderStyle(TasksDataGridView);
            EngineHelper.EnableDoubleBuffering(TasksDataGridView);
            InitNetworkInformation();
            // Enable task timer.
            TasksTimer                            = new JocysCom.ClassLibrary.Threading.QueueTimer <CloudItem>(0, 5000, this);
            TasksTimer.DoWork                    += queueTimer_DoWork;
            TasksTimer.Queue.ListChanged         += Data_ListChanged;
            TasksDataGridView.AutoGenerateColumns = false;
            // Suspend errors.
            TasksDataGridView.DataError += TasksDataGridView_DataError;
            // Attach
            TasksDataGridView.DataSource = TasksTimer.Queue;
            // Force to create handle.
            var handle = this.Handle;

            // Start monitoring tasks queue.
            QueueMonitorTimer.Start();
        }
Exemplo n.º 3
0
        public IssuesUserControl()
        {
            InitializeComponent();
            if (IsDesignMode)
            {
                return;
            }
            NoIssuesPanel.Visible       = false;
            LinePanel.Visible           = false;
            ExceptionInfoButton.Visible = false;
            // List which contains all issues.
            IssueList = new BindingListInvoked <IssueItem>();
            IssueList.SynchronizingObject = this;
            IssueList.ListChanged        += IssueList_ListChanged;
            UpdateIgnoreAllButton();
            // List which is bound to the grid and displays issues, which needs user attention.
            Warnings = new BindingListInvoked <IssueItem>();
            Warnings.SynchronizingObject = this;
            // Configure data grid.
            ControlsHelper.ApplyBorderStyle(WarningsDataGridView);
            WarningsDataGridView.AutoGenerateColumns = false;
            WarningsDataGridView.DataSource          = Warnings;
            UpdateIgnoreButton();
            // Timer which checks for the issues.
            var ai    = new JocysCom.ClassLibrary.Configuration.AssemblyInfo();
            var title = ai.GetTitle(true, true, true, true, false) + " - Issues";

            Text                          = title;
            TasksTimer                    = new JocysCom.ClassLibrary.Threading.QueueTimer <object>(0, 5000, this);
            TasksTimer.DoWork            += queueTimer_DoWork;
            TasksTimer.Queue.ListChanged += Data_ListChanged;
            // Start monitoring tasks queue.
            QueueMonitorTimer.Start();
        }
Exemplo n.º 4
0
        public CloudUserControl()
        {
            InitializeComponent();
            if (IsDesignMode)
            {
                return;
            }
            // Make font more consistent with the rest of the interface.
            Controls.OfType <ToolStrip>().ToList().ForEach(x => x.Font = Font);
            JocysCom.ClassLibrary.Controls.ControlsHelper.ApplyBorderStyle(TasksDataGridView);
            EngineHelper.EnableDoubleBuffering(TasksDataGridView);
            InitNetworkInformation();
            // Enable task timer.
            var scheduler = TaskScheduler.FromCurrentSynchronizationContext();

            TasksTimer                            = new JocysCom.ClassLibrary.Threading.QueueTimer <CloudItem>(0, 5000, scheduler);
            HandleCreated                        += (sender, e) => { TasksTimer.HasHandle = true; };
            HandleDestroyed                      += (sender, e) => { TasksTimer.HasHandle = false; };
            TasksTimer.HasHandle                  = IsHandleCreated;
            TasksTimer.DoWork                    += queueTimer_DoWork;
            TasksTimer.Queue.ListChanged         += Data_ListChanged;
            TasksDataGridView.AutoGenerateColumns = false;
            // Suspend errors.
            TasksDataGridView.DataError += TasksDataGridView_DataError;
            // Attach
            TasksDataGridView.DataSource = TasksTimer.Queue;
            // Force to create handle.
            var handle = this.Handle;

            // Start monitoring tasks queue.
            QueueMonitorTimer.Start();
        }