public static void ApplyThemeToStream(Stream stream, bool reverse = false) { IsReverseMode = reverse; if (stream != null) { OnPatchStart?.Invoke(null, EventArgs.Empty); ChangeThemeByte(stream); stream.Dispose(); } }
static void ChangeThemeByte(Stream stream) { if (ThemeByteOffset != -1) { OnPatchStart?.Invoke(null, EventArgs.Empty); stream.Position = ThemeByteOffset; stream.WriteByte(IsReverseMode ? LightByte : DarkByte); OnComplete?.Invoke(null, IsReverseMode); } else { throw new OffsetNotFoundException(); } }