Last active
May 3, 2025 01:21
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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