Exemple #1
0
        public BrushInfo GetBrushInfo(ToolBar bar, string patternOfProdID)
        {
            BrushInfo brushinfo = null;

            if (bar.State == EqpState.SETUP)
            {
                brushinfo = new BrushInfo(Color.Red);
            }
            else if (bar.State == EqpState.PM)
            {
                brushinfo = new BrushInfo(HatchStyle.Divot, Color.Black, Color.OrangeRed);
            }
            else if (bar.State == EqpState.DOWN)
            {
                brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Gray, Color.Black);
            }
            else if (bar.IsGhostBar)
            {
                brushinfo = new BrushInfo(HatchStyle.Percent30, Color.LightGray, Color.White);
            }
            else
            {
                var color = ColorGenHelper.GetColorByKey(bar.ToolID, ColorGenHelper.CATETORY_MASK); //ColorGen.GetColor(bar.ToolID);

                if (bar.State == EqpState.IDLERUN)
                {
                    brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Black, color);
                }
                else
                {
                    brushinfo = new BrushInfo(color);
                }
            }

            var selBar = this.SelectedBar;

            if (!this.EnableSelect || selBar == null)
            {
                bar.BackColor = brushinfo.BackColor;
                return(brushinfo);
            }

            if (!CompareToSelectedBar(bar, patternOfProdID))
            {
                bar.BackColor = brushEmpth.BackColor;
                return(brushEmpth);
            }

            bar.BackColor = brushinfo.BackColor;
            return(brushinfo);
        }
Exemple #2
0
        public BrushInfo GetBrushInfo(GanttBar bar)
        {
            BrushInfo brushinfo = new BrushInfo(ColorGenHelper.GetColorByKey(bar.BarKey, ColorGenHelper.CATETORY_PRODUCT));
            var       selBar    = this.SelectedBar;

            if (!this.EnableSelect || selBar == null)
            {
                bar.BackColor = brushinfo.BackColor;
                return(brushinfo);
            }

            if (!CompareToSelectedBar(bar))
            {
                bar.BackColor = brushEmpth.BackColor;
                return(brushEmpth);
            }

            bar.BackColor = brushinfo.BackColor;
            return(brushinfo);
        }
Exemple #3
0
        private Color GetBarColorByProductID(string productID)
        {
            Color color = this.BackColor;

            if (string.IsNullOrEmpty(productID))
            {
                return(color);
            }

            if (this.IsUsedProdColor)
            {
                Color prodColor;
                if (this.ProdColors.TryGetValue(productID, out prodColor))
                {
                    color = prodColor;
                }
            }
            else
            {
                color = ColorGenHelper.GetColorByKey(productID, ColorGenHelper.CATETORY_PRODUCT);
            }

            return(color);
        }