Esempio n. 1
0
        public PaintStyleResult ResolvePaintStyle(PaintStyle ps, PaintStyleUse pst = PaintStyleUse.Background)
        {
            PaintStyle?      psTemp = null;
            PaletteEntryBase pRef   = null;

            // check for inherited data
            if (ps.StyleType == PaletteEntryType.Inherited)
            {
                psTemp = Atomic.FindPaintStyleByUsage(pst);
            }
            else
            {
                psTemp = ps;
            }

            if (psTemp.HasValue)
            {
                PaintStyle resolved = psTemp.Value;

                // resolve palette reference if needed
                if (resolved.StyleType == PaletteEntryType.PaletteReference)
                {
                    pRef = Atomic.FindPaintStyleTarget(resolved);
                }

                return(BlockBase.PreparePaintStyleResults(ref resolved, pRef));
            }
            else
            {
                return(new PaintStyleResult(PaintStyleResult.Result.NotFound, null));
            }
        }
Esempio n. 2
0
        public PaintStyle?FindPaintStyleByUsage(PaintStyleUse pst)
        {
            PaintStyle?temp = null;

            switch (pst)
            {
            case PaintStyleUse.Background:
                temp = BackgroundStyle;
                break;

            case PaintStyleUse.Foreground:
                temp = ForegroundStyle;
                break;
            }

            return(temp);
        }