Ejemplo n.º 1
0
        void fastListView_FormatCell(object sender, FormatCellEventArgs e)
        {
            if (e.ColumnIndex == 12)
            {
                Game game = (Game)e.Model;
                uint val;
                switch (Properties.Settings.Default.DefaultRegion)
                {
                case 0:
                    val = 0x000000FF;
                    break;

                case 1:
                    val = 0x00FF0000;
                    break;

                default:
                    val = 0x0000FF00;
                    break;
                }
                if (!string.IsNullOrEmpty(game.RegionCode))
                {
                    e.SubItem.BackColor = (Convert.ToUInt32(game.RegionCode, 16) & val) == 0 ? Color.Red : Color.LightGreen;
                }
            }
        }
Ejemplo n.º 2
0
        private void tlvTableInfoMigrations_FormatCell(object sender, FormatCellEventArgs e)
        {
            var ci = e.Model as ColumnInfo;

            if (ci != null)
            {
                if (_planManager.GetPlanForColumnInfo(ci).IsMandatory)
                {
                    e.SubItem.BackColor = lblMandatory.BackColor;
                }
            }

            if (e.Column == olvMigrationPlan)
            {
                if (e.Model is ColumnInfo)
                {
                    e.SubItem.Font = new Font(e.Item.Font, FontStyle.Underline);
                }
                else
                {
                    e.SubItem.Font      = new Font(e.Item.Font, FontStyle.Italic);
                    e.SubItem.ForeColor = Color.Gray;
                }
            }

            if (e.CellValue as string == "pick")
            {
                e.SubItem.ForeColor = Color.Blue;
                e.SubItem.Font      = new Font(e.Item.Font, FontStyle.Underline);
            }
        }
Ejemplo n.º 3
0
        private void ListView_FormatCell(object sender, FormatCellEventArgs e)
        {
            if (string.IsNullOrEmpty(e.Column.Text))
            {
                e.SubItem.ForeColor = Color.DarkGray;
            }

            if (e.Model is ProcessRowModel model && model.PreviousValues != null)
            {
                var columnIndex = e.ColumnIndex - _fixColumnCount;
                if (columnIndex >= 0)
                {
                    var valueIndex = columnIndex / 2;

                    var previousValue = valueIndex < model.PreviousValues.Length ? model.PreviousValues[valueIndex] : null;
                    var newValue      = valueIndex < model.NewValues.Length ? model.NewValues[valueIndex] : null;

                    if (valueIndex % 2 == 0)
                    {
                        if (!DefaultValueComparer.ValuesAreEqual(previousValue, newValue))
                        {
                            e.SubItem.BackColor = Color.LightBlue;
                        }
                    }
                    else if ((previousValue == null != (newValue == null)) ||
                             (previousValue != null && newValue != null && previousValue.GetType() != newValue.GetType()))
                    {
                        e.SubItem.BackColor = Color.LightBlue;
                    }
                }
            }
        }
        private void fastObjectListViewPokemon_FormatCell(object sender, FormatCellEventArgs e)
        {
            PokemonManager pokemon = e.Model as PokemonManager;

            if (pokemon != null)
            {
                if (e.Column == this.olvColumnAutoEvolve)
                {
                    e.SubItem.ForeColor = (pokemon.AutoEvolve) ? Color.Green : Color.Red;
                }
                else if (e.Column == this.olvColumnAutoFavorite)
                {
                    e.SubItem.ForeColor = (pokemon.AutoFavorite) ? Color.Green : Color.Red;
                }
                else if (e.Column == this.olvColumnAutoUpgrade)
                {
                    e.SubItem.ForeColor = (pokemon.AutoUpgrade) ? Color.Green : Color.Red;
                }
                else if (e.Column == this.olvColumnAutoRenameWithIv)
                {
                    e.SubItem.ForeColor = (pokemon.AutoRenameWithIv) ? Color.Green : Color.Red;
                }
            }

            //if (e.Column == this.olvColumnPokemonId)
            //    e.SubItem.ForeColor = Color.Purple;
            //else if (e.Column == olvColumnIvAboveOrEqualTo)
            //    e.SubItem.ForeColor = Color.Blue;
            //else
        }
Ejemplo n.º 5
0
 public virtual void FormatCell(FormatCellEventArgs format)
 {
     if (format.Column.Text == "Kind")
     {
         format.SubItem.ForeColor = GetColor();
     }
 }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
 private void Abrechnungsliste_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == StatusSpalte.Index)
     {
         Util.AbrechnungFormatieren(e);
     }
 }
 public override void Format(FormatCellEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         e.SubItem.Font = new Font(e.SubItem.Font, FontStyle.Bold);
     }
 }
Ejemplo n.º 9
0
 private void Benutzerliste_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == GuthabenSpalte.Index)
     {
         Util.KontostandFormatieren(e);
     }
 }
Ejemplo n.º 10
0
 private void olv1_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Column.Text == "Cyjan")
     {
         Database.MachineRecord record = (Database.MachineRecord)e.Model;
         if (record.tonerLowLever_C)
         {
             e.SubItem.BackColor = Color.Red;
         }
     }
     else if (e.Column.Text == "Żółty")
     {
         Database.MachineRecord record = (Database.MachineRecord)e.Model;
         if (record.tonerLowLever_Y)
         {
             e.SubItem.BackColor = Color.Red;
         }
     }
     else if (e.Column.Text == "Czarny")
     {
         Database.MachineRecord record = (Database.MachineRecord)e.Model;
         if (record.tonerLowLever_K)
         {
             e.SubItem.BackColor = Color.Red;
         }
     }
     else if (e.Column.Text == "Magenta")
     {
         Database.MachineRecord record = (Database.MachineRecord)e.Model;
         if (record.tonerLowLever_M)
         {
             e.SubItem.BackColor = Color.Red;
         }
     }
 }
        private void formatRow(object sender, FormatCellEventArgs e)
        {
            // 4 since at index 4 the Room-attributes stop, and the 24h columns begins
            if (e.ColumnIndex > 4)
            {
                Room r     = (Room)e.Model;
                int  index = e.ColumnIndex - 5;

                string text      = null;
                Color  backColor = default(Color);
                if (r.RoomStateOnHour != null)
                {
                    switch (r.RoomStateOnHour[index])
                    {
                    case RoomState.AVAILABLE:
                        text      = (index < 10 ? "0" : "") + index + ":00";
                        backColor = Color.LightGreen;
                        break;

                    case RoomState.BOOKED:
                        text      = "Bokad";
                        backColor = Color.IndianRed;
                        break;

                    case RoomState.BUILDING_CLOSED:
                        text      = "Stängt";
                        backColor = Color.LightGray;
                        break;
                    }
                }
                e.SubItem.Text      = text;
                e.SubItem.BackColor = backColor;
            }
        }
 private void targetTreeView_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == this.targetColumn.Index)
     {
         setAbstractItalic(e);
     }
 }
Ejemplo n.º 13
0
 private void ListView_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Column.Text))
     {
         e.SubItem.ForeColor = Color.DarkGray;
     }
 }
 private void ChatTable_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Column.Text == ProjectInfo.SenderFieldKey)
     {
         e.SubItem.ForeColor = ProjectInfo.Data.UserColors[e.SubItem.Text];
     }
 }
Ejemplo n.º 15
0
 private void NGListView_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Column.IsVisible)
     {
         e.SubItem.Decoration = deco;
     }
 }
        private void ListView_FormatCell(object sender, FormatCellEventArgs e)
        {
            object item = e.Model;

            if (item != null)
            {
                PropertyInfo p = item.GetType().GetProperty("IsArchived");
                if (p != null && p.PropertyType == typeof(bool) && (bool)(p.GetValue(item)) == true)
                {
                    e.SubItem.ForeColor = Color.Gray;
                }
                else
                {
                    if (e.Column.AspectName == null)
                    {
                        return;
                    }
                    Type         pType       = AttrHelper.GetPropertyType(SourceObjectType, e.Column.AspectName);
                    PropertyInfo propInfo    = SourceObjectType.GetProperty(e.Column.AspectName);
                    JExpired     expiredProp = AttrHelper.GetAttribute <JExpired>(propInfo);
                    if (expiredProp != null)
                    {
                        object propValue = null;
                        if (expiredProp.ExpiredProperty != null)
                        {
                            PropertyInfo propInfo1 = SourceObjectType.GetProperty(expiredProp.ExpiredProperty);
                            if (propInfo1 != null)
                            {
                                propValue = AttrHelper.GetPropertyValue(e.Model, propInfo1);
                            }
                        }
                        else
                        {
                            propValue = AttrHelper.GetPropertyValue(e.Model, propInfo);
                        }
                        if (propValue != null)
                        {
                            ModelHelper.ExpiredToColor(propValue.ToString(), e.SubItem.ForeColor);
                        }
                    }
                    else
                    {
                        JDictProp dictProp = AttrHelper.GetAttribute <JDictProp>(propInfo);
                        if (dictProp != null &&
                            (dictProp.DictPropertyStyle == DisplyPropertyStyle.ColoredTextOnly || dictProp.DictPropertyStyle == DisplyPropertyStyle.ColoredTextAndImage))
                        {
                            object propValue = AttrHelper.GetPropertyValue(e.Model, propInfo);
                            if (propValue != null)
                            {
                                JDictItem ditem = Dm.Instance.GetDictText(dictProp.Id, propValue.ToString());
                                if (ditem != null && ditem.TextColor != null && ditem.TextColor != Color.Black)
                                {
                                    e.SubItem.ForeColor = ditem.TextColor;
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 17
0
        private void ListView_FormatCell(object sender, FormatCellEventArgs e)
        {
            if (e.ColumnIndex == column_type.Index)
            {
                ExchangeManager.ExchangeOrder item = (ExchangeManager.ExchangeOrder)e.Model;

                switch (item.type)
                {
                case "deposit":
                case "payin":
                case "buy":
                    e.SubItem.BackColor = PreferenceManager.preferences.Theme.Green;
                    break;

                case "withdrawal":
                case "fee":
                case "payout":
                case "sell":
                    e.SubItem.BackColor = PreferenceManager.preferences.Theme.Red;
                    break;

                default:
                    e.SubItem.BackColor = PreferenceManager.preferences.Theme.Yellow;
                    break;
                }
            }
        }
Ejemplo n.º 18
0
        private void UpdateFontsTreeListView(object sender, FormatCellEventArgs e)
        {
            if (!(e.Model is HierarchyNode node))
            {
                return;
            }

            if (node.Script != null)
            {
                if (node.Script.IsDirty)
                {
                    e.SubItem.Font = Fonts.DirtyScript;//.AddFont(Fonts.DirtyScript);
                }
                else
                {
                    e.SubItem.Font = Fonts.Default;
                }
            }

            if (node.Command != null)
            {
                if (node == m_HighlightedNode)
                {
                    e.SubItem.BackColor = SystemColors.Highlight;
                }
            }
        }
Ejemplo n.º 19
0
        private void FastObjectListViewEggs_FormatCell(object sender, FormatCellEventArgs e)
        {
            var egg          = (PokemonData)e.Model;
            var eggIncubator = new EggIncubator();

            foreach (var inc in _manager.Incubators)
            {
                if (inc.PokemonId == egg.Id)
                {
                    eggIncubator = inc;
                }
            }

            if (e.Column == olvColumnEggWalked)
            {
                if (eggIncubator.PokemonId != 0)
                {
                    e.SubItem.Text = String.Format("{0:0.00} km", _manager.Stats.KmWalked - eggIncubator.StartKmWalked);
                }
                else
                {
                    e.SubItem.Text = "0.00 km";
                }
            }
            else if (e.Column == olvColumnEggDistance)
            {
                e.SubItem.Text = String.Format("{0:0.00}km", egg.EggKmWalkedTarget);
            }
        }
Ejemplo n.º 20
0
        private void olvComplex_FormatCell(object sender, FormatCellEventArgs e)
        {
            Person p = (Person)e.Model;

            // Put a love heart next to Nicola's name :)
            if (e.ColumnIndex == 0)
            {
                if (e.SubItem.Text.ToLowerInvariant().StartsWith("nicola"))
                {
                    e.SubItem.Decoration = new ImageDecoration(Resource1.loveheart, 64);
                }
                else
                {
                    e.SubItem.Decoration = null;
                }
            }

            // If the occupation is missing a value, put a composite decoration over it
            // to draw attention to.
            if (e.ColumnIndex == 1 && e.SubItem.Text == "")
            {
                TextDecoration decoration = new TextDecoration("Missing!", 255);
                decoration.Alignment = ContentAlignment.MiddleCenter;
                decoration.Font      = new Font(this.Font.Name, this.Font.SizeInPoints + 2);
                decoration.TextColor = Color.Firebrick;
                decoration.Rotation  = -20;
                e.SubItem.Decoration = decoration;
                CellBorderDecoration cbd = new CellBorderDecoration();
                cbd.BorderPen      = new Pen(Color.FromArgb(128, Color.Firebrick));
                cbd.FillBrush      = null;
                cbd.CornerRounding = 4.0f;
                e.SubItem.Decorations.Add(cbd);
            }
        }
 public override void Format(FormatCellEventArgs e)
 {
     base.Format(e);
     if (e.ColumnIndex > abrechnung.Verkaufsprodukte.Count)
     {
         e.SubItem.Font = new Font(e.SubItem.Font, FontStyle.Bold);
     }
 }
Ejemplo n.º 22
0
 private void olvDetails_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Column == olvUnsign)
     {
         e.SubItem.Font      = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold | FontStyle.Underline);
         e.SubItem.ForeColor = Color.Gray;
     }
 }
Ejemplo n.º 23
0
 private void TreeListView_FormatCell(object sender, FormatCellEventArgs e)
 {
     //Item itm = (Item)e.Model;
     if (e.ColumnIndex == 2 && (string)e.CellValue == "No")
     {
         e.SubItem.BackColor = Color.Pink;
     }
 }
Ejemplo n.º 24
0
 private void objectListView1_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == this.olvColumn1.Index)
     {
         e.Item.ForeColor = SystemColors.Highlight;
         e.Item.Font      = new Font(e.Item.Font, FontStyle.Bold);
     }
 }
Ejemplo n.º 25
0
 private void Verbrauchliste_FormatCell(object sender, FormatCellEventArgs e)
 {
     // Im Augenblick nicht aktiv
     if (e.Model is BestandProxy && e.ColumnIndex == 0)
     {
         e.SubItem.Font = new Font(e.SubItem.Font, FontStyle.Bold);
     }
 }
Ejemplo n.º 26
0
        private void fastObjectListViewLogs_FormatCell(object sender, FormatCellEventArgs e)
        {
            LogModel log = e.Model as LogModel;

            if (log != null)
            {
                e.SubItem.ForeColor = log.GetLogColor();
            }
        }
Ejemplo n.º 27
0
        private void UpdateFontsTreeListView(object sender, FormatCellEventArgs e)
        {
            var node = e.Model as TestNode;

            if (node == m_HighlightedNode)
            {
                e.SubItem.BackColor = SystemColors.Highlight;
            }
        }
Ejemplo n.º 28
0
 void olvDataLoads_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.ColumnIndex == olvStatus.Index)
     {
         e.SubItem.ForeColor = ((DataLoadsGraphResult)e.Model).Status != DataLoadsGraphResultStatus.Succeeding
             ? Color.Red
             : Color.Black;
     }
 }
Ejemplo n.º 29
0
 private void treeListView1_FormatCell(object sender, FormatCellEventArgs e)
 {
     if (e.Model is OLVCardItem)
     {
         var padding = new Rectangle {
             X = -10
         };
         e.Item.CellPadding = padding;
     }
 }
Ejemplo n.º 30
0
        protected override void Tree_FormatCell(object sender, FormatCellEventArgs e)
        {
            if (e.Column == ColumnOffset)
            {
                // Physical Address/Offset
                e.SubItem.ForeColor = Color.Gray;
            }
            else if (e.Column == ColumnMXFObject)
            {
                MXFObject obj = e.Model as MXFObject;

                if (obj is ILazyLoadable loadable && !loadable.IsLoaded)
                {
                    e.SubItem.Font = new Font(e.SubItem.Font, FontStyle.Italic);
                }
                else
                {
                    e.SubItem.Font = new Font(e.SubItem.Font, FontStyle.Regular);
                }

                switch (obj.Type)
                {
                case MXFObjectType.Partition:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_Partition;
                    break;

                case MXFObjectType.Essence:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_Essence;
                    break;

                case MXFObjectType.Index:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_IndexTable;
                    break;

                case MXFObjectType.SystemItem:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_SystemItem;
                    break;

                case MXFObjectType.RIP:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_RIP;
                    break;

                case MXFObjectType.Meta:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_MetaData;
                    break;

                case MXFObjectType.Filler:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_Filler;
                    break;

                case MXFObjectType.Special:
                    e.SubItem.ForeColor = Properties.Settings.Default.Color_Special;
                    break;
                }
            }
 void olv_FormatCell(object sender, FormatCellEventArgs e) {
     e.SubItem.ForeColor = this.testCellForeColor;
     e.SubItem.BackColor = this.testCellBackColor;
 }