Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active May 3, 2025 01:21
Show Gist options
  • Save mcsee/23fe261d7b1d9a4acc44a1da5b5ec6e9 to your computer and use it in GitHub Desktop.
Save mcsee/23fe261d7b1d9a4acc44a1da5b5ec6e9 to your computer and use it in GitHub Desktop.
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com
public static class WallpaperInitializer
{
private static bool wallpaperWasDefined = false;
public static void InitializeWallpaper()
{
if (wallpaperWasDefined)
// Assume this was defined previously
// and PLEASE DON'T use NULLs in case you hadn't
{
LoadWallpaperBitmap();
Report(WallpaperReady);
// Missed if wallpaper is undefined
}
// No default report, causing delays
}
private static void LoadWallpaperBitmap()
{
}
private static void Report(string status)
{
// The Asynchronous loading keeps on
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment