So I have these two methods:
public static string Figure2D()
{
dynamic shapeValue;
do
{
shapeValue = Presentation.Present();
}
while (shapeValue.Is3D);
return shapeValue.ToString("R");
}
public static string Figure3D()
{
dynamic shapeValue;
do
{
shapeValue = Presentation.Present();
}
while (!shapeValue.Is3D);
return shapeValue.ToString("R");
}
The only difference between them is the while-condition. How can I merge these two into one function? Passing parameter values is probably necessary & acceptable, but I do like to keep it short. Any ideas?