private Brush[] GetBrushes(Color c, CornerRadius cornerRadius)
 {
     if (SystemDropShadowChrome._commonBrushes == null)
     {
         lock (SystemDropShadowChrome._resourceAccess) {
             if (SystemDropShadowChrome._commonBrushes == null)
             {
                 SystemDropShadowChrome._commonBrushes      = SystemDropShadowChrome.CreateBrushes(c, cornerRadius);
                 SystemDropShadowChrome._commonCornerRadius = cornerRadius;
             }
         }
     }
     if (c == ((SolidColorBrush)SystemDropShadowChrome._commonBrushes[4]).Color && cornerRadius == SystemDropShadowChrome._commonCornerRadius)
     {
         this._brushes = (Brush[])null;
         return(SystemDropShadowChrome._commonBrushes);
     }
     else
     {
         if (this._brushes == null)
         {
             this._brushes = SystemDropShadowChrome.CreateBrushes(c, cornerRadius);
         }
         return(this._brushes);
     }
 }
        private static Brush[] CreateBrushes(Color c, CornerRadius cornerRadius)
        {
            Brush[] brushArray = new Brush[9];
            brushArray[4] = (Brush) new SolidColorBrush(c);
            brushArray[4].Freeze();
            GradientStopCollection stops = SystemDropShadowChrome.CreateStops(c, 0.0);
            LinearGradientBrush    linearGradientBrush1 = new LinearGradientBrush(stops, new Point(0.0, 1.0), new Point(0.0, 0.0));

            linearGradientBrush1.Freeze();
            brushArray[1] = (Brush)linearGradientBrush1;
            LinearGradientBrush linearGradientBrush2 = new LinearGradientBrush(stops, new Point(1.0, 0.0), new Point(0.0, 0.0));

            linearGradientBrush2.Freeze();
            brushArray[3] = (Brush)linearGradientBrush2;
            LinearGradientBrush linearGradientBrush3 = new LinearGradientBrush(stops, new Point(0.0, 0.0), new Point(1.0, 0.0));

            linearGradientBrush3.Freeze();
            brushArray[5] = (Brush)linearGradientBrush3;
            LinearGradientBrush linearGradientBrush4 = new LinearGradientBrush(stops, new Point(0.0, 0.0), new Point(0.0, 1.0));

            linearGradientBrush4.Freeze();
            brushArray[7] = (Brush)linearGradientBrush4;
            GradientStopCollection gradientStopCollection1 = cornerRadius.TopLeft != 0.0 ? SystemDropShadowChrome.CreateStops(c, cornerRadius.TopLeft) : stops;
            RadialGradientBrush    radialGradientBrush1    = new RadialGradientBrush(gradientStopCollection1);

            radialGradientBrush1.RadiusX        = 1.0;
            radialGradientBrush1.RadiusY        = 1.0;
            radialGradientBrush1.Center         = new Point(1.0, 1.0);
            radialGradientBrush1.GradientOrigin = new Point(1.0, 1.0);
            radialGradientBrush1.Freeze();
            brushArray[0] = (Brush)radialGradientBrush1;
            GradientStopCollection gradientStopCollection2 = cornerRadius.TopRight != 0.0 ? (cornerRadius.TopRight != cornerRadius.TopLeft ? SystemDropShadowChrome.CreateStops(c, cornerRadius.TopRight) : gradientStopCollection1) : stops;
            RadialGradientBrush    radialGradientBrush2    = new RadialGradientBrush(gradientStopCollection2);

            radialGradientBrush2.RadiusX        = 1.0;
            radialGradientBrush2.RadiusY        = 1.0;
            radialGradientBrush2.Center         = new Point(0.0, 1.0);
            radialGradientBrush2.GradientOrigin = new Point(0.0, 1.0);
            radialGradientBrush2.Freeze();
            brushArray[2] = (Brush)radialGradientBrush2;
            GradientStopCollection gradientStopCollection3 = cornerRadius.BottomLeft != 0.0 ? (cornerRadius.BottomLeft != cornerRadius.TopLeft ? (cornerRadius.BottomLeft != cornerRadius.TopRight ? SystemDropShadowChrome.CreateStops(c, cornerRadius.BottomLeft) : gradientStopCollection2) : gradientStopCollection1) : stops;
            RadialGradientBrush    radialGradientBrush3    = new RadialGradientBrush(gradientStopCollection3);

            radialGradientBrush3.RadiusX        = 1.0;
            radialGradientBrush3.RadiusY        = 1.0;
            radialGradientBrush3.Center         = new Point(1.0, 0.0);
            radialGradientBrush3.GradientOrigin = new Point(1.0, 0.0);
            radialGradientBrush3.Freeze();
            brushArray[6] = (Brush)radialGradientBrush3;
            RadialGradientBrush radialGradientBrush4 = new RadialGradientBrush(cornerRadius.BottomRight != 0.0 ? (cornerRadius.BottomRight != cornerRadius.TopLeft ? (cornerRadius.BottomRight != cornerRadius.TopRight ? (cornerRadius.BottomRight != cornerRadius.BottomLeft ? SystemDropShadowChrome.CreateStops(c, cornerRadius.BottomRight) : gradientStopCollection3) : gradientStopCollection2) : gradientStopCollection1) : stops);

            radialGradientBrush4.RadiusX        = 1.0;
            radialGradientBrush4.RadiusY        = 1.0;
            radialGradientBrush4.Center         = new Point(0.0, 0.0);
            radialGradientBrush4.GradientOrigin = new Point(0.0, 0.0);
            radialGradientBrush4.Freeze();
            brushArray[8] = (Brush)radialGradientBrush4;
            return(brushArray);
        }