/// <summary>
        /// Colors the input row depending on the the task's date and time which it contains.
        /// </summary>
        /// <param name="row">The rows to format</param>
        public void ColorRows(BrightIdeasSoftware.FormatRowEventArgs row)
        {
            Task task = (Task)row.Item.RowObject;

            if (task == null) return; // log exception

            // Task is done!
            if (task.DoneState == true)
            {
                ColorSubItems(row, settings.GetTaskDoneColor());
            }

            else if (task is TaskDeadline)
            {
                // Deadline task is over time limit!
                if (task.IsWithinTime(DateTime.MinValue, DateTime.Now))
                    ColorSubItems(row, settings.GetTaskMissedDeadlineColor());
                // Task is within the next 24 hrs!
                else if (task.IsWithinTime(DateTime.Now, DateTime.Now.AddDays(1)))
                    ColorSubItems(row, settings.GetTaskNearingDeadlineColor());
            }

            else if (task is TaskEvent)
            {
                // Task has already started or is over!
                if (task.IsWithinTime(DateTime.MinValue, DateTime.Now))
                    ColorSubItems(row, settings.GetTaskOverColor());
            }
        }
 public void Formater(BrightIdeasSoftware.ObjectListView listview, BrightIdeasSoftware.OLVColumn column, bool isSHow)
 {
     if (column.Name == "OrderNumber")
     {
         column.AspectGetter = delegate(object x) { return ((Manufacturer)x).manufacturerID; };
     }
     else
     {
         switch (column.Name)
         {
             case "manufacturerName":
                 column.AspectGetter = delegate(object x) { return ((Manufacturer)x).manufacturerName; };
                 break;
             case "manufacturerTel":
                 column.AspectGetter = delegate(object x) { return ((Manufacturer)x).manufacturerTel; };
                 break;
             case "manufacturerAdd":
                 column.AspectGetter = delegate(object x) { return ((Manufacturer)x).manufacturerAdd; };
                 break;
             default:
                 column.AspectGetter = delegate(object x) { return ""; };
                 break;
         }
     }
 }
Exemplo n.º 3
0
 private void lvIndicators_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
 {
     e.Handled = true;
     IndicatorAdd modal = new IndicatorAdd(model.Indicators.Values, (Indicator)e.Model);
     modal.OnSave += edit_OnSave;
     modal.ShowDialog();
 }
Exemplo n.º 4
0
        public override void Draw(BrightIdeasSoftware.ObjectListView olv, Graphics g, Rectangle r) {
            Rectangle cellBounds = this.CellBounds;
            cellBounds.Inflate(-this.CellPadding.Width, -this.CellPadding.Height);
            Rectangle textBounds = cellBounds;

            if (this.ImageList != null && !String.IsNullOrEmpty(this.ImageName)) {
                g.DrawImage(this.ImageList.Images[this.ImageName], cellBounds.Location);
                textBounds.X += this.ImageList.ImageSize.Width;
                textBounds.Width -= this.ImageList.ImageSize.Width;
            }

            //g.DrawRectangle(Pens.Red, textBounds);

            // Draw the title
            StringFormat fmt = new StringFormat(StringFormatFlags.NoWrap);
            fmt.Trimming = StringTrimming.EllipsisCharacter;
            fmt.Alignment = StringAlignment.Near;
            fmt.LineAlignment = StringAlignment.Near;

            using (SolidBrush b = new SolidBrush(this.TitleColor)) {
                g.DrawString(this.Title, this.TitleFont, b, textBounds, fmt);
            }

            // Draw the description
            SizeF size = g.MeasureString(this.Title, this.TitleFont, (int)textBounds.Width, fmt);
            textBounds.Y += (int)size.Height;
            textBounds.Height -= (int)size.Height;
            StringFormat fmt2 = new StringFormat();
            fmt2.Trimming = StringTrimming.EllipsisCharacter;
            using (SolidBrush b = new SolidBrush(this.DescriptionColor)) {
                g.DrawString(this.Description, this.DescripionFont, b, textBounds, fmt2);
            }
        }
Exemplo n.º 5
0
 private void treeAvailable_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
 {
     e.Handled = true;
     options.Source = (AdminLevel)e.Model;
     options.Source.CurrentDemography = repo.GetRecentDemography(options.Source.Id);
     options.SplitChildren = repo.GetAdminLevelChildren(options.Source.Id);
     OnSwitchStep(new SplittingIntoNumber(options));
 }
Exemplo n.º 6
0
 void mTextBox_FormatRow( object sender, BrightIdeasSoftware.FormatRowEventArgs e )
 {
     LogItem logItem = ( LogItem )e.Model;
     if ( logItem != null )
     {
         e.Item.ForeColor = logItem.ForeColor;
         e.Item.BackColor = logItem.BackColor;
     }
 }
Exemplo n.º 7
0
 void OnDoorsCellEditFinishing(
     object sender,
     BrightIdeasSoftware.CellEditEventArgs e)
 {
     if ( !e.Cancel )
       {
     ExportData( e.RowObject as DoorData );
       }
 }
Exemplo n.º 8
0
 void OnDoorsCellEditValidating(
     object sender,
     BrightIdeasSoftware.CellEditEventArgs e)
 {
     if ( !e.Cancel )
       {
     ( (DoorData) e.RowObject ).firerating
       = double.Parse( e.Control.Text );
       }
 }
Exemplo n.º 9
0
 private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e) {
     if (e.ColumnIndex == 0) {
         Task task = (Task)e.Model;
         NamedDescriptionDecoration decoration = new NamedDescriptionDecoration();
         decoration.ImageList = this.imageListLarge;
         decoration.Title = task.Feature;
         decoration.ImageName = task.FeatureIcon;
         decoration.Description = task.Description;
         e.SubItem.Decoration = decoration;
     }
 }
Exemplo n.º 10
0
 private void objList_RowNumberDblClick(BrightIdeasSoftware.OlvListViewHitTestInfo hti)
 {
     frmProduct frmPro = new frmProduct(BOIDEnum.Product);
     frmPro.MdiParent = this.MdiParent;
     FormExchangeParams args = new FormExchangeParams();
     args.Data = hti.RowObject;
     args.Mode = FormMode.Ok;
     args.ReturnProc = UpdateProMdRetProc;
     frmPro.SetFormExchangeParams(args);
     frmPro.Show();
 }
Exemplo n.º 11
0
        private void OLVCars_BeforeCreatingGroups(object sender, BrightIdeasSoftware.CreateGroupsEventArgs e)
        {
            this.olvColumn1.MakeGroupies(new string[] { "Jeep", "Mazda" }, new string[] { "Car", "Cool Car", "Dumb Car" },
                new string[] { "not", "hamburger", "toast" },
                new string[] { "Pay good money -- or flee the house -- rather than eat their homecooked food",
                                "Offer to buy takeaway rather than risk what may appear on your plate",
                                "Neither spectacular nor dangerous" },
                new string[] { "", "Open calendar", "Check bank balance" });

            OLVCars.UseAlternatingBackColors = true;
            OLVCars.ShowItemCountOnGroups = true;
        }
Exemplo n.º 12
0
 private void AttributesRightClick(object sender, BrightIdeasSoftware.CellRightClickEventArgs e)
 {
     if (this.AttributesContextMenuStrip == null)
     {
         this.AttributesContextMenuStrip = new ContextMenuStrip();
         this.AttributesContextMenuStrip.Items.AddRange(System.Enum.GetNames(typeof(System.IO.FileAttributes))
             .Where(qC => this.imageList.Images.ContainsKey(qC.ToLower()))
             .Select(qC => new ToolStripMenuItem(qC.ToString(), this.imageList.Images[qC.ToString().ToLower()])).ToArray());
     }
     // cms.Show(Cursor.Position);
     e.MenuStrip = this.AttributesContextMenuStrip;
 }
Exemplo n.º 13
0
 private void objList_RowNumberDblClick(BrightIdeasSoftware.OlvListViewHitTestInfo hti)
 {
     MarketDetaiedlMD obj = (MarketDetaiedlMD)hti.RowObject;
     frmMarketMD frmMktMd = new frmMarketMD(BOIDEnum.Market);
     frmMktMd.MdiParent = this.MdiParent;
     frmMktMd.FormMode = NanCrm.FormMode.Ok;
     frmMktMd.UpdateProc = MarketMDUpdateProc;
     //int id = ((MarketDetaiedlMD)hti.RowObject).ID;
     //frmMktMd.LoadDataById(id);
     frmMktMd.SetBOTable(((MarketDetaiedlMD)hti.RowObject).GetOrignalMD());
     frmMktMd.Show();
 }
Exemplo n.º 14
0
 private void objList_RowNumberDblClick(BrightIdeasSoftware.OlvListViewHitTestInfo hti)
 {
     KWListDetailMD obj = (KWListDetailMD)hti.RowObject;
     frmKeyWordListMD frmKw = new frmKeyWordListMD(BOIDEnum.KeyWordList);
     frmKw.MdiParent = this.MdiParent;
     FormExchangeParams param = new FormExchangeParams();
     param.Mode = NanCrm.FormMode.Ok;
     param.ReturnProc = KWLMDRetProc;
     param.Data = (KWListDetailMD)hti.RowObject;
     frmKw.SetFormExchangeParams(param);
     //frmKw.SetBOTable(((KWListDetailMD)hti.RowObject).GetOrignalMD());
     frmKw.Show();
 }
Exemplo n.º 15
0
 private void objList_CellEditFinishing(object sender, BrightIdeasSoftware.CellEditEventArgs e)
 {
     if (e.ListViewItem.Index == objList.Items.Count - 1)
     {
         if (string.IsNullOrWhiteSpace(e.NewValue.ToString()))
         {
             return;
         }
         KeyWordMD obj = (KeyWordMD)objList.AddEmptyRow();
         int maxIdInDb = BusinessObject.GetBONextID(BOIDEnum.KeyWord);
         int maxIdOfUi = objList.Objects.Cast<KeyWordMD>().ToList().Max(x=>x.ID);
         obj.ID = Math.Max(maxIdInDb,maxIdOfUi) + 1;
     }
 }
        public void Formater(BrightIdeasSoftware.ObjectListView listview, BrightIdeasSoftware.OLVColumn column, bool isSHow)
        {
            if (column.Name == "OrderNumber")
            {
                column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).ID; };
            }
            else
            {

                switch (column.Name)
                {
                    case "s_cqcs":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_cqcs; };
                        break;
                    case "s_csmc":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_csmc; };
                        break;
                    case "s_date":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_date.Value.ToString("yyyy-MM-dd HH:mm:ss"); };
                        break;
                    case "s_jlr":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_jlr; };
                        break;
                    case "s_sd":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_sd; };
                        break;
                    case "s_sded":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_sded; };
                        break;
                    case "s_sworxw":
                        column.AspectGetter = delegate(object x) { return GetTimeStrByState((int)((CunChuInfo)x).s_sworxw); };
                        break;
                    case "s_sywdfw":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_sywdfw;};
                        break;
                    case "s_syxdsdfw":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_syxdsdfw; };
                        break;
                    case "s_wd":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_wd; };
                        break;
                    case "s_wded":
                        column.AspectGetter = delegate(object x) { return ((CunChuInfo)x).s_wded; };
                        break;
                    default:
                        column.AspectGetter = delegate(object x) { return ""; };
                        break;
                }
            }
        }
Exemplo n.º 17
0
 private void objList_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
     if (e.Column == null || e.Column.AspectName != "Name")
     {
         return;
     }
     if (e.HitTest.HitTestLocation == HitTestLocation.Image)
     {
         frmCFL cfl = new frmCFL(objList.BOID);
         cfl.ReturnProc = KeyWordRetProc;
         cfl.MdiParent = this.MdiParent;
         cfl.Show();
         e.Handled = true;
     }
 }
        public void Formater(BrightIdeasSoftware.ObjectListView listview, BrightIdeasSoftware.OLVColumn column, bool isSHow)
        {
            if (column.Name == "OrderNumber")
            {
                column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessID; };
            }
            else
            {

                switch (column.Name)
                {
                    case "ProcessContentInquired":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessContentInquired; };
                        break;
                    case "ProcessCustomerUnit":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessCustomerUnit; };
                        break;
                    case "ProcessDate":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); };
                        break;
                    case "ProcessHandlingSuggestion":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessHandlingSuggestion; };
                        break;
                    case "Processlinkman":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).Processlinkman; };
                        break;
                    case "ProcessProductName":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessProductName; };
                        break;
                    case "ProcessPurchasingDate":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessPurchasingDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); };
                        break;
                    case "ProcessServiceUser":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessServiceUser; };
                        break;
                    case "ProcessStandard":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).ProcessStandard; };
                        break;
                    case "Processtel":
                        column.AspectGetter = delegate(object x) { return ((ProcessLoggingInfo)x).Processtel; };
                        break;
                    default:
                        column.AspectGetter = delegate(object x) { return ""; };
                        break;
                }
            }
        }
Exemplo n.º 19
0
 private void dlvSegments_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
     if( e.ClickCount != 2)
     {
         return;
     }
     var segment = dlvSegments.SelectedObject<SegmentInformation>();
     if (segment == null)
     {
         return;
     }
     BeginTask("Looking for instances in segment...");
     var addressList = ClrDump.Eval(() => segment.Instances.ToList());
     var addresses = new AddressContainerList(addressList);
     Status("Displaying instances in segment...");
     InstancesMixedModule.Create(ClrDump, addresses, this, mod => RequestDockModule(mod), $"{ClrDump.Id} - {segment.Start:X}");
     EndTask("Segment instances displayed.");
 }
Exemplo n.º 20
0
        private void lvUsers_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
        {

            e.Handled = true;
            if (e.Column.AspectName == "View")
            {
                UserAdd form = new UserAdd((Member)e.Model);
                form.OnSave += form_OnSave;
                form.ShowDialog();
            }
            else if (e.Column.AspectName == "Delete")
            {
                DeleteConfirm confirm = new DeleteConfirm();
                if (confirm.ShowDialog() == DialogResult.OK)
                {
                    members.Delete((Member)e.Model);
                }
            }
        }
 public void Formater(BrightIdeasSoftware.ObjectListView listview, BrightIdeasSoftware.OLVColumn column, bool isSHow)
 {
     if (column.Name == "OrderNumber")
     {
         column.AspectGetter = delegate(object x) { return ((Unit)x).unitid; };
     }
     else
     {
         switch (column.Name)
         {
             case "unitname":
                 column.AspectGetter = delegate(object x) { return ((Unit)x).unitname; };
                 break;
             default:
                 column.AspectGetter = delegate(object x) { return ""; };
                 break;
         }
     }
 }
Exemplo n.º 22
0
 private void downloadQueue1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.Column == uriINT)
     {
         e.SubItem.ForeColor = Color.Blue;
     }
     else if (e.Column == fileINT)
     {
         e.SubItem.ForeColor = Color.Red;
     }
     else if (e.Column == percentINT)
     {
         e.SubItem.ForeColor = Color.Navy;
     }
     else if (e.Column == priorityINT)
     {
         e.SubItem.ForeColor = Color.Maroon;
     }
 }
Exemplo n.º 23
0
 private void lvDistros_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
 {
     e.Handled = true;
     if (e.Column.AspectName == "EditText")
     {
         PartnerAdd form = new PartnerAdd(partners, (Partner)e.Model);
         form.OnSave += form_OnSave;
         form.ShowDialog();
     }
     else if (e.Column.AspectName == "DeleteText")
     {
         DeleteConfirm confirm = new DeleteConfirm();
         if (confirm.ShowDialog() == DialogResult.OK)
         {
             repo.Delete((Partner)e.Model, ApplicationData.Instance.GetUserId());
             lvDistros.SetObjects(repo.GetPartners());
             OnSave();
         }
     }
 }
Exemplo n.º 24
0
        private void treeAdminUnits_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e)
        {
            e.Handled = true;
            int userId = ApplicationData.Instance.GetUserId();

            DeleteConfirm confirm = new DeleteConfirm();
            if (confirm.ShowDialog() == DialogResult.OK)
            {
                AdminLevel al = (AdminLevel)e.Model;
                AdminLevelType alt = settings.GetAdminLevelTypeByLevel(al.LevelNumber);
                foreach (var d in demo.GetAdminLevelDemography(al.Id))
                {
                    demo.Delete(d, userId);
                    if (alt.IsAggregatingLevel)
                        demo.AggregateUp(alt, d.DateReported, userId, null, null);
                }
                demo.Delete(al, userId);
                LoadAdminUnits();
            }
        }
Exemplo n.º 25
0
        private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e) {
            if (e.ColumnIndex == 2)
                e.SubItem.ForeColor = primaryCellColor;
            else
                e.SubItem.ForeColor = otherCellColor;

            if (e.ColumnIndex != 0)
                return;

            // Setup album artwork column
            Song song = (Song)e.Model;
            if (song.TrackNumber == 1) {
                Image albumCover = this.GetAlbumArtwork(song);
                if (albumCover != null) {
                    // albumCover = albumCover.GetThumbnailImage(120, 120, delegate { return false; }, IntPtr.Zero);
                    ImageDecoration decoration = new ImageDecoration(albumCover);
                    decoration.ShrinkToWidth = true;
                    decoration.AdornmentCorner = ContentAlignment.BottomCenter;
                    decoration.ReferenceCorner = ContentAlignment.TopCenter;
                    e.SubItem.Decoration = decoration;
                    albumImageDecorations[song.Album] = new ForwardingDecoration(e.Item, e.SubItem, decoration);

                    TextDecoration td = new TextDecoration(song.Album, ContentAlignment.BottomCenter);
                    td.Font = this.objectListView1.Font;
                    td.Wrap = false;

                    td.TextColor = primaryCellColor;
                    td.BackColor = Color.FromArgb(255, 16, 16, 16);
                    td.CornerRounding = 4;

                    //td.BackColor = otherCellColor;
                    //td.TextColor = Color.FromArgb(255, 16, 16, 16);
                    //td.CornerRounding = 0;
                    e.SubItem.Decorations.Add(td);
                }
            } else {
                if (albumImageDecorations.ContainsKey(song.Album)) {
                    e.SubItem.Decoration = albumImageDecorations[song.Album];
                }
            }
        }
Exemplo n.º 26
0
        private void HandleModelDropped(object sender, BrightIdeasSoftware.ModelDropEventArgs e) {
            e.Handled = true;
            switch (e.DropTargetLocation)
            {
                case DropTargetLocation.AboveItem:
                    MoveObjectsToSibling(
                        e.ListView as TreeListView,
                        e.SourceListView as TreeListView, 
                        (ModelWithChildren)e.TargetModel, 
                        e.SourceModels, 
                        0);
                    break;
                case DropTargetLocation.BelowItem:
                    MoveObjectsToSibling(
                        e.ListView as TreeListView,
                        e.SourceListView as TreeListView, 
                        (ModelWithChildren)e.TargetModel, 
                        e.SourceModels, 
                        1);
                    break;
                case DropTargetLocation.Background:
                    MoveObjectsToRoots(
                        e.ListView as TreeListView, 
                        e.SourceListView as TreeListView, 
                        e.SourceModels);
                    break;
                case DropTargetLocation.Item:
                    MoveObjectsToChildren(
                        e.ListView as TreeListView, 
                        e.SourceListView as TreeListView, 
                        (ModelWithChildren)e.TargetModel, 
                        e.SourceModels);
                    break;
                default:
                    return;
            }

            e.RefreshObjects();
        }
Exemplo n.º 27
0
 // http://objectlistview.sourceforge.net/cs/blog4.html
 private void HandleModelCanDrop(object sender, BrightIdeasSoftware.ModelDropEventArgs e)
 {
     e.Handled = true;
     e.Effect = DragDropEffects.None;
     if (!e.SourceModels.Contains(e.TargetModel))
     {
         var sourceModels = e.SourceModels.Cast<AdminLevel>();
         AdminLevel target = e.TargetModel as AdminLevel;
         switch (e.DropTargetLocation)
         {
             case DropTargetLocation.AboveItem:
                 CanDropSameLevel(e, sourceModels, target);
                 break;
             case DropTargetLocation.BelowItem:
                 CanDropSameLevel(e, sourceModels, target);
                 break;
             case DropTargetLocation.BetweenItems:
                 CanDropSameLevel(e, sourceModels, target);
                 break;
             case DropTargetLocation.Item:
                 CanDropChild(e, sourceModels, target);
                 break;
             case DropTargetLocation.SubItem:
                 CanDropChild(e, sourceModels, target);
                 break;
             case DropTargetLocation.Background:
                 break;
             case DropTargetLocation.LeftOfItem:
                 break;
             case DropTargetLocation.None:
                 break;
             case DropTargetLocation.RightOfItem:
                 break;
             default:
                 break;
         }
     }
 }
Exemplo n.º 28
0
 private void HandleModelCanDrop(object sender, BrightIdeasSoftware.ModelDropEventArgs e) {
     e.Handled = true;
     e.Effect = DragDropEffects.None;
     if (e.SourceModels.Contains(e.TargetModel))
         e.InfoMessage = "Cannot drop on self";
     else {
         IEnumerable<ModelWithChildren> sourceModels = e.SourceModels.Cast<ModelWithChildren>();
         if (e.DropTargetLocation == DropTargetLocation.Background) {
             if (e.SourceListView == e.ListView && sourceModels.All(x => x.Parent == null))
                 e.InfoMessage = "Dragged objects are already roots";
             else {
                 e.Effect = DragDropEffects.Move;
                 e.InfoMessage = "Drop on background to promote to roots";
             }
         } else {
             ModelWithChildren target = (ModelWithChildren)e.TargetModel;
             if (sourceModels.Any(x => target.IsAncestor(x)))
                 e.InfoMessage = "Cannot drop on descendant (think of the temporal paradoxes!)";
             else
                 e.Effect = DragDropEffects.Move;
         }
     }
 }
Exemplo n.º 29
0
        public override void Draw(BrightIdeasSoftware.ObjectListView olv, Graphics g, Rectangle r)
        {
            Rectangle cellBounds = this.CellBounds;
            cellBounds.Inflate(-this.CellPadding.Width, -this.CellPadding.Height);
            Rectangle textBounds = cellBounds;
            int currentDPI = (int)g.DpiX;
            this.TitleFont = new Font(this.TitleFont.FontFamily, 9 * ((float) 96 / currentDPI), this.TitleFont.Style);
            this.AuthorsFont = new Font(this.AuthorsFont.FontFamily, 8 * ((float) 96 / currentDPI), this.AuthorsFont.Style);
            //g.DrawRectangle(Pens.Red, textBounds);

            // Draw the title
            using (StringFormat fmt = new StringFormat(StringFormatFlags.NoWrap))
            {
                fmt.Trimming = StringTrimming.EllipsisCharacter;
                fmt.Alignment = StringAlignment.Near;
                fmt.LineAlignment = StringAlignment.Near;
                using (SolidBrush b = new SolidBrush(this.TitleColor))
                {
                    g.DrawString(this.Title, this.TitleFont, b, textBounds, fmt);
                }
                // Draw the description
                SizeF size = g.MeasureString(this.Title, this.TitleFont, (int)textBounds.Width, fmt);
                textBounds.Y += (int)size.Height + 4;
                textBounds.Height -= (int)size.Height;
            }

            // Draw the description
            using (StringFormat fmt2 = new StringFormat(StringFormatFlags.NoWrap))
            {
                fmt2.Trimming = StringTrimming.EllipsisCharacter;
                using (SolidBrush b = new SolidBrush(this.AuthorsColor))
                {
                    g.DrawString(((this.Year.Length > 0) ? ("(" + this.Year + ") " ) : "") + this.Authors, this.AuthorsFont, b, textBounds, fmt2);
                }
            }
        }
        public FileImageListViewHelper( BrightIdeasSoftware.OLVColumn olv, ImageList imageList )
        {
            mListViewColumn = olv;
            mImageList = imageList;

            mListViewColumn.ImageGetter = new BrightIdeasSoftware.ImageGetterDelegate( ImageGetterMethod );

            mImageList.ColorDepth = ColorDepth.Depth32Bit;

            // Add folder icons and system drive icon
            Icon closedFolderIcon = PWLib.Platform.Windows.IconHelper.GetFolderIcon( PWLib.Platform.Windows.IconHelper.SystemIconSize.Small, PWLib.Platform.Windows.IconHelper.FolderType.Closed );
            if (closedFolderIcon != null)
            {
                mImageList.Images.Add(closedFolderIcon);
                mClosedFolderIndex = mImageList.Images.Count - 1;
            }

            Icon openFolderIcon = PWLib.Platform.Windows.IconHelper.GetFolderIcon( PWLib.Platform.Windows.IconHelper.SystemIconSize.Small, PWLib.Platform.Windows.IconHelper.FolderType.Open );
            if (openFolderIcon != null)
            {
                mImageList.Images.Add(openFolderIcon);
                mOpenFolderIndex = mImageList.Images.Count - 1;
            }

            // Try getting hard disk icon, if it doesn't exist fall back on the closed folder icon
            Icon deviceIcon = PWLib.Platform.Windows.IconHelper.GetFileIcon(System.IO.Path.GetPathRoot(Application.ExecutablePath), PWLib.Platform.Windows.IconHelper.SystemIconSize.Small, false);
            if (deviceIcon != null)
            {
                mImageList.Images.Add(deviceIcon);
                mSystemDriveIndex = mImageList.Images.Count - 1;
            }
            else
            {
                mSystemDriveIndex = mClosedFolderIndex;
            }
        }