Beispiel #1
0
        private ListViewItemComparer.JobListItemComparer _lvwJobItemComparer; // joblist sorter

        #endregion Fields

        #region Constructors

        public GUI()
        {
            InitializeComponent();
            InitColumnsStyle();

            // look for logo in current directory
            //this.logo_webbrowser.Url = new System.Uri(Directory.GetCurrentDirectory() + "\\Tools\\small_bt_logo.gif", System.UriKind.Absolute);

            //Version vrs = new Version(Application.ProductVersion);

            // display a round edged rectangle. doesnt trace/work with borders though.
            //TestRoundRectanglePanel.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, TestRoundRectanglePanel.Width - 10, TestRoundRectanglePanel.Height - 10, 20, 20));
            UpdateMainTitle();

            // The ListViewItemSorter property allows you to specify the object that performs the sorting of items in the ListView.
            // You can use the ListViewItemSorter property in combination with the Sort method to perform custom sorting.
            _lvwItemComparer = new ListViewItemComparer();

            _lvwItemComparerBadScenes = new ListViewItemComparer();
            BadSceneListView.ListViewItemSorter = _lvwItemComparerBadScenes;

            _lvwJobItemComparer = new ListViewItemComparer.JobListItemComparer();

            //GsummaryList = new BindingList<VStream>();
            SummaryList = new List<VStream>();
            //SummaryBindingList = new BindingList<VStream>();

            //GjobList = new BindingList<Job>();
            padlock = new object();
            jobList = new BindingList<Job>();

            CloseInterfaces();

            #region Threading / events init code. // setup events and the thread scanning the stream folders

            // init the qavod class

            qatool = new qavod.qaClass();

            // Wire up the qaclass event so we can respond to them when they fire
            //qatool.NewJobListEvent            += new qatoolEventH (onNewJobList);
            qatool.RemoveJobEvent += new qatoolEventH(RemoveJobFromList);
            qatool.EditJobEvent += new qatoolEventH(EditJobInList);
            qatool.AddJobEvent += new qatoolEventH(AddJobToList);
            FoldersManager.NewProfileForJobEvent += new qatoolEventH(EditJobInList);
            JobManager.RefreshJobEvent += new qatoolEventH(EditJobInList);
            JobManager.RefreshCoresEvent += new qatoolEventH2(updategui);

            //qatool.NewStreamListEvent         += new qatoolEventH (onNewStreamList);
            qatool.RemoveSummaryEvent += new qatoolEventH(RemoveSummaryFromList);
            qatool.EditSummaryEvent += new qatoolEventH(EditSummaryInList);
            qatool.AddSummaryEvent += new qatoolEventH(AddSummaryToList);

            Global.NewGuiLogEvent += new qatoolEventH(GuilogEvent);

            qatool.JobListButtonsEvent += new qatoolEventH(updatejoblistbuttons);
            qatool.UpdateGuiEvent += new qatoolEventH2(updategui);
            qaClass.UpdateGuisourceFoldersEvent += new qatoolEventH2(UpdateFoldersGui);
            WatchedFolder.UpdateGUIFoldersEvent += new qatoolEventH2(UpdateFoldersGui);

            refreshListTimer.Interval = 1000;
            refreshListTimer.Enabled = true;

            ResultListView = new BrightIdeasSoftware.DataListView();
            //ResultListView = new BrightIdeasSoftware.FastObjectListView();
            FailedResultListView = new BrightIdeasSoftware.DataListView();
            JobListView = new BrightIdeasSoftware.DataListView();

            // load gui settings
            GUIsettings = new GuiSettings();
            GUIsettings = GUIsettings.Load();

            // set joblist view bindings
            SetJoblistBinding();

            // set results view bindings
            SetResultListBinding();
            SetFailedResultListBinding(); //Melek

            // Restore GUI settings
            RestoreGUIsettings();

            // Set up and run the qavod thread and start monitoring streams
            qatoolThread = new Thread(new ThreadStart(qatool.MonitorStreams)) { Name = "Monitor Streams" };
            qatoolThread.Start();

            #endregion
        }
Beispiel #2
0
 private void OnCheckClearClick(DataListView dataListView, CheckBox chk)
 {
     if (dataListView.SelectedItems.Count == 0)
     {
         foreach (OLVListItem selectedObject in dataListView.Items)
         {
             selectedObject.Checked = chk.Checked;
         }
     }
     else
     {
         foreach (OLVListItem selectedObject in dataListView.SelectedItems)
         {
             selectedObject.Checked = chk.Checked;
         }
     }
 }
        private static void TimedFilter(DataListView olv, string txt,
            TextMatchFilter.MatchKind matchKind = TextMatchFilter.MatchKind.Text)
        {
            TextMatchFilter filter = null;
            if (!String.IsNullOrEmpty(txt))
                filter = new TextMatchFilter(olv, txt, matchKind);

            // Setup a default renderer to draw the filter matches
            olv.DefaultRenderer = filter == null ? null : new HighlightTextRenderer(filter);

            // Some lists have renderers already installed
            var highlightingRenderer = olv.GetColumn(0).Renderer as HighlightTextRenderer;
            if (highlightingRenderer != null)
                highlightingRenderer.Filter = filter;

            var stopWatch = new Stopwatch();
            stopWatch.Start();
            olv.ModelFilter = filter;
            stopWatch.Stop();
        }