Ejemplo n.º 1
0
        public Label CreateCategoryLabelControl(CitationCategory citCat, Category cat, ContextMenuStrip menu, ToolTip toolTip)
        {
            Label l = new Label();

            Color[] color    = ColorStuff.ConvertStringToColors(cat.CategoryColor);
            Color   catColor = color.Any() ? color[0] : m_LabelDefaultColor;

            Font newFont = new Font("Times New Roman", 10, FontStyle.Regular);

            l.Font             = newFont;
            l.MouseHover      += L_MouseHover;
            l.MouseEnter      += L_MouseEnter;
            l.MouseLeave      += L_MouseLeave;
            l.AutoSize         = true;
            l.BackColor        = catColor;
            l.Text             = $"{cat.Code} [{citCat.Weight}]";
            l.ContextMenuStrip = menu;
            if (citCat.IsMain)
            {
                SetMainStyleOnLabel(l);
            }
            l.Tag = citCat;
            toolTip.SetToolTip(l, cat.Name + Environment.NewLine + cat.Description);
            return(l);
        }
Ejemplo n.º 2
0
 public CategoryChangedEventArgs(CitationCategory citationCategory)
 {
     CitationCategory = citationCategory;
 }