Beispiel #1
0
 private void olvLog_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
 {
     if (e.Item.RowObject != null)
     {
         if (((LogItem)(e.Item.RowObject)).Level == 'E')
         {
             e.Item.ForeColor = Color.Red;
         }
         else if (((LogItem)(e.Item.RowObject)).Level == 'W')
         {
             e.Item.ForeColor = Color.Orange;
         }
         else if (((LogItem)(e.Item.RowObject)).Level == 'I')
         {
             e.Item.ForeColor = Color.Green;
         }
         else if (((LogItem)(e.Item.RowObject)).Level == 'D')
         {
             e.Item.ForeColor = Color.Brown;
         }
         else if (((LogItem)(e.Item.RowObject)).Level == 'X')
         {
             e.Item.ForeColor = Color.Black;
         }
         else
         {
             e.Item.ForeColor = Color.Gray;
         }
     }
 }
Beispiel #2
0
 // Pinta de colores los cargos extra que se añaden al pedido que se listan en el olv determinaciones (traducción, muestreo, portes, etc.)
 private void folvDeterminaciones_FormatRow(object sender, FormatRowEventArgs e)
 {
     Almacen.odts.ArticuloDeterminacion d = e.Model as Almacen.odts.ArticuloDeterminacion;
     if (d.TipoArticulo == "CAR")
     {
         e.Item.BackColor = Color.LightGreen;
     }
 }
 private void listview_FormatRow(object sender, FormatRowEventArgs e)
 {
     Controller.WriteLine("listview_FormatRow: index: {0}", e.Item.Index);
     if ((e.Item.Index & 1) == 1)
     {
         e.Item.ForeColor = Color.Red;
     }
 }
Beispiel #4
0
        private void objectListView1_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            PartToImport part = (PartToImport)e.Model;

            if (!System.IO.File.Exists(symFolder + part.name + ".sym"))
            {
                e.Item.ForeColor = Color.Gray;
            }
        }
Beispiel #5
0
        private void tlwAlbums_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            var data = e.Model as AlbumDto;

            if (data.IsHidden)
            {
                e.Item.ForeColor = Color.Gray;
            }
            else if (data.Dvds.Any(x => x.StartsWith("_")))
            {
                e.Item.ForeColor = Color.DarkGreen;
            }
            if (data.Dvds.Count(x => !x.StartsWith("_")) == 1)
            {
                e.Item.Font = new Font(tlwAlbums.Font, FontStyle.Bold);
            }
        }
        private void objectListView1_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            Creature creature = (Creature)e.Model;

            System.Drawing.Color?creatureColorId = creature.CreatureBestCandidateColor;
            if (creatureColorId != null)
            {
                e.Item.BackColor = creatureColorId.Value;
            }
            else
            {
                creatureColorId = creature.BreedHintColor;
                if (creatureColorId != null)
                {
                    e.Item.BackColor = creatureColorId.Value;
                }
            }
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listLines_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            //if (this.viewMode != Global.ViewMode.FilterHide)
            //{
            if ((LogLine)e.Model == null)
            {
                return;
            }

            if (((LogLine)e.Model).SearchMatches.Intersect(filterIds).Any() == true)
            {
                e.Item.BackColor = highlightColour;
            }
            else if (((LogLine)e.Model).IsContextLine == true)
            {
                e.Item.BackColor = contextColour;
            }
            //}
        }
Beispiel #8
0
        //Color codes Combat View so players are harder to skip
        private void combatListView_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            Entity entity = (Entity)e.Model;

            if (entity.GetType() == typeof(Player) && !((Player)entity).IsNpc)
            {
                e.Item.BackColor = Color.LightBlue;
            }
            else if (entity.GetType() == typeof(Player) && ((Player)entity).IsNpc)
            {
                e.Item.BackColor = Color.LightGreen;
            }
            else if (entity.GetType() == typeof(Monster) && !((Monster)entity).IsNPC)
            {
                e.Item.BackColor = Color.LightSalmon;
            }
            else if (entity.GetType() == typeof(Monster) && ((Monster)entity).IsNPC)
            {
                e.Item.BackColor = Color.LightGreen;
            }
        }
        private void FormatRow(object Sender, BrightIdeasSoftware.FormatRowEventArgs e)
        {
            try
            {
                ClsRelevantObject ro = (ClsRelevantObject)e.Model;

                // If SPI IsNot Nothing Then
                if (ro.Enabled && ro.Trigger)
                {
                    e.Item.ForeColor = Color.Green;
                }

                else if (ro.Enabled && !ro.Trigger)
                {
                    e.Item.ForeColor = Color.DarkOrange;
                }

                else if (!ro.Enabled)
                {
                    e.Item.ForeColor = Color.Gray;
                }
            }
            catch (Exception) { }
        }
 private void wordsDataListView_FormatRow(object sender, FormatRowEventArgs e)
 {
     var w = (PlainWord)e.Model;
     e.Item.ForeColor = _hardnessForeground[w.Hardness];
     e.Item.BackColor = _hardnessBackground[w.Hardness];
     e.Item.Font = w.Hardness > 0
                       ? new Font(wordsDataListView.Font, FontStyle.Bold)
                       : new Font(wordsDataListView.Font, FontStyle.Regular);
 }
Beispiel #11
0
 private void TreeView_FormatRow(object sender, FormatRowEventArgs e)
 {
     Node node = (Node)e.Item.RowObject;
     if (node.process)
         e.Item.BackColor = Color.FromArgb(255, 255, 180);
 }
Beispiel #12
0
 /**************************************************************************************************/
 private void fastDataListView1_FormatRow(object sender, FormatRowEventArgs e)
 {
     //e.Item.SubItems[1].Text = (e.DisplayIndex + 1).ToString() + ": ";
 }
 private void OnFormatAlertRow(object sender, FormatRowEventArgs e)
 {
     Alert_v2 alert = (Alert_v2)e.Model;
     e.Item.BackColor = alert.BackColor;
 }
Beispiel #14
0
 private static void OnFormatAlertRow(object sender, FormatRowEventArgs e)
 {
     var alert = (Alert) e.Model;
     e.Item.BackColor = alert.BackColor;
     e.Item.ForeColor = alert.ForeColor;
 }
Beispiel #15
0
 private void tasksTreeView_FormatRow(object sender, FormatRowEventArgs e)
 {
     {
         Task t = e.Model as Task;
         if (t.Percentage == 0) e.Item.BackColor = Color.LightCoral;
         else if (t.Percentage == 100) e.Item.BackColor = Color.GreenYellow;
         else if (t.Percentage >= 50) e.Item.BackColor = Color.Yellow;
         else e.Item.BackColor = Color.LemonChiffon;
     }
 }
        private void _customRowFormat(object sender, FormatRowEventArgs e)
        {
            MyMarketOrder o = (MyMarketOrder)e.Model;

            //switch (e.DisplayIndex % 5)
            //{
            //    case 0:
            //        e.Item.BackColor = Color.DarkGray;
            //        break;
            //    case 1:
            //        e.Item.BackColor = Color.PaleGreen;
            //        break;
            //    case 2:
            //        e.Item.BackColor = Color.SandyBrown;
            //        break;
            //    case 3:
            //        e.Item.BackColor = Color.LightSkyBlue;
            //        break;
            //    case 4:
            //        e.Item.BackColor = Color.Plum;
            //        break;
            //    default:
            //        break;
            //}


            if (o.Status == OrderStatus.OutOfReach)
            {

                e.Item.ForeColor = Color.LightGray;
                e.Item.BackColor = Color.DarkGray;
            }
            else
            {
                if (!o.IsModifyCoolDownFinished)
                {
                    e.Item.ForeColor = Color.Gray;
                }
                switch (o.Status)
                {
                    case OrderStatus.NeedNoUpdate:
                        e.Item.BackColor = Color.PaleGreen;
                        break;
                    case OrderStatus.Hesitate:
                        e.Item.BackColor = Color.SandyBrown;
                        break;
                    case OrderStatus.AutoModified:
                        e.Item.BackColor = Color.LightSkyBlue;
                        break;
                    case OrderStatus.ManuallySpecified:
                        e.Item.BackColor = Color.Plum;
                        break;
                    case OrderStatus.Unknown:
                    default:
                        break;
                }
            }
        }
Beispiel #17
0
 private void fastBarcodes_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
 {
     e.Item.SubItems[0].Text = (e.RowIndex + 1).ToString();
 }
Beispiel #18
0
        private void olvIP_FormatRow(object sender, FormatRowEventArgs e)
        {
            var ipData = (IPData)e.Model;
            if (!DBiFace.AccDB.BansIP.IsBanned(ipData.IP)) return;

            e.Item.BackColor = Color.DarkRed;
            e.Item.ForeColor = Color.WhiteSmoke;
        }
Beispiel #19
0
 private void lstGames_FormatRow(object sender, FormatRowEventArgs e)
 {
     if (e.Model == null) return;
     GameInfo g = (GameInfo)e.Model;
     if (g.IsFavorite()) e.Item.BackColor = listBackground;
     if (g.Hidden) e.Item.BackColor = primaryLight;
 }
Beispiel #20
0
        private void lstFiltered_FormatRow(object sender, FormatRowEventArgs e)
        {
            if (!chkBlacklist.Checked)
                return;

            if (cmbBlacklistColor.SelectedIndex == -1)
                return;

            Player player = (Player)e.Model;
            if (Blacklist.ContainsKey(player.Id.ToString()) || BlacklistedIp(player))
            {
                if(!string.IsNullOrEmpty(cmbBlacklistColor.SelectedItem.ToString()))
                    e.Item.ForeColor = Color.FromName(cmbBlacklistColor.SelectedItem.ToString());
            }
        }
Beispiel #21
0
        private void objectListView1_FormatRow(object sender, FormatRowEventArgs e)
        {
            e.UseCellFormatEvents = true;

            foreach (ListViewItem row in objectListView1.Items)
            {
                ContestantListLine modelLine = (ContestantListLine)objectListView1.GetModelObject(row.Index);

                if (modelLine is RoundDivider)
                {
                    if (modelLine.HotRound)
                        row.BackColor = Color.LightPink;
                    else
                        row.BackColor = Color.LightGray;
                }

                //Tarkastetaan että erä 1:n divider on ensimmäisenä listassa
                if (row.Index == 0 && !(modelLine is RoundDivider))
                {
                    for (int i = 0; i < objectListView1.Items.Count; i++)
                    {
                        ContestantListLine tempModelLine = (ContestantListLine)objectListView1.GetModelObject(i);

                        if (tempModelLine is RoundDivider && tempModelLine.Id == 1)
                        {
                            ListViewItem item = objectListView1.Items[i];
                            objectListView1.Items.RemoveAt(i);
                            objectListView1.Items.Insert(0, item);

                            break;
                        }
                    }
                }
            }
        }
        private void oListView_FormatRow(object sender, FormatRowEventArgs e)
        {
            if (!Settings.Default.PhaseHighlighting)
                return;

            SmartScript script = (SmartScript)e.Model;

            if (script != null && _phaseColors.ContainsKey(script.event_phase_mask))
                e.Item.BackColor = _phaseColors[script.event_phase_mask];
        }
 private void listKeywords_FormatRow(object sender, FormatRowEventArgs e)
 {
     var w = (Keyword)e.Model;
     e.Item.ForeColor = _hardnessForeground[w.Rated];
     e.Item.BackColor = _hardnessBackground[w.Rated];
     e.Item.Font = w.Rated > 0 ? new Font(listKeywords.Font, FontStyle.Bold) : new Font(listKeywords.Font, FontStyle.Regular);
 }
Beispiel #24
0
 private void filterCtrl_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
 {
     update_color(e.Item);
 }
Beispiel #25
0
 private void filelistview_FormatRow(object sender, FormatRowEventArgs e)
 {
     if (e.Model is RPFLib.Common.File)
     {
         var file = e.Model as RPFLib.Common.File;
         if (file.IsCustomData)
             e.Item.BackColor = Color.Orange;
         else
             e.Item.BackColor = Color.Silver;
     }
 }
Beispiel #26
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnFormatRow(FormatRowEventArgs args) {
     if (this.FormatRow != null)
         this.FormatRow(this, args);
 }
 private void FOLV_RelevantObjects_FormatRow(object sender, BrightIdeasSoftware.FormatRowEventArgs e)
 {
     FormatRow(sender, e);
 }
 void OLV_FormatRow(object sender, FormatRowEventArgs e)
 {
     TraitItem model = (TraitItem)e.Model;
     var bkcolor = model.BackColor;
     if (bkcolor != null) e.Item.BackColor = bkcolor.Value;
 }
        /// <summary>
        /// ListView_FormatRow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListView_FormatRow(object sender, FormatRowEventArgs e)
        {
            try
              {
            ObjStrings item = (ObjStrings)e.Model;

            float fontSize = e.Item.Font.Size;
            FontFamily fontFamily = e.Item.Font.FontFamily;
            FontStyle fontStyle = System.Drawing.FontStyle.Regular;
            Color foreColor = Color.Black;
            Color backColor = Color.Transparent;

            if (!item.WriteStringInPlugIn)
            {
              fontStyle = System.Drawing.FontStyle.Italic;
              foreColor = Color.OrangeRed;
            }

            if (item.StringStatus == "Del")
            {
              if (fontStyle == System.Drawing.FontStyle.Italic)
            fontStyle = System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Strikeout;
              else
            fontStyle = System.Drawing.FontStyle.Strikeout;
            }

            e.Item.Font = new Font(fontFamily, fontSize, fontStyle);
            e.Item.ForeColor = foreColor;

              }
              catch (Exception ex)
              {
            edtMemo.Text += ex.Message + Environment.NewLine;
              }
        }
		void ordersTree_FormatRow(object sender, FormatRowEventArgs e) {
			var order = e.Model as Order;
			if (order == null) {
				Assembler.PopupException("ordersTree_FormatRow(): (e.Model as Order =null");
				return;
			}
			e.Item.BackColor = (order.Alert.PositionLongShortFromDirection == PositionLongShort.Long)
				? BACKGROUND_GREEN : BACKGROUND_RED;
		}
		void olvPositions_FormatRow(object sender, FormatRowEventArgs e) {
			Position position = e.Model as Position;
			if (position == null) return;
			e.Item.BackColor = (position.NetProfit > 0.0) ? this.colorBackgroundGreenForPositionProfit : this.colorBackgroundRedForPositionLoss;
		}
Beispiel #32
0
        private void oListView_FormatRow(object sender, FormatRowEventArgs e)
        {
            SmartScript script = (SmartScript)e.Model;

            if (script != null && _phaseColors.ContainsKey(script.event_phase_mask))
                e.Item.BackColor = _phaseColors[script.event_phase_mask];
        }
        /**************************************************************************************************/
        private void fastDataListView1_FormatRow(object sender, FormatRowEventArgs e)
        {
            //e.Item.SubItems[1].Text = (e.DisplayIndex + 1).ToString() + ": ";

            //if (e.Item.SubItems[3].Text == "1/1/0001")
            //if ((DateTime)((PendingGeneticTest)(e.Model)).datePanelOrdered == DateTime.MinValue)
            //{
            //    e.Item.SubItems[3].Text = "";
            //}
        }
Beispiel #34
0
 private void list_FormatRow_1(object sender, FormatRowEventArgs e) {
     match_item i = e.Item.RowObject as match_item;
     if (i != null) {
         e.Item.BackColor = i.bg(this);
         e.Item.ForeColor = i.fg(this);
     }
 }
 private void Params_FormatRow(object sender, FormatRowEventArgs e)
 {
     if (e != null && e.ListView != null && e.ListView.Items.Count > 0)
     {
         if (_changes.ContainsKey(((data)e.Model).paramname))
             e.Item.BackColor = Color.Green;
         else
             e.Item.BackColor = this.BackColor;
     }
 }
Beispiel #36
0
        private void formatRow(object sender, FormatRowEventArgs e)
        {
            e.UseCellFormatEvents = true;

            ObjectListView tempOLV = (ObjectListView)sender;

            foreach (ListViewItem row in tempOLV.Items)
            {
                RoundLine modelLine = (RoundLine)tempOLV.GetModelObject(row.Index);
                if (modelLine != null)
                    row.BackColor = roundColors[modelLine.Round % roundColors.Count];
            }
        }
Beispiel #37
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 olvClosures_FormatRow(object sender, FormatRowEventArgs e)
        {
            AccountingClosure closure = (AccountingClosure)e.Model;

            if(closure.Deleted)
                e.Item.ForeColor = Color.Gray;
        }