コード例 #1
0
        private string ParseSolidColor(string value)
        {
            string      id = "_solid" + value;
            PaintServer result;

            if (this.m_servers.TryGetValue(id, out result))
            {
                return(id);
            }
            result             = new SolidColorPaintServer(this, ParseHexColor(value));
            this.m_servers[id] = result;
            return(id);
        }
コード例 #2
0
        private string ParseKnownColor(string value)
        {
            LoadKnownColors();
            PaintServer result;

            if (this.m_servers.TryGetValue(value, out result))
            {
                return(value);
            }
            Color c;

            if (m_knownColors.TryGetValue(value, out c))
            {
                result = new SolidColorPaintServer(this, c);
                this.m_servers[value] = result;
                return(value);
            }
            return(null);
        }
コード例 #3
0
 public void CreateServerFromBrush(string key, Brush customBrush)
 {
     if (customBrush is SolidColorBrush)
     {
         m_servers[key] = new SolidColorPaintServer(this, customBrush);
     }
     else if (customBrush is LinearGradientBrush)
     {
         m_servers[key] = new LinearGradientColorPaintServerPaintServer(this, customBrush);
     }
     else if (customBrush is RadialGradientBrush)
     {
         m_servers[key] = new RadialGradientColorPaintServerPaintServer(this, customBrush);
     }
     else if (customBrush is DrawingBrush)
     {
         m_servers[key] = new PatternPaintServer(this, customBrush);
     }
     else if (customBrush != null)
     {
         m_servers[key] = new PaintServer(this, customBrush);
     }
 }
コード例 #4
0
ファイル: PaintServerManager.cs プロジェクト: swcomp/SVGImage
 private SolidColorPaintServer ParseSolidColor(string value)
 {
     string id = "_solid" + value;
     PaintServer result;
     if (this.m_servers.TryGetValue(id, out result)) return result as SolidColorPaintServer;
     result = new SolidColorPaintServer(this, ParseHexColor(value));
     this.m_servers[id] = result;
     return result as SolidColorPaintServer;
 }
コード例 #5
0
ファイル: PaintServerManager.cs プロジェクト: swcomp/SVGImage
 private SolidColorPaintServer ParseKnownColor(string value)
 {
     LoadKnownColors();
     PaintServer result;
     if (this.m_servers.TryGetValue(value, out result)) return result as SolidColorPaintServer;
     Color c;
     if (m_knownColors.TryGetValue(value, out c))
     {
         result = new SolidColorPaintServer(this, c);
         this.m_servers[value] = result;
         return result as SolidColorPaintServer;
     }
     return null;
 }