/// <summary>using( GradientFillScope ){ /*code*/ } temporarily enables gradient fill within that scope, automatically restoring the previous state once you leave the scope</summary> public static GradientFillStack GradientFillScope() { GradientFillStack stack = new GradientFillStack(Draw.UseGradientFill, Draw.GradientFill); Draw.UseGradientFill = true; return(stack); }
/// <summary>using( GradientFillScope ){ /*code*/ } temporarily enables and overrides gradient fill within that scope, automatically restoring the previous state once you leave the scope</summary> public static GradientFillStack GradientFillScope(GradientFill fill) { GradientFillStack stack = new GradientFillStack(Draw.UseGradientFill, Draw.GradientFill); // pushes Draw.UseGradientFill = true; Draw.GradientFill = fill; return(stack); }