public virtual void FormatCell(FormatCellEventArgs format)
 {
     if (format.Column.Text == "Kind")
     {
         format.SubItem.ForeColor = GetColor();
     }
 }
Пример #2
0
        private void olvChecks_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            // Colour (only) the column Status depending on its value

            if (e.ColumnIndex == this.olvColCheckStatus.Index)
            {
                var check = e.Model as Check;
                if (check != null)
                {
                    switch (check.Status)
                    {
                    case "Passed":
                        e.SubItem.ForeColor = Color.Green;
                        break;

                    case "Failed":
                        e.SubItem.ForeColor = Color.Red;
                        break;

                    default:      // Not Validated, ...
                        e.SubItem.ForeColor = Color.Black;
                        break;
                    }
                }
            }
        }
Пример #3
0
 void listview_FormatCell(object sender, FormatCellEventArgs e)
 {
     //if (e.ColumnIndex == 2)
     {
         e.Item.BackColor = Color.Black;
     }
 }
Пример #4
0
 private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     /*
      * ////oLV_Overview.UseCellFormatEvents = true; //this must be called somewhere so that this method gets a call.
      *
      * DateTime tmp = new DateTime();
      * if (tmp.GetType() == e?.CellValue?.GetType() && ( DateTime ) e.CellValue == tmp)
      * {
      *  // Add a opaque, rotated text decoration
      *  //TextDecoration decoration = new TextDecoration("Missing!", 255);
      *  //decoration.Alignment = ContentAlignment.MiddleCenter;
      *  //decoration.Font = new Font(this.Font.Name, this.Font.SizeInPoints + 2);
      *  //decoration.TextColor = Color.Crimson;
      *  //decoration.Rotation = -20;
      *  //e.SubItem.Decoration = decoration; //NB. Sets Decoration
      *
      *
      #region macht Felder wo nichts drinnen steht unsichtbar
      *  CellBorderDecoration cbd = new CellBorderDecoration();
      *  cbd.BorderPen = Pens.White;
      *  cbd.FillBrush = Brushes.White;
      *  cbd.CornerRounding = 4.0f;
      *  e.SubItem.Decorations.Add(cbd);
      #endregion
      *
      * }*/
 }
        private void fastObjectListViewUrl_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            var parsedUrl = (ParsedUrl)e.Model;

            if (parsedUrl == null)
            {
                return;
            }

            if (e.Column == olvColumnStatus)
            {
                e.SubItem.ForeColor = parsedUrl.GetStatusColor();
            }
            else if (e.Column == olvColumnLastLog)
            {
                LogModel log = parsedUrl.EventLog.LastOrDefault();

                if (log == null)
                {
                    return;
                }

                e.SubItem.ForeColor = log.GetLogColor();
            }
            // else if (e.Column == olvColumnProxyToString)
            // {
            //     e.SubItem.Text = parsedUrl.ProxyToString;
            // }
        }
Пример #6
0
 private void objectListView_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.Column == olvColumnColor)
     {
         var obj = (CreatureColorViewObject)e.Model;
         e.SubItem.BackColor = obj.Color;
         e.SubItem.ForeColor = e.SubItem.BackColor.GetContrastingBlackOrWhiteColor();
     }
 }
Пример #7
0
 private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.Column.AspectName == "Color")
     {
         Color c = (Color)e.CellValue;
         e.SubItem.BackColor = c;
         e.SubItem.Text      = "";
     }
 }
 private void FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.Column.Name.Contains("Ignore"))
     {
         if (!this.ROMName.Has("\\default"))
         {
             e.SubItem.ForeColor = Color.Gray;
         }
     }
 }
Пример #9
0
 private void treeListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 2 || e.ColumnIndex == 3) //confirmations and date
     {
         if (e.Model is Wallet || e.Model is Account || e.Model is Address)
         {
             e.SubItem.Text = "";
         }
     }
 }
Пример #10
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];
                }
            }
        }
Пример #11
0
        private void objectListViewTicket_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            Ticket ticket = (Ticket)e.Model;

            if (e.ColumnIndex == 0)
            {
                NameDescriptionDecoration decoration = new NameDescriptionDecoration();
                decoration.Title       = ticket.Subject;
                decoration.Description = ticket.Description;
                e.SubItem.Decoration   = decoration;
            }
        }
 private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.Column == olvColumnColor)
     {
         Creature             creature = (Creature)e.Model;
         System.Drawing.Color?color    = creature.CreatureColorBkColor;
         if (color != null)
         {
             e.SubItem.BackColor = color.Value;
             e.SubItem.ForeColor = e.SubItem.BackColor.GetContrastingBlackOrWhiteColor();
         }
     }
 }
Пример #13
0
 private void olvCart_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         Product product = (Product)e.Model;
         NamedDescriptionDecoration decorationCart = new NamedDescriptionDecoration();
         decorationCart.ImageList   = this.ilistShoppingCart;
         decorationCart.Title       = product.Name;
         decorationCart.ImageName   = Convert.ToString(product.ProductID);
         decorationCart.Description = product.ProductDescription;
         e.SubItem.Decoration       = decorationCart;
     }
 }
Пример #14
0
 private void olvComments_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         Comment comment = (Comment)e.Model;
         NamedDescriptionDecoration decorationComment = new NamedDescriptionDecoration();
         decorationComment.ImageList = this.ilistComment;
         Customer CommentOwner = CustomerAccess.GetCustomer(comment.CustomerID);
         decorationComment.Title       = CommentOwner.FirstName.Substring(0, 1).ToUpper() + CommentOwner.FirstName.Substring(1) + " " + CommentOwner.LastName.ToUpper();
         decorationComment.ImageName   = Convert.ToString(comment.CustomerID);
         decorationComment.Description = comment.CommentDescription;
         e.SubItem.Decoration          = decorationComment;
     }
 }
Пример #15
0
        private void listadoEnlaces_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            if (e.ColumnIndex == 0)
            {
                Enlaces enlace = (Enlaces)e.Model;
                MetodosFormCursos.pintarImagenTituloDesc decoration = new Proyecto_Negocio.MetodosFormCursos.pintarImagenTituloDesc();

                decoration.ImageList       = this.imageListLarge;
                decoration.Title           = enlace.titulo;
                decoration.ImageName       = enlace.id;
                decoration.Description     = enlace.descripcion;
                decoration.titleSize       = 11;
                decoration.descriptionSize = 9;
                e.SubItem.Decoration       = decoration;
            }
        }
        private void fastObjectListViewProxies_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            GoProxy proxy = (GoProxy)e.Model;

            if (e.Column == olvColumnCurrentFails)
            {
                if (proxy.CurrentConcurrentFails == 0)
                {
                    e.SubItem.ForeColor = Color.Green;
                }
                else if (proxy.CurrentConcurrentFails > 0)
                {
                    e.SubItem.ForeColor = Color.Yellow;
                }
                else if (proxy.CurrentConcurrentFails >= proxy.MaxConcurrentFails)
                {
                    e.SubItem.ForeColor = Color.Red;
                }
            }
            else if (e.Column == olvColumnTimeOut)
            {
                e.SubItem.ForeColor = proxy.CoolDownTimer.IsRunning ? Color.Red : Color.Green;
            }
            else if (e.Column == olvColumnUsageCount)
            {
                if (proxy.CurrentCreations == 0)
                {
                    e.SubItem.ForeColor = Color.Green;
                }
                else if (proxy.CurrentCreations <= proxy.MaxCreations)
                {
                    e.SubItem.ForeColor = Color.Yellow;
                }
                else
                {
                    e.SubItem.ForeColor = Color.Red;
                }
            }
            else if (e.Column == olvColumnStatu)
            {
                e.SubItem.ForeColor = proxy.GetStatusColor();
            }
        }
Пример #17
0
        private void OnFormatCell(object sender, FormatCellEventArgs e)
        {
            if (e.Column == colType || e.ColumnIndex <= 1 || e.CellValue == null || ! (e.CellValue is long))
            {
                return;
            }

            var value = (long)e.CellValue;
            if (value > 0)
            {
                e.SubItem.BackColor = Color.LightGreen;
            }
            else if (value < 0)
            {
                e.SubItem.BackColor = Color.LightPink;
            }
            else
            {
                e.SubItem.BackColor = Color.LightGray;
            }
        }
        private void objectListView1_FormatCell(object sender, FormatCellEventArgs e)
        {
            if (e.ColumnIndex != 0)
                return;

            loginfo info = (loginfo)e.Model;

            if (info.img == null)
                return;

            ImageDecoration decoration = new ImageDecoration(new Bitmap(info.img,150,150),255);
            //decoration.ShrinkToWidth = true;
            decoration.AdornmentCorner = ContentAlignment.TopCenter;
            decoration.ReferenceCorner = ContentAlignment.TopCenter;
            e.SubItem.Decoration = decoration;

           // TextDecoration td = new TextDecoration("test", ContentAlignment.BottomCenter);

           // e.SubItem.Decorations.Add(td);

            Application.DoEvents();
        }
 public static void FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Column.Index == 1)
     {
         IValue value = DerefVariable(e.Model);
         if (value != null)
         {
             if (value is DefaultValue)
             {
                 e.SubItem.ForeColor = Color.Blue;
             }
         }
     }
 }
Пример #20
0
 private void objLog_FormatCell(object sender, FormatCellEventArgs e)
 {
     Log l = (Log) e.Model;
     switch (l.Type)
     {
         case LogType.Info:
             e.SubItem.ForeColor = SystemColors.ControlText;
             break;
         case LogType.Warn:
             e.SubItem.ForeColor = Color.FromArgb(255, 180, 180, 0);
             break;
         case LogType.Error:
             e.SubItem.ForeColor = Color.Red;
             break;
     }
 }
Пример #21
0
        //
        // Listview formatter
        //
        private void ListView_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            float     size = 8.5F;
            FontStyle fs   = FontStyle.Regular;
            string    font = "Consolas";
            Color     fore = Color.DarkCyan;

            if (e.Column == ptitleProb)
            {
                ProblemInfo plist = (ProblemInfo)e.Model;
                size = 9.0F;
                font = "Segoe UI Semibold";
                //set color
                fore = Functions.GetProblemTitleColor(plist.pnum);
                //set style
                if (plist.stat == 0)
                {
                    fs = FontStyle.Strikeout;
                }
                if (plist.stat == 1)
                {
                    fs = FontStyle.Regular;
                }
                if (plist.stat == 2)
                {
                    fs = FontStyle.Italic;
                }
            }
            else if (e.Column == levelProb)
            {
                font = "Segoe UI Semibold";
                size = 9.0F;
                fore = Color.DarkRed;
            }
            else if (e.Column == pnumProb)
            {
                size = 9.0F;
                fs   = FontStyle.Bold;
                fore = Color.DarkSlateBlue;
            }
            else if (e.Column == dacuProb)
            {
                size = 9.0F;
                fs   = FontStyle.Bold;
                fore = Color.Navy;
            }
            else if (e.Column == totalProb)
            {
                size = 9.0F;
                fore = Color.DarkBlue;
            }
            else if (e.Column == rtlProb || e.Column == waProb)
            {
                size = 9.0F;
                fore = Color.Maroon;
            }
            else if (e.Column == runProb || e.Column == acProb)
            {
                size = 9.0F;
                fore = Color.Blue;
            }
            else if (e.Column == statProb)
            {
                size = 8.0F;
                fore = Color.Black;
            }
            else if (e.Column == nameCat)
            {
                size = 8.25F;
                font = "Segoe UI Semibold";
                fore = Color.Black;
                if (((CategoryNode)e.Model).Level == 0)
                {
                    size = 10F;
                    fore = Color.Maroon;
                    e.SubItem.BackColor = Color.PaleTurquoise;
                }
            }
            else if (e.Column == countCat)
            {
                size = 8.0F;
                if (((CategoryNode)e.Model).Level == 0)
                {
                    e.SubItem.BackColor = Color.PaleTurquoise;
                }
            }

            e.SubItem.Font      = new Font(font, size, fs);
            e.SubItem.ForeColor = fore;
        }
Пример #22
0
 private void TreeView_FormatCell(object sender, FormatCellEventArgs e)
 {
     Node node = (Node)e.Item.RowObject;
     if ((e.Column == this.tree_process && node.preferAction != EAction.NONE) || e.Column == this.tree_preferAction)
     {
         e.SubItem.Font = new Font(e.Item.Font, FontStyle.Bold);
     }
 }
 private void FOLV_RelevantObjects_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     FormatCell(sender, e);
 }
Пример #24
0
 private void tasksTreeView_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == taskDeadlineColumn.Index)
     {
         Task task = e.Model as Task;
         if (task.IsSubtask()) e.SubItem.Text = "";
     }
 }
Пример #25
0
 private void fileViewObject_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 2)
         e.SubItem.ForeColor = primaryCellColor;
     else
         e.SubItem.ForeColor = otherCellColor;
 }
Пример #26
0
 private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
 {
     e.SubItem.ForeColor = fontColor;
 }
Пример #27
0
 private void list_FormatCell_1(object sender, FormatCellEventArgs e) {
 }
Пример #28
0
 private void objectListView1_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 2 && e.SubItem.Text.Trim() == "")
     {
         TextDecoration decoration = new TextDecoration("Jälki-ilmoittautumispaikka", 200);
         decoration.Alignment = ContentAlignment.MiddleLeft;
         decoration.Font = new Font(this.Font.Name, this.Font.SizeInPoints + 1);
         decoration.TextColor = Color.Gray;
         e.SubItem.Decoration = decoration;
     }
 }
Пример #29
0
 private void fastObjectListView1_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         Bydlo data = (Bydlo)e.Model;
         e.Item.Text = "";
         NamedDescriptionDecoration decoration = new NamedDescriptionDecoration();
         decoration.Title = data.Nazwisko + " " + data.Imie;
         decoration.Description = data.pesel + ";" + data.dowod;
         e.SubItem.Decoration = decoration;
     }
 }
Пример #30
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnFormatCell(FormatCellEventArgs args) {
     if (this.FormatCell != null)
         this.FormatCell(this, args);
 }
Пример #31
0
        /// <summary>
        /// Trigger FormatRow and possibly FormatCell events for the given item
        /// </summary>
        /// <param name="rowIndex"></param>
        /// <param name="displayIndex"></param>
        /// <param name="olvi"></param>
        protected virtual void TriggerFormatRowEvent(int rowIndex, int displayIndex, OLVListItem olvi)
        {
            FormatRowEventArgs args = new FormatRowEventArgs();
            args.ListView = this;
            args.RowIndex = rowIndex;
            args.DisplayIndex = displayIndex;
            args.Item = olvi;
            args.UseCellFormatEvents = this.UseCellFormatEvents;
            this.OnFormatRow(args);

            if (args.UseCellFormatEvents && this.View == View.Details) {
                // If a cell isn't given its own color, it should use the color of the item.
                // However, there is a bug in the .NET framework where the cell are given
                // the color of the ListView instead. So we have to explicitly give each
                // cell the back color that it should have.
                olvi.UseItemStyleForSubItems = false;
                Color backColor = olvi.BackColor;
                for (int i = 0; i < this.Columns.Count; i++) {
                    olvi.SubItems[i].BackColor = backColor;
                }

                // Fire one event per cell
                FormatCellEventArgs args2 = new FormatCellEventArgs();
                args2.ListView = this;
                args2.RowIndex = rowIndex;
                args2.DisplayIndex = displayIndex;
                args2.Item = olvi;
                for (int i = 0; i < this.Columns.Count; i++) {
                    args2.ColumnIndex = i;
                    args2.Column = this.GetColumn(i);
                    args2.SubItem = olvi.GetSubItem(i);
                    this.OnFormatCell(args2);
                }
            }
        }
        private void fastObjecttListViewAccounts_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e)
        {
            var managerWrapper = (Manager)e.Model;
            var manager        = managerWrapper.Bot;

            if (manager != null)
            {
                if (e.Column == this.olvAccountState)
                {
                    switch (manager.AccountState)
                    {
                    case AccountState.Good:
                        e.SubItem.ForeColor = Color.Green;
                        break;

                    case AccountState.PermAccountBan:
                    case AccountState.NotVerified:
                        e.SubItem.ForeColor = Color.Red;
                        break;

                    case AccountState.AccountWarning:
                    case AccountState.PokemonLimitAndPokestopLimit:
                    case AccountState.PokemonLimitOrPokestopLimit:
                    case AccountState.PokemonLimitReached:
                    case AccountState.PokestopLimitReached:
                        e.SubItem.ForeColor = Color.Yellow;
                        break;

                    case AccountState.CaptchaRequired:
                        e.SubItem.ForeColor = Color.MediumAquamarine;
                        break;
                    }
                }
                else if (e.Column == this.olvBotState)
                {
                    switch (manager.State)
                    {
                    case BotState.Stopped:
                        e.SubItem.ForeColor = Color.Red;
                        break;

                    case BotState.Stopping:
                        e.SubItem.ForeColor = Color.OrangeRed;
                        break;

                    case BotState.Starting:
                        e.SubItem.ForeColor = Color.LightGreen;
                        break;

                    case BotState.Running:
                        e.SubItem.ForeColor = Color.Green;
                        break;

                    case BotState.Pausing:
                        e.SubItem.ForeColor = Color.MediumAquamarine;
                        break;

                    case BotState.Paused:
                        e.SubItem.ForeColor = Color.MediumAquamarine;
                        break;
                    }
                }
                else if (e.Column == olvLastLog)
                {
                    if (managerWrapper.Log == null)
                    {
                        return;
                    }

                    e.SubItem.ForeColor = managerWrapper.Log.GetLogColor();
                }
            }
        }