Example #1
0
        public void SetFailedResultListBinding()
        {
            FailedResultListView.MultiSelect = true;//Melek
            FailedResultListView.SmallImageList = this.imageList1;
            FailedResultListView.RowHeight = 20;
            FailedResultListView.Location = new System.Drawing.Point(0, 0);
            FailedResultListView.Scrollable = true;
            FailedResultListView.BackColor = System.Drawing.Color.Gainsboro;
            FailedStreamsPanel.Controls.Add(FailedResultListView);
            FailedResultListView.Dock = DockStyle.Fill;
            FailedResultListView.FormatRow += new System.EventHandler<BrightIdeasSoftware.FormatRowEventArgs>(this.FailedResultListView_FormatRow);
            //FailedResultListView.FormatRow -= new System.EventHandler<BrightIdeasSoftware.FormatRowEventArgs>(this.FailedResultListView_FormatRow);//Melek - remove the eventhandler - Memory Allocation
            FailedResultListView.EmptyListMsg = "No result at the moment.";
            FailedResultListView.AllowColumnReorder = true;

            #region defines all columns of result view

            OLVColumn RColStreamName = new OLVColumn();
            RColStreamName.AspectName = "StreamFileName";
            RColStreamName.HeaderFont = null;
            RColStreamName.IsTileViewColumn = true;
            RColStreamName.Text = "Name";
            RColStreamName.Width = 610;
            RColStreamName.ImageGetter = delegate(object row)
            {
                switch (((VStream)row).Final_Decision.Made)
                {
                    case Decision.FAIL:
                        return "lred16.png";
                    case Decision.BORDERLINE:
                        return "lamber16.png";
                    case Decision.PASS:
                        return "lgreen16.png";
                    default:
                        return "lgrey16.png";
                }

            };

            FailedResultListView.AllColumns.Add(RColStreamName);

            #endregion

            FailedResultListView.DataSource = SummaryList;

            FailedResultListView.Name = "FailedResultDataListView";
            FailedResultListView.ShowGroups = false;
            FailedResultListView.GridLines = true;
            FailedResultListView.FullRowSelect = true;

            //FailedResultListView.DoubleClick += new System.EventHandler(ListViewDataSetSelectedIndexChanged);
            FailedResultListView.DoubleClick += new System.EventHandler(ListViewDataSetSelectedIndexChanged);
            // FailedResultListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(ListViewDataSetSelectedIndexChanged);

            //FailedResultListView.SelectedIndexChanged += new System.EventHandler(this.FailedResultsListViewDataSetSelectedIndexChanged);//Melek
            FailedResultListView.CellClick += new EventHandler<BrightIdeasSoftware.CellClickEventArgs>(this.FailedResultsListViewDataSetSelectedIndexChanged);//Melek

            //  FailedResultListView.Click += new System.EventHandler(ListViewDataSetSelectedIndexChanged2);//Melek - Click event is not working

            //  FailedResultListView.DoubleClick -= new System.EventHandler(ListViewDataSetSelectedIndexChanged); //Melek - remove the eventhandler - Memory Allocation
            //   FailedResultListView.MouseHover += new System.EventHandler(ListViewMouseHover); //Melek - display the thumbnail of the video clip

            // FailedResultListView.MouseEnter += new System.EventHandler(ListViewMouseEnter); //Melek -

            // FailedResultListView.MouseMove += new System.Windows.Forms.MouseEventHandler(ListViewThumbnailDisplay);

            // FailedResultListView.MouseLeave += new System.EventHandler(ListViewThumbnailDisplay); //Melek -Close the popup window
            // FailedResultListView.Click += new System.EventHandler(ListViewMouseClick);

            //FailedResultListView.HighlightBackgroundColor = System.Drawing.Color.Crimson;
            //FailedResultListView.HighlightForegroundColor = System.Drawing.Color.White;
            FailedResultListView.UseCellFormatEvents = true;
            // Hot item settings
            FailedResultListView.UseHotItem = true;
            FailedResultListView.UseTranslucentHotItem = true;

            RowBorderDecoration rbd = new RowBorderDecoration();
            rbd.BorderPen = new Pen(Color.Black, 2);
            rbd.FillBrush = null;
            rbd.CornerRounding = 4.0f;

            HotItemStyle hotItemStyle2 = new HotItemStyle();
            hotItemStyle2.Decoration = rbd;

            HotItemStyle hotItemStyle = new HotItemStyle();
            hotItemStyle.ForeColor = Color.AliceBlue;

            #region new column style - Melek

            hotItemStyle.BackColor = Color.FromArgb(255, 64, 64, 64);
            hotItemStyle.BackColor = Color.Gainsboro;
            hotItemStyle.Font = new System.Drawing.Font(Font.FontFamily, Font.Size + 2, FontStyle.Regular);
            hotItemStyle.Decoration = rbd;
            hotItemStyle.ForeColor = Color.Black;

            #endregion end of new column style - Melek

            FailedResultListView.HotItemStyle = hotItemStyle;
            FailedResultListView.UseFiltering = true;
            FailedResultListView.CellRightClick += new EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.FailedResultListView_CellRightClick);
            //FailedResultListView.CellRightClick -= new EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.FailedResultListView_CellRightClick); //Melek - remove the eventhandler - Memory Allocation
            // layout
            FailedResultListView.HeaderFormatStyle = headerFormatStyleData;
            FailedResultListView.HeaderUsesThemes = false;

            FailedResultListView.RebuildColumns();
        }
Example #2
0
        /// <summary>
        /// Define Result DataListView, columnsm, binding
        /// </summary>
        public void SetResultListBinding()
        {
            ResultListView.MultiSelect = true;//Melek
            //ResultListView.DataBindings.
            ResultListView.SmallImageList = this.imageList1;
            ResultListView.RowHeight = 20;

            ResultListView.Location = new System.Drawing.Point(8, 101);
            ResultListView.Size = new System.Drawing.Size(1250, 585);
            ResultListView.BackColor = System.Drawing.Color.Gainsboro;

            //ResultListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            //            | System.Windows.Forms.AnchorStyles.Left)
            //            | System.Windows.Forms.AnchorStyles.Right)));
            //MonitoringTab.Controls.Add(ResultListView);
            ResultsView_Panel.Controls.Add(ResultListView);
            ResultListView.Dock = DockStyle.Fill;
            ResultListView.FormatRow += new System.EventHandler<BrightIdeasSoftware.FormatRowEventArgs>(this.ResultListView_FormatRow);
            // ResultListView.FormatRow -= new System.EventHandler<BrightIdeasSoftware.FormatRowEventArgs>(this.ResultListView_FormatRow);//Melek - remove the eventhandler - Memory Allocation
            // handle selection of a stream
            ResultListView.EmptyListMsg = "No result at the moment.";
            ResultListView.AllowColumnReorder = true;

            #region defines all columns of result view

            //OLVColumn RColJobID = new OLVColumn();
            //RColJobID.AspectName = "JobID"; // name of the get parameter to get the value from
            //RColJobID.HeaderFont = null;
            //RColJobID.IsTileViewColumn = true;
            //RColJobID.Text = "Job ID";
            //RColJobID.Width = 60;
            //ResultListView.AllColumns.Add(RColJobID);

            OLVColumn RColStreamName = new OLVColumn();
            RColStreamName.AspectName = "StreamFileName";
            RColStreamName.HeaderFont = null;
            RColStreamName.IsTileViewColumn = true;
            RColStreamName.Text = "Name";
            RColStreamName.Width = 510;
            RColStreamName.ImageGetter = delegate(object row)
            {
                switch (((VStream)row).Final_Decision.Made)
                {
                    case Decision.FAIL:
                        return "lred16.png";
                    case Decision.BORDERLINE:
                        return "lamber16.png";
                    case Decision.PASS:
                        return "lgreen16.png";
                    default:
                        return "lgrey16.png";
                }
            };

            ResultListView.AllColumns.Add(RColStreamName);

            OLVColumn RProfile = new OLVColumn();
            RProfile.AspectName = "QualityProfile";
            RProfile.HeaderFont = null;
            RProfile.IsTileViewColumn = true;
            RProfile.Text = "Quality Profile";
            RProfile.Width = 100;
            ResultListView.AllColumns.Add(RProfile);

            OLVColumn RAvMOSstd = new OLVColumn();
            RAvMOSstd.AspectName = "AvMOSStdDev";
            RAvMOSstd.HeaderFont = null;
            RAvMOSstd.IsTileViewColumn = true;
            RAvMOSstd.Text = "Av.MOS (Std.dev)";
            RAvMOSstd.Width = 80;
            ResultListView.AllColumns.Add(RAvMOSstd);

            OLVColumn RColBadPerc = new OLVColumn();
            RColBadPerc.AspectName = "BadPerc";
            RColBadPerc.HeaderFont = null;
            RColBadPerc.IsTileViewColumn = true;
            RColBadPerc.Text = "Bad %";
            RColBadPerc.TextAlign = HorizontalAlignment.Center;
            RColBadPerc.Width = 50;
            TextBarRenderer BadPercRenderer = new TextBarRenderer();
            BadPercRenderer.UseStandardBar = false;
            BadPercRenderer.BackgroundColor = Colours.pass_backColor;
            BadPercRenderer.GradientStartColor = Colours.borderline_backColor;
            BadPercRenderer.GradientEndColor = System.Drawing.Color.Crimson;
            BadPercRenderer.MaximumValue = 100;
            BadPercRenderer.MinimumValue = 0;
            RColBadPerc.Renderer = BadPercRenderer;
            ResultListView.AllColumns.Add(RColBadPerc);

            OLVColumn RColTroughWarning = new OLVColumn();
            RColTroughWarning.AspectName = "TroughWarning";
            RColTroughWarning.HeaderFont = null;
            RColTroughWarning.IsTileViewColumn = true;
            RColTroughWarning.Text = "Troughs";
            RColTroughWarning.Width = 60;
            ResultListView.AllColumns.Add(RColTroughWarning);

            OLVColumn RColBlankWarning = new OLVColumn();
            RColBlankWarning.AspectName = "BlankWarning";
            RColBlankWarning.HeaderFont = null;
            RColBlankWarning.IsTileViewColumn = true;
            RColBlankWarning.Text = "Blank";
            RColBlankWarning.Width = 50;
            ResultListView.AllColumns.Add(RColBlankWarning);

            //OLVColumn RColFrozenWarning = new OLVColumn();
            //RColFrozenWarning.AspectName = "FrozenWarning";
            //RColFrozenWarning.HeaderFont = null;
            //RColFrozenWarning.IsTileViewColumn = true;
            //RColFrozenWarning.Text = "Froz.";
            //RColFrozenWarning.Width = 50;
            //ResultListView.AllColumns.Add(RColFrozenWarning);

            OLVColumn RColVideo = new OLVColumn();
            RColVideo.AspectName = "Video";
            RColVideo.HeaderFont = null;
            RColVideo.IsTileViewColumn = true;
            RColVideo.Text = "Video";
            RColVideo.Width = 110;
            ResultListView.AllColumns.Add(RColVideo);

            OLVColumn RColProfile = new OLVColumn();
            RColProfile.AspectName = "VideoCodecProfile";
            RColProfile.HeaderFont = null;
            RColProfile.IsTileViewColumn = true;
            RColProfile.Text = "Codec Profile";
            RColProfile.Width = 70;
            //ResultListView.AllColumns.Add(RColProfile);

            OLVColumn RColLabRes = new OLVColumn();
            RColLabRes.AspectName = "ResolutionLabel";
            RColLabRes.HeaderFont = null;
            RColLabRes.IsTileViewColumn = true;
            RColLabRes.Text = "Format";
            RColLabRes.Width = 70;
            ResultListView.AllColumns.Add(RColLabRes);

            OLVColumn RColRes = new OLVColumn();
            RColRes.AspectName = "Resolution";
            RColRes.HeaderFont = null;
            RColRes.IsTileViewColumn = true;
            RColRes.Text = "Resolution";
            RColRes.Width = 70;
            RColRes.IsVisible = true;
            ResultListView.AllColumns.Add(RColRes);

            OLVColumn RColAR = new OLVColumn();
            RColAR.AspectName = "DisplayAspectRatioString";
            RColAR.HeaderFont = null;
            RColAR.IsTileViewColumn = true;
            RColAR.Text = "A.R.";
            RColAR.Width = 50;
            ResultListView.AllColumns.Add(RColAR);

            OLVColumn RColAudio = new OLVColumn();
            RColAudio.AspectName = "AudioSummary";
            RColAudio.HeaderFont = null;
            RColAudio.IsTileViewColumn = true;
            RColAudio.Text = "Audio";
            RColAudio.Width = 130;
            ResultListView.AllColumns.Add(RColAudio);

            //OLVColumn RMOS = new OLVColumn();
            //RMOS.AspectName = "avMOS";
            //RMOS.HeaderFont = null;
            //RMOS.IsTileViewColumn = true;
            //RMOS.Text = "Average MOS";
            //RMOS.Width = 80;
            //PartialMultiImageRenderer mosRenderer = new PartialMultiImageRenderer("star16.png", 5, 1, 5);
            //RMOS.Renderer = mosRenderer;
            //ResultListView.AllColumns.Add(RMOS);

            //OLVColumn RColFieldWarning = new OLVColumn();
            //RColFieldWarning.AspectName = "FieldWarning";
            //RColFieldWarning.HeaderFont = null;
            //RColFieldWarning.IsTileViewColumn = true;
            //RColFieldWarning.Text = "Fields";
            //RColFieldWarning.Width = 50;
            //ResultListView.AllColumns.Add(RColFieldWarning);

            OLVColumn RColDuration = new OLVColumn();
            RColDuration.AspectName = "VideoDurationString";
            RColDuration.HeaderFont = null;
            RColDuration.IsTileViewColumn = true;
            RColDuration.Text = "Duration";
            RColDuration.Width = 60;
            ResultListView.AllColumns.Add(RColDuration);

            OLVColumn RColCompletedDate = new OLVColumn();
            RColCompletedDate.AspectName = "CompletedDate";
            RColCompletedDate.HeaderFont = null;
            RColCompletedDate.IsTileViewColumn = true;
            RColCompletedDate.Text = "Completed";
            RColCompletedDate.Width = 120;
            ResultListView.AllColumns.Add(RColCompletedDate);

            OLVColumn RPath = new BrightIdeasSoftware.OLVColumn();
            RPath.AspectName = "StreamPath";
            RPath.HeaderFont = null;
            RPath.IsTileViewColumn = true;
            RPath.Text = "Path";
            RPath.Width = 230;
            ResultListView.AllColumns.Add(RPath);

            OLVColumn RColComment = new OLVColumn();
            RColComment.AspectName = "Comment";
            RColComment.HeaderFont = null;
            RColComment.IsTileViewColumn = true;
            RColComment.Text = "Comment";
            RColComment.Width = 150;
            ResultListView.AllColumns.Add(RColComment);

            #endregion

            ResultListView.DataSource = SummaryList;

            ResultListView.Name = "ResultDataListView";
            ResultListView.ShowGroups = false;
            ResultListView.GridLines = true;

            ResultListView.FullRowSelect = true;
            ResultListView.DoubleClick += new System.EventHandler(ListViewDataSetSelectedIndexChanged);
            //ResultListView.SelectedIndexChanged += new System.EventHandler(this.ResultsListViewDataSetSelectedIndexChanged); //Melek

            // ResultListView.CellClick +=  new EventHandler<BrightIdeasSoftware.CellClickEventArgs>(this.ResultsListViewDataSetSelectedIndexChanged); //Melek

            // ResultListView.DoubleClick -= new System.EventHandler(ListViewDataSetSelectedIndexChanged);//Melek - remove the eventhandler - Memory Allocation
            //ResultListView.HighlightBackgroundColor = System.Drawing.Color.Crimson;
            //ResultListView.HighlightForegroundColor = System.Drawing.Color.White;

            ResultListView.UseCellFormatEvents = true;

            // Hot item settings
            ResultListView.UseHotItem = true;
            ResultListView.UseTranslucentHotItem = true;

            RowBorderDecoration rbd = new RowBorderDecoration();
            rbd.BorderPen = new Pen(Color.Black, 2);
            rbd.FillBrush = null;
            rbd.CornerRounding = 4.0f;
            HotItemStyle hotItemStyle2 = new HotItemStyle();
            hotItemStyle2.Decoration = rbd;

            HotItemStyle hotItemStyle = new HotItemStyle();
            hotItemStyle.ForeColor = Color.AliceBlue;
            //hotItemStyle.BackColor = Color.FromArgb(255, 64, 64, 64);

            #region new column style - Melek

            hotItemStyle.BackColor = Color.Gainsboro;
            hotItemStyle.ForeColor = Color.Black;
            hotItemStyle.Font = new System.Drawing.Font(Font.FontFamily, Font.Size + 2, FontStyle.Regular);
            hotItemStyle.Decoration = rbd;

            #endregion end of  new column style - Melek

            ResultListView.HotItemStyle = hotItemStyle;
            ResultListView.UseFiltering = true;
            ResultListView.CellRightClick += new EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.ResultListView_CellRightClick);
            // ResultListView.CellRightClick -= new EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.ResultListView_CellRightClick); //Melek - remove the eventhandler - Memory Allocation
            // layout
            ResultListView.HeaderFormatStyle = headerFormatStyleData;
            ResultListView.HeaderUsesThemes = false;
            ResultListView.RebuildColumns();
        }