yx-chen/EcC
Text Classification • Updated
record_id stringlengths 64 64 | pre_code stringlengths 23 722k ⌀ | post_code stringlengths 24 183k ⌀ | labels listlengths 1 3 | modify_subtypes listlengths 0 5 | repo_id stringclasses 59
values | commit_sha stringlengths 40 40 | source_id stringlengths 64 64 | language stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
c903ab3e3c9ee17ed69a9e9561d464349d780baf5852f7d3d92e134fe99c03c5 | /// <summary>
/// Save text to a file with requested encoding
/// Exception will be thrown if not succeeded
/// Exception should be caught and handled by caller
/// </summary>
public static async Task WriteTextToFileAsync(StorageFile file, string text, Encoding encoding)
{
bool usedDeferUpdates = true;
try
... | /// <summary>
/// Save text to a file with requested encoding
/// Exception will be thrown if not succeeded
/// Exception should be caught and handled by caller
/// </summary>
public static async Task WriteTextToFileAsync(StorageFile file, string text, Encoding encoding)
{
await ExecuteFileIOWithRetries(file, asy... | [
"Delete"
] | [] | 0x7c13/Notepads | 15e4184442af9bb9bf770013d1a3b648fc7d9724 | c98a78be841ab5ed7e2a6c4228a007d63d9f6b851fd66b28bce59789f8a2dd1b | C# |
7dd8ea203420a3e828f86c02e8da42e2cabe59f9299d57383d334fc286e3b211 | private async Task ActivateAsync(IActivatedEventArgs e)
{
bool rootFrameCreated = false;
if (!(Window.Current.Content is Frame rootFrame))
{
rootFrame = CreateRootFrame(e);
Window.Current.Content = rootFrame;
rootFrameCreated = true;
ThemeSettingsService.Initialize();... | private async Task ActivateAsync(IActivatedEventArgs e)
{
bool rootFrameCreated = false;
if (!(Window.Current.Content is Frame rootFrame))
{
rootFrame = CreateRootFrame(e);
Window.Current.Content = rootFrame;
rootFrameCreated = true;
ThemeSettingsService.Initialize();... | [
"None"
] | [] | 0x7c13/Notepads | ca49f7f703faae95d95525a576654606f993e65b | 39d4c5e80f796a1e01cff2ae3fa71bc904947d2d255cc8890b071d54b21af340 | C# |
5e27843b0a9ad0adebbf2e96da529fb00e1f8d141d88bdb1ce66e5fd3fb8ba3a | private void FontWeightPicker_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var selectedValue = (string)e.AddedItems.First();
EditorSettingsService.EditorFontWeight = FontUtility.TryGetFontWeight(selectedValue, out var fontWeight) ? new FontWeight()
{
Weight = fontWeight
... | private void FontWeightPicker_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
var selectedValue = FontUtility.PredefinedFontWeights[FontWeightPicker.SelectedIndex];
EditorSettingsService.EditorFontWeight = FontUtility.TryGetFontWeight(selectedValue, out var fontWeight) ? new FontWeight()
... | [
"None"
] | [] | 0x7c13/Notepads | d2e9e854e23a4907eb4ac8d973adad6dbae6bb60 | 6cc0c492e4323d112b4e431b55ea856674995bd90e8bab8de4fd5bb6d452f448 | C# |
f8357af8b9dbefb842dfc11f77298b86fabff34df26e16e64b53658a4cbf6896 | /// <summary>
/// Renders a code element
/// </summary>
/// <param name = "element"> The parsed inline element to render. </param>
/// <param name = "context"> Persistent state. </param>
protected override void RenderCodeRun(CodeInline element, IRenderContext context)
{
var localContext = context as InlineRenderC... | /// <summary>
/// Renders a code element
/// </summary>
/// <param name = "element"> The parsed inline element to render. </param>
/// <param name = "context"> Persistent state. </param>
protected override void RenderCodeRun(CodeInline element, IRenderContext context)
{
var localContext = context as InlineRenderC... | [
"Add"
] | [] | 0x7c13/Notepads | 8ce4b30fe334bdb1be7c03f16733b195cc3e5b02 | dc801b18393f29d2f3a624cb1b0db63f71db3bb4fa2d39a76d3a165e1eef7859 | C# |
1971f17f6d0cae1863c2d52381f58114dfce39ca14b37cb8c8221a547b3369d5 | protected override async void OnConnected()
{
await _semaphoreSlim.WaitAsync();
if (CompositionBrush == null)
{
try
{
CompositionBrush = await BuildHostBackdropAcrylicBrushAsync();
}
catch (Exception ex)
{
// Fallback to color brush ... | protected override async void OnConnected()
{
if (CompositionBrush == null)
{
await BuildInternalAsync();
}
base.OnConnected();
} | [
"Delete"
] | [] | 0x7c13/Notepads | d1ac90a4ad9f9a6104861792ca5485dba427a178 | dfed566224bf864fffd38ccfc4e96c3a38f305649dc6bd9b0a3e35bc2a2ba1bc | C# |
6890ab137b42852c31decceefef7640dce16f03cdfbd3b710f78e41b1a19955d | private static void InitializeThemeMode()
{
if (ApplicationSettingsStore.Read(SettingsKey.UseWindowsThemeBool)is bool useWindowsTheme)
{
_useWindowsTheme = useWindowsTheme;
}
else
{
_useWindowsTheme = true;
}
ThemeMode = ApplicationThemeToElementTheme(Application.... | private static void InitializeThemeMode()
{
if (ApplicationSettingsStore.Read(SettingsKey.UseWindowsThemeBool)is bool useWindowsTheme)
{
_useWindowsTheme = useWindowsTheme;
}
else
{
_useWindowsTheme = true;
}
_themeListener = new ThemeListener();
_themeListen... | [
"None"
] | [] | 0x7c13/Notepads | 8e3cc3a0a94307c7268cea35c1284e33be1d88e5 | 53c7c9226d9edd040097cd5154aa9c110663678daeb7723aa130d80c0cbe1542 | C# |
ed38e42cadc7baac29a400e5b2a72b0a577960dd668921a32d8c015990cbfcee | public bool GoTo(int line)
{
if (_isLineCachePendingUpdate)
{
_contentLinesCache = (_content + RichEditBoxDefaultLineEnding).Split(RichEditBoxDefaultLineEnding);
_isLineCachePendingUpdate = false;
}
Document.Selection.SetIndex(TextRangeUnit.Paragraph, line, false);
return t... | public bool GoTo(int line)
{
try
{
Document.Selection.SetIndex(TextRangeUnit.Paragraph, line, false);
return true;
}
catch (Exception)
{
return false;
}
} | [
"Add"
] | [] | 0x7c13/Notepads | d76d16d4197d971519fd3f2db10f43d995d631b4 | f1c85fd365a44db4b2cb98f7c9a24e7864c9822d183799eb5e0b2b8d54bb8516 | C# |
181a083ef512f9e49474a739987551cc7b60a230658fd805e5be25eb3485cc38 | public async Task<int> LoadLastSessionAsync()
{
if (_loaded)
{
return 0; // Already loaded
}
if (!(ApplicationSettingsStore.Read(SessionDataKey)is string data))
{
return 0; // No session data found
}
NotepadsSessionDataV1 sessionData;
try
{
se... | public async Task<int> LoadLastSessionAsync()
{
if (_loaded)
{
return 0; // Already loaded
}
var data = await SessionUtility.GetSerializedSessionMetaDataAsync();
if (data == null)
{
return 0; // No session data found
}
NotepadsSessionData sessionData;
... | [
"Modify"
] | [
"try_body_changed",
"catch_type_changed",
"catch_body_changed"
] | 0x7c13/Notepads | ee4ce21c739b63e0b38bd344d9afa12c771be400 | febc02cd589c0a4c2e6fe52506d677be338e009f5deadea2ba206d605ea97f4a | C# |
84123d93dfb8da6a9856332b02f107ccbcdfea31224f7e03c3bfcfa2415ffd77 | public static Encoding GetSystemCurrentANSIEncoding()
{
try
{
Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
return Encoding.GetEncoding(Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage);
}
catch (Exception ex)
{
LoggingService.Lo... | public static Encoding GetSystemCurrentANSIEncoding()
{
try
{
Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
var ansiCodePage = Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage;
var ansiEncoding = Encoding.GetEncoding(Thread.CurrentThread.Curren... | [
"Add",
"Modify"
] | [
"try_body_changed",
"catch_body_changed"
] | 0x7c13/Notepads | 59edb885a2511622e8e05a4e3cade985f10d1c57 | fb65a6a6fb5780e665427a0f831cd24d549c15ff9c22a9e3604487bf9394f3c8 | C# |
7e551e923a27ce9cebf5469a3f9e745821139ae8b23053c0d04f3daa1d7ea93b | public async void StartCheckingFileStatusPeriodically()
{
if (EditingFile == null)
return;
StopCheckingFileStatus();
var cancellationTokenSource = new CancellationTokenSource();
var cancellationToken = cancellationTokenSource.Token;
_fileStatusCheckerCancellationTokenSource = cancella... | public async void StartCheckingFileStatusPeriodically()
{
if (EditingFile == null)
return;
StopCheckingFileStatus();
var cancellationTokenSource = new CancellationTokenSource();
var cancellationToken = cancellationTokenSource.Token;
_fileStatusCheckerCancellationTokenSource = cancella... | [
"Modify"
] | [
"catch_added",
"catch_removed"
] | 0x7c13/Notepads | 03eec28c7fd31cad1281f395cfe9353268a15872 | 63e65720a20de2b4496e66a524e62cad0716c288a7b12e1e5fe8784b024c6ea9 | C# |
374d1385c2c444eb38686e2d23ccc98aa0cd371c19601384ecaaa35e94f330e5 | private async Task DeleteOrphanedBackupFilesAsync(NotepadsSessionDataV1 sessionData)
{
HashSet<string> backupPaths = sessionData.TextEditors.SelectMany(te => new[] { te.LastSaved?.BackupFilePath, te.Pending?.BackupFilePath }).ToHashSet(StringComparer.OrdinalIgnoreCase);
foreach (StorageFile backupFile in awa... | private async Task DeleteOrphanedBackupFilesAsync(NotepadsSessionDataV1 sessionData)
{
HashSet<string> backupPaths = sessionData.TextEditors.SelectMany(te => new[] { te.LastSaved?.BackupFilePath, te.Pending?.BackupFilePath }).ToHashSet(StringComparer.OrdinalIgnoreCase);
foreach (StorageFile backupFile in awa... | [
"Modify"
] | [
"catch_type_changed",
"catch_body_changed"
] | 0x7c13/Notepads | 03eec28c7fd31cad1281f395cfe9353268a15872 | 68f091872955dc72833e6fd87720e108fcc9c2a235045a7a7d3c202e199fd32a | C# |
aa670f1d62cdcb56c19dffee97318f190fa554b2d5699385435dbec6e9288a20 | private async Task<BackupMetadata> SaveLastSavedChangesAsync(TextEditor textEditor)
{
TextFile originalSnapshot = textEditor.OriginalSnapshot;
StorageFile backupFile;
try
{
backupFile = await SessionUtility.CreateNewBackupFileAsync(textEditor.Id.ToString("N") + "-LastSaved");
awai... | private async Task<BackupMetadata> SaveLastSavedChangesAsync(TextEditor textEditor)
{
TextFile originalSnapshot = textEditor.OriginalSnapshot;
StorageFile backupFile;
try
{
backupFile = await SessionUtility.CreateNewBackupFileAsync(textEditor.Id.ToString("N") + "-LastSaved");
awai... | [
"Modify"
] | [
"catch_type_changed",
"catch_body_changed"
] | 0x7c13/Notepads | 03eec28c7fd31cad1281f395cfe9353268a15872 | a7a9093db65c293af44bff6979f64bf3afa3bf7054057c78e4cc6b84e7bced52 | C# |
7fc0db89a5e43a631792e281eeb7c194219f4f729329291e8dcef630e001fb0c | public static bool TryAddToFutureAccessList(string token, StorageFile file)
{
try
{
StorageApplicationPermissions.FutureAccessList.AddOrReplace(token, file);
return true;
}
catch
{
return false;
}
} | public static bool TryAddToFutureAccessList(string token, StorageFile file)
{
try
{
StorageApplicationPermissions.FutureAccessList.AddOrReplace(token, file);
return true;
}
catch (Exception ex)
{
LoggingService.LogError($"Failed to add file [{file.Path}] to future ac... | [
"Modify"
] | [
"catch_type_changed",
"catch_body_changed"
] | 0x7c13/Notepads | 03eec28c7fd31cad1281f395cfe9353268a15872 | 4b82fe9526cb93b64f519c03e21fb6b485afb9fade35c8b6d702441b1135f09a | C# |
a1ebf052df3b874cfa10cb04712da030ba68ba53406066329b7442a71eb11d8f | public async void StartCheckingFileStatusPeriodically()
{
if (EditingFile == null)
return;
StopCheckingFileStatus();
var cancellationTokenSource = new CancellationTokenSource();
var cancellationToken = cancellationTokenSource.Token;
_fileStatusCheckerCancellationTokenSource = cancella... | public async void StartCheckingFileStatusPeriodically()
{
if (EditingFile == null)
return;
StopCheckingFileStatus();
var cancellationTokenSource = new CancellationTokenSource();
var cancellationToken = cancellationTokenSource.Token;
_fileStatusCheckerCancellationTokenSource = cancella... | [
"Modify"
] | [
"try_body_changed",
"catch_type_changed"
] | 0x7c13/Notepads | 910a31e23241b9be268e7536839db81c97c92ca6 | 0272c73f26ec997b94ef9ccc01db998dc6d638b5c12459bbf29be646ae4d1f15 | C# |
a6cb077d820fa0d2d8a52c0f5aef0f0f7cff8ce33387a0c917610f6001d71a17 | public MainPage()
{
InitializeComponent();
_defaultNewFileName = _resourceLoader.GetString("TextEditor_DefaultNewFileName");
NotificationCenter.Instance.SetNotificationDelegate(this);
// Setup theme
ThemeSettingsService.AppBackground = RootGrid;
ThemeSettingsService.SetRequestedTheme();
... | public MainPage()
{
InitializeComponent();
_defaultNewFileName = _resourceLoader.GetString("TextEditor_DefaultNewFileName");
NotificationCenter.Instance.SetNotificationDelegate(this);
// Setup theme
ThemeSettingsService.AppBackground = RootGrid;
ThemeSettingsService.SetRequestedTheme();
... | [
"None"
] | [] | 0x7c13/Notepads | 69e7756aa34ca581aa5b7bd8c3938360011e5b22 | 24450cf2c3cc26915cb3371dde45c23f3fff0b44b53b672fde8839d4c71b87b2 | C# |
2f659fbc054219d05fdfc641a764a21399cfbdb9f64f31ec0ebc59e1777f3ef0 | public static async Task<bool> WriteToFile(string text, Encoding encoding, StorageFile file)
{
bool usedDeferUpdates = true;
try
{
// Prevent updates to the remote version of the file until we
// finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpda... | public static async Task WriteToFile(string text, Encoding encoding, StorageFile file)
{
bool usedDeferUpdates = true;
try
{
// Prevent updates to the remote version of the file until we
// finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(fi... | [
"Delete"
] | [] | 0x7c13/Notepads | c191cf6cf522bdd00e5fc0436df4fef4baf419b0 | b054b7d392abfdbef2216de189c9f72b8d01398ab42b67513ae6c37addd9a2c5 | C# |
33a9806520b5899f733235ca4e28118fb32b488416cb6194f17cad8f8ab5e02c | null | private void UpdatePathIndicatorText(TextEditor textEditor)
{
if (StatusBar == null)
return;
PathIndicator.Text = textEditor.EditingFile != null ? textEditor.EditingFile.Path : _defaultNewFileName;
} | [
"None"
] | [] | 0x7c13/Notepads | 16f5a4bbd1dc39499728d5325fda44ce4f93fc8f | 6e993f805970e96ff90122467fcc62e5fa41cf16fed502105af7209109506250 | C# |
96006f6fa78044b4d00559f8b0cc87993e8d8cf58058040c99521479dcd3e53e | public async Task<bool> SaveFile(StorageFile file)
{
// Prevent updates to the remote version of the file until we
// finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(file);
// write to file
var text = GetText();
text = FixLineEnding(text, LineEnding);
... | public async Task<bool> SaveFile(StorageFile file)
{
Encoding encoding = Encoding ?? new UTF8Encoding(false);
var text = GetText();
text = FixLineEnding(text, LineEnding);
var success = await FileSystemUtility.WriteToFile(text, encoding, file);
if (success)
{
EditingFile = file;
... | [
"Delete"
] | [] | 0x7c13/Notepads | 635d68377f45f7b6a4c15bb1aede62b1abb73f32 | 6f84b9f3602d723cc5f5953ec41641aed9c7b70ed5f2ba1da3fc3e86652e6eb6 | C# |
9b2a48ceb0144ef29cda4b6a5561c2473e265d24ccf8fffc167e9383fe51098a | public async Task<bool> SaveFile(StorageFile file)
{
// Prevent updates to the remote version of the file until we
// finish making changes and call CompleteUpdatesAsync.
CachedFileManager.DeferUpdates(file);
// write to file
var text = GetText();
text = FixLineEnding(text, LineEnding);
... | public async Task<bool> SaveFile(StorageFile file)
{
Encoding encoding = Encoding ?? new UTF8Encoding(false);
var text = GetText();
text = FixLineEnding(text, LineEnding);
var success = await FileSystemUtility.WriteToFile(text, encoding, file);
if (success)
{
EditingFile = file;
... | [
"Delete"
] | [] | 0x7c13/Notepads | 70caa9cc74b6cc7e3db6a21a111bf7e2f9146dfa | 44c770aa1f9b7a230d7568ec0917a058fe0015793c68b7338511d5a74f9fb1bb | C# |
e682109444c6e055c655805daedf7b188c2c93adbf7d0dee4ff463b801c90ad8 | /// <summary>
/// Calculates when the nextswitch postpone should expire when the time module is used
/// </summary>
/// <param name = "overrideTheme">Optional: If you would like to calculate the postpone expiry for a specific active theme, pass the theme here</param>
/// <returns>The time the next switch should expire ... | /// <summary>
/// Calculates when the nextswitch postpone should expire when the time module is used
/// </summary>
/// <param name = "overrideTheme">Optional: If you would like to calculate the postpone expiry for a specific active theme, pass the theme here</param>
/// <returns>The time the next switch should expire ... | [
"None"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 1bc75b7e8cd15e4060d3210e464459110571cef0 | 5deabba6671fe3e18575eb8298b8ca7f8375e5490a6f5444ee73ab4c7d19097a | C# |
16f647655496a66e55682215d9c4d82e90c6cd5d23c14b1fba02b6b0bbff64f9 | private static void SystemEvents_RefreshPostponeTimers(object sender, PowerModeChangedEventArgs e)
{
if (e.Mode == PowerModes.Resume)
{
Logger.Debug("resynchronizing postpone timers with system clock after resume");
state.PostponeManager.SyncExpiryTimesWithSystemClock();
}
} | private static void SystemEvents_RefreshPostponeTimers(object sender, PowerModeChangedEventArgs e)
{
if (e.Mode == PowerModes.Resume)
{
try
{
Logger.Debug("resynchronizing postpone timers with system clock after resume");
state.PostponeManager.SyncExpiryTimesWithSy... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 647dd762ec20e72b1794a499db7fcd69bd670d19 | 61e87d80dc59f16870d79770cb0f583d7f73918f9d1745f2a956b5dd9969b74e | C# |
c7587f3bee4e666ff6597a32ef872eb5aa630900cfc29b70fc79ea86c12bf2ee | public static string[] GetCursorScheme(string name)
{
using RegistryKey cursorsKeyUser = Registry.CurrentUser.OpenSubKey(@"Control Panel\Cursors\Schemes");
using RegistryKey cursorsKeySystem = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes");
L... | public static string[] GetCursorScheme(string name)
{
using RegistryKey cursorsKeyUser = Registry.CurrentUser.OpenSubKey(@"Control Panel\Cursors\Schemes");
using RegistryKey cursorsKeySystem = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes");
L... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | ca26a138dae571c59955aec13e08dc2dbed571bd | 679c312bc5f72298256cb84aafaa8f5b176def7806923f08812262acb6d4bea2 | C# |
1944f87486bbf0aa89ff3c3ce7d9e2a085a78c18382d65f01970ad412ad2f012 | public void Load()
{
try
{
ThemeFileContent = File.ReadAllLines(ThemeFilePath, Encoding.GetEncoding(1252)).ToList();
}
catch (Exception ex)
{
Logger.Error(ex, $"could not read theme file at {ThemeFilePath}, using default values: ");
}
Parse();
} | public void Load()
{
(Encoding, ThemeFileContent) = Read(ThemeFilePath);
Parse();
} | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | e818407bbbaecd375246cf5d437bc7019e9e5ca7 | a8815d0a4e3b953ed0a00a3af90421b8a89dc7d700715c5894aa7bd2b3430194 | C# |
0628486861b40fb1c80c75a45eded3287fb573bed77dab259a12e3d917b8cc34 | public void Switch(Theme newTheme, SwitchEventArgs e)
{
Logger.Debug($"switch invoked for {GetType().Name}");
ForceSwitch = false;
if (Enabled)
{
if (!Initialized)
{
try
{
EnableHook();
}
catch (Exception ex)
... | public void Switch(Theme newTheme, SwitchEventArgs e)
{
Logger.Debug($"switch invoked for {GetType().Name}");
ForceSwitch = false;
if (Enabled)
{
if (!Initialized)
{
RunEnableHook();
}
try
{
HandleSwitch(newTheme, e);
... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 886c7e5d4c73acad1eaf6b6eacc2b16ca0ea4c3d | 44f2dc37c1d2e3098d2ce32be051aa008cf1c5c9978e35c6708d9aa99221c64d | C# |
addd0726eff6ff28863ed1e23ed8522da5b7ee5429e7b4bd0e21eebf819b6dc7 | null | private void ToggleSwitchColorizationEnabled_Toggled(object sender, RoutedEventArgs e)
{
if (init)
return;
builder.Config.ColorizationSwitch.Enabled = ToggleSwitchColorizationEnabled.IsOn;
try
{
builder.Save();
}
catch (Exception ex)
{
ErrorMessageBoxes.Sho... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | b99bab1c13ea9518fffcc51786c5565b4e559dac | 9e71971207ae0da7bd3652bc49fff90cf35ecb3fd991e8f6ea31f502473419bf | C# |
c9540797203f769be354c6658ab6c0c245b5f55946bee9f6d5ecab47d07968ef | // set starttime based on user location
public async void ActivateLocationMode()
{
//ui
StackPanelTimePicker.Visibility = Visibility.Collapsed;
TextBlockDark.Visibility = Visibility.Collapsed;
TextBlockLight.Visibility = Visibility.Collapsed;
StackPanelLocationTime.Visibility = Visibility.Vis... | /// <summary>
/// Location based times & Windows Position Service
/// </summary>
// set starttime based on user location
public async Task ActivateLocationMode()
{
//ui
locationBlock.Text = AdmProperties.Resources.msgSearchLoc; //Searching your location...
userFeedback.Text = AdmProperties.Resources.m... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 705c0904ec00996da351e384f65c11a30f3b638d | 3af6bf6f22dcbaa33b3cd239a4cc21d222925e649900833f8f7550e83eede673 | C# |
45e542ce5f1d35424e4b63ebf3dfabd71e79a7d72f5fd5d76beb0a62170c8acc | private async void ApplyTheme()
{
//show warning for notebook on battery with enabled battery saver
if (PowerManager.EnergySaverStatus == EnergySaverStatus.On)
{
userFeedback.Text = Properties.Resources.msgChangesSaved + "\n\n" + Properties.Resources.msgBatterySaver;
applyButton.IsEnab... | private async void ApplyTheme()
{
//show warning for notebook on battery with enabled battery saver
if (!builder.Config.Tunable.DisableEnergySaverOnThemeSwitch && PowerManager.EnergySaverStatus == EnergySaverStatus.On)
{
userFeedback.Text = AdmProperties.Resources.msgChangesSaved + "\n\n" + Adm... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 705c0904ec00996da351e384f65c11a30f3b638d | c3f112c91391bc46752d713ee4d72df7877f1e12c88719d59b7e37bdf3a4170d | C# |
734929044361088be55c7db0bb5db91d81bf68f2b90e772defe0af551bd4930f | public static void DeregisterResumeEvent()
{
try
{
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
}
catch (InvalidOperationException ex)
{
Logger.Error(ex, "while deregistering SystemEvents_PowerModeChanged ");
}
} | null | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 705c0904ec00996da351e384f65c11a30f3b638d | fa3799fac4fe306b7f74774bfeb4189f9128ce9133029969b4b2cdc29d7ecc76 | C# |
9fde728c9d3b91503346f5bd32f04420bf1a097b2b0c78cbcf464072faaf4705 | [PermissionSet(SecurityAction.LinkDemand)]
public static void Apply(string themeFilePath)
{
Thread thread = new Thread(() =>
{
try
{
PowerHandler.DisableEnergySaver(AdmConfigBuilder.Instance().Config);
new ThemeManagerClass().ApplyTheme(themeFilePath);
... | null | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 705c0904ec00996da351e384f65c11a30f3b638d | 0cc109e1ea5a4f3d25094b9f39f95db321a52061be40d0e50819aefb0d569e38 | C# |
adc0cc9c560f77af18ff852c49f9e1429b5623f93bd59e77fa63e8dab236c130 | /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
//Set up Logger
var config = new NLog.Config.LoggingConfiguration();
var configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.App... | /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
List<string> argsList = args.Length > 0 ? new List<string>(args) : new List<string>();
... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 705c0904ec00996da351e384f65c11a30f3b638d | 65e1bd38800fc3f52dcac60325376eb2f4ac35895d911cb903266c0bb55ce063 | C# |
c832151f61cea2f56a8a63556cae5fb3e1dc30241e20c33dea93aa7105ac31f9 | private static void ApplyIThemeManager2(string themeFilePath, bool suppressLogging = false)
{
DateTime start = DateTime.Now;
/*Exception applyEx = null;*/
Thread thread = new(() =>
{
bool tm2Found = false;
bool tm2Success = false;
string displayNameFromFile = null;
... | private static void ApplyIThemeManager2(string themeFilePath, bool suppressLogging = false)
{
DateTime start = DateTime.Now;
bool tm2Found = false;
bool tm2Success = false;
string displayNameFromFile = null;
try
{
(_, displayNameFromFile) = ThemeFile.GetDisplayNameFromRaw(themeFi... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 5e00ec4fd98cb56b185f0e02109ea5d975a5ef93 | 6c84635bf1cf1e5775340c49992cf26ce472fd212481eb5e6aacab158d6de328 | C# |
997182248391adcf0ee47d324dc7f5d0ccd4a3a3198ea8b13d062ce1c28d3977 | [MethodImpl(MethodImplOptions.Synchronized)]
public void UpdateNightLightState()
{
bool enabled = RegistryHandler.IsNightLightEnabled();
Theme newTheme = enabled ? Theme.Dark : Theme.Light;
if (newTheme != requestedTheme)
{
lastNightLightQueryTime = DateTime.Now;
requestedTheme =... | [MethodImpl(MethodImplOptions.Synchronized)]
public void UpdateNightLightState()
{
bool enabled = false;
try
{
RegistryHandler.IsNightLightEnabled();
}
catch (Exception ex)
{
Logger.Error(ex, "error retrieving night light enabled state:");
}
Theme newTheme =... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 388a379c507c2ee3613cdabf52aabbb90a392634 | d24ec207ca9b62d98259e711a6c68cadeeed4ee134093455dd336e420f165f3f | C# |
bb78a98e8c2c4ebf8e94d101c3552bd5b611d8af5c7d5c2c6d012b0f3c592b5d | private void ButtonCopyVersionInfo_Click(object sender, RoutedEventArgs e)
{
// most likely use case is to paste in an issue, so
// we create a markddown string that will look nice
// in that context
var versionText = new StringBuilder().Append("- Commit: `").Append(versionInfo.Commit).AppendLine("... | private void ButtonCopyVersionInfo_Click(object sender, RoutedEventArgs e)
{
// most likely use case is to paste in an issue, so
// we create a markddown string that will look nice
// in that context
try
{
var versionText = new StringBuilder().Append("- Commit: `").Append(versionInfo.... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 9b1f1c24ad5fefbb181163fad2383c484d37b870 | d68e904fadb9277ec54dfc93f847f781f7e2097fa920b4113eb095f94ae3a688 | C# |
ac6dddb728ceb5f87725058dc9015d9dc151a81ceb375306eafd3f1d334abcb9 | /// <summary>
/// Start the ZeroMQ server
/// </summary>
public void Start()
{
PollTask = Task.Run(() =>
{
bool retry = true;
while (retry)
{
if (Port.Length != 0)
{
ServerSocket = new ResponseSocket();
int randomPort = Se... | /// <summary>
/// Start the ZeroMQ server
/// </summary>
public void Start()
{
if (Port.Length != 0)
{
ServerSocket = new ResponseSocket();
int randomPort = ServerSocket.BindRandomPort("tcp://127.0.0.1");
using MemoryMappedViewAccessor viewAccessor = _portshare.CreateViewAccessor()... | [
"Modify",
"Delete"
] | [
"try_body_changed",
"catch_removed",
"catch_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | e49c355134eb0f4010fd0bc5370509131f393154 | db29956180f763d2c005db5edc5c89c2189b022aa274c87cda1f80d75f280621 | C# |
be932546aff2b65f850efa6b17409217540079bba05ee76da1b3a9f0256b3c01 | /// <summary>
/// Checks if a new version is available
/// </summary>
/// <returns>ApiResponse with StatusCode.New if an update is available, <br/>
/// StatusCode.Ok if no update is available <br/>
/// StatusCode.Err if an error has occurred. <br/>
/// Message carries the current version string <br/>
/// Details carrie... | /// <summary>
/// Checks if a new version is available
/// </summary>
/// <returns>ApiResponse with StatusCode.New if an update is available, <br/>
/// StatusCode.Ok if no update is available <br/>
/// StatusCode.Err if an error has occurred. <br/>
/// Message carries the current version string <br/>
/// Details carrie... | [
"Modify"
] | [
"try_body_changed",
"catch_added",
"catch_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | 3871c7e0aa74b6b89cf6aa74e7ee1a4ac64e1784 | e9bef9a7ed63bf27e4e00faf8473bab880ea0c595b60937dfad76d6d715aa3fe | C# |
bd51dbf955f68a25cbf791b478ee81695d36f81305b428203d46477c210000c7 | private static void Relaunch(bool restoreShell, bool restoreApp, bool failed)
{
try
{
using Process svc = new();
svc.StartInfo.UseShellExecute = false;
svc.StartInfo.FileName = Path.Combine(Extensions.ExecutionPathSvc);
_ = svc.Start();
if (restoreApp)
{
... | private static void Relaunch(bool restoreShell, bool restoreApp, bool failed)
{
try
{
using Process svc = new();
svc.StartInfo.UseShellExecute = false;
svc.StartInfo.FileName = Path.Combine(Extensions.ExecutionPathSvc);
_ = svc.Start();
if (restoreApp)
{
... | [
"Modify"
] | [
"try_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | 3871c7e0aa74b6b89cf6aa74e7ee1a4ac64e1784 | 80fee57ed9c4649135e46df0c913bd6f34d917c5407e80539f2f987dac892c4d | C# |
65b5145defb6d250d1d125e672250cdce734aba5265c7f406be2a55b3268e443 | /// <summary>
/// Validates the Auto Dark Mode autostart entries for correctness
/// </summary>
/// <returns>true if the state is valid, false if the state was invalid</returns>
public static ApiResponse ValidateAutostart()
{
if (!builder.Config.AutoThemeSwitchingEnabled || !builder.Config.AutoStart.AutoValidate)... | /// <summary>
/// Validates the Auto Dark Mode autostart entries for correctness
/// </summary>
/// <returns>true if the state is valid, false if the state was invalid</returns>
public static ApiResponse ValidateAutostart()
{
if (!builder.Config.AutoThemeSwitchingEnabled || !builder.Config.AutoStart.AutoValidate)... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | da642389a86ee42a18cd51af3b9afdade2c594aa | fdf008543543f7d192b4ab468951ee98556627c931b1a42503b9b0c2c14f8fba | C# |
48fdfe798d0cc4305f506506bc25f859544245eb20a687ccb79c2d56fa13fb6f | private void ToggleAutostart_Toggled(object sender, RoutedEventArgs e)
{
} | private async void ToggleAutostart_Toggled(object sender, RoutedEventArgs e)
{
ApiResponse result = new()
{
StatusCode = StatusCode.Err,
Message = "error setting autostart entry"
};
if ((sender as ModernWpf.Controls.ToggleSwitch).IsOn)
{
try
{
r... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | c0fde07358119ef0639de3b1f8c5cd19d800510f | 2d04932fcccee539f14e98dade1191616cd591539d9259c73d4a67adb046291b | C# |
03bd0fc8ea66bbd11e76492a48dd4d691ee8599e0714daa1373ba24ad79d59a7 | null | private async Task<string> CheckForPostpone()
{
int gpuUsage;
try
{
gpuUsage = await GetGPUUsage();
}
catch (Exception ex)
{
Logger.Error(ex, "could not read GPU usage, re-enabling theme switch:");
State.PostponeSwitch = false;
Alerted = false;
... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | a1d35c5a05050e81abe3f6f3073f95baacf481b6 | 2ef1ad204e1ca98062577888a50502feeeb00bfdd830a9138851a09c69db7e03 | C# |
1944a751e5dc7815fd82538ccb52597035b6dae7d5f8cb1f05eb426e0114f465 | /// <summary>
/// Autostart
/// </summary>
private async void EnableAutoStart()
{
try
{
builder.Save();
var result = await messagingClient.SendMessageAndGetReplyAsync(Command.AddAutostart);
if (result != StatusCode.Ok)
{
throw new AddAutoStartException($"ZMQ c... | /// <summary>
/// Autostart
/// </summary>
private async void EnableAutoStart()
{
string result = "";
try
{
builder.Save();
result = await messagingClient.SendMessageAndGetReplyAsync(Command.AddAutostart);
if (result != StatusCode.Ok)
{
throw new AddAutoS... | [
"Modify"
] | [
"try_body_changed",
"catch_removed",
"catch_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | a7d664bb6002af8ed3c7e6f352f5203b20c87d1e | 842e9f450e0bdbea5791a16cd7dbdefa2eb2b9b0a1e6d37fbb37d398fac28e9d | C# |
aee988f377a2334bdb5a7942f08606fb24400c08483d6f720381337000d0b1c3 | public MainWindow()
{
DataContext = this;
WindowX = ((int)(Settings.Default.UIScale * BasewindowX)).ToString();
WindowY = ((int)((Settings.Default.UIScale) * BaseWindowY)).ToString();
ScaleStringX = Settings.Default.UIScale.ToString("N2", CultureInfo.CreateSpecificCulture("en-US"));
ScaleStrin... | public MainWindow()
{
DataContext = this;
Trace.WriteLine("--------- AppStart");
//set current UI language
LanguageHelper();
InitializeComponent();
//only run at first startup
if (Settings.Default.FirstRun)
{
//check if system uses 12 hour clock
SystemTimeForma... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 8154e962911b675e049eb8fe951ba94d0943a159 | 6584a832e20b682f121afe8133d356dd81aca69de3f6b479c5d0e53ae93a5526 | C# |
08329e5d5fb018d02c457d18a5e32f6e7f0352fec04f4fac3eb80e6156a52923 | // set starttime based on user location
public async void ActivateLocationMode()
{
//ui
StackPanelTimePicker.Visibility = Visibility.Collapsed;
TextBlockDark.Visibility = Visibility.Collapsed;
TextBlockLight.Visibility = Visibility.Collapsed;
StackPanelLocationTime.Visibility = Visibility.Vis... | /// <summary>
/// Location based times & Windows Position Service
/// </summary>
// set starttime based on user location
public async void ActivateLocationMode()
{
//ui
locationBlock.Text = Properties.Resources.msgSearchLoc; //Searching your location...
userFeedback.Text = Properties.Resources.msgSear... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 8154e962911b675e049eb8fe951ba94d0943a159 | 32837e5f51a9e329df6fe6d4e7b15d6df06947bec76ec87b327214f421c2b51b | C# |
9d8032d4433e637c245f9fbe0a684673c59361eb5075d993639d3253b858bd45 | //apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = int.Parse(OffsetDarkBox.Text);
offsetLight = int.Parse(OffsetLightBox.Text);
}
catch
{
use... | /// <summary>
/// Offset
/// for sunrise and sunset hours
/// </summary>
//apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = Convert.ToInt32(NumberboxOffsetDark.Value);
... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 8154e962911b675e049eb8fe951ba94d0943a159 | eecd43575f2720af5086d2dae6b80bb71b32c375d2ea5e7211c0402763cfa56d | C# |
fe8a23a902fd7c697afb70222774af5c8ea25e0c087927a01abe0422f89f3f83 | public static void ColorFilterSetup()
{
RegistryKey filterType = null;
try
{
filterType = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\ColorFiltering", true);
}
catch
{
Logger.Warn("color filter key does not exist");
}
//on clean installs this registr... | public static void ColorFilterSetup()
{
RegistryKey filterType = null;
try
{
filterType = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\ColorFiltering", true);
}
catch (Exception ex)
{
Logger.Error(ex, "error instantiating color filtering key:");
}
//o... | [
"Modify"
] | [
"catch_type_changed",
"catch_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | f4fe39694fbb5019f149072bb1e36550066ed886 | 0345ca9132625017a156413c7b36a95a460d5b71d8a97a36680d2214bb833ce4 | C# |
6e44eb4a52acb95c7f7e70ec3e88fdb711f0b1ac5e239d6f146750b896772dc9 | /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
//Set up Logger
var config = new NLog.Config.LoggingConfiguration();
var configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "AutoD... | /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
//Set up Logger
var config = new NLog.Config.LoggingConfiguration();
var configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "AutoD... | [
"Add",
"Modify"
] | [
"finally_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | 1866e5058e7ac62c904a944e483905c5b32b1032 | 10137702e4f2196a1475baf60ffa3622d5055ba5fc58b9613b23d622e22c9583 | C# |
93a0e80d173fba9232bdb4333a303abccae0d00fc188a7828843c47e690c5a74 | private void DisableTimeBasedSwitch()
{
if (!init)
{
//disable auto theme switching in svc
builder.Config.AutoThemeSwitchingEnabled = false;
builder.Config.Location.Enabled = false;
builder.Save();
}
StackPanelTimePicker.IsEnabled = false;
userFeedback.Tex... | private void DisableTimeBasedSwitch()
{
if (!init)
{
//disable auto theme switching in svc
builder.Config.AutoThemeSwitchingEnabled = false;
builder.Config.Location.Enabled = false;
try
{
builder.Save();
}
catch (Exception ex)
... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | d82a7b4a359ee6dc5bc1f9a67760452354a561e7 | cdb4f4842371a8d2490f29e957d1a477c8ad5fdcfe3bbdb1adc4069d9580b5b7 | C# |
15427072fcab6fe0ede055a763a25b92bd5e994da494953315ca0596a32e382f | private void RadioButtonLocationTimes_Click(object sender, RoutedEventArgs e)
{
builder.Config.Location.Enabled = true;
builder.Config.Location.UseGeolocatorService = true;
builder.Save();
TogglePanelVisibility(false, true, true, false);
ActivateLocationMode();
ApplyTheme();
} | private void RadioButtonLocationTimes_Click(object sender, RoutedEventArgs e)
{
EnableTimeBasedSwitch();
builder.Config.Location.Enabled = true;
builder.Config.Location.UseGeolocatorService = true;
try
{
builder.Save();
TogglePanelVisibility(false, true, true, false);
... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | d82a7b4a359ee6dc5bc1f9a67760452354a561e7 | e9d0901cbf86f0445eae9cbf6ffb331ddf5d5df4306895abd98a1168d2c01409 | C# |
8bf2db304256e435cc3ac7410d43a3f7a592aca49416761cd64cc8234f420d97 | /// <summary>
/// Offset
/// for sunrise and sunset hours
/// </summary>
//apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = Convert.ToInt32(NumberboxOffsetDark.Value);
... | /// <summary>
/// Offset
/// for sunrise and sunset hours
/// </summary>
//apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = Convert.ToInt32(NumberboxOffsetDark.Value);
... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 4a9224992c7d2308d1ac68b66bf5105e3440ad29 | 14d403af6b1da270f1efd0d0b3edbb91385c420bcace2e6667332a1f86bdd90e | C# |
c46ad554e4cff35b6b2a3bef3611bf0ffe0873bb09867c401a792b1b42ca31af | private async void ApplyTheme()
{
//show warning for notebook on battery with enabled battery saver
if (PowerManager.EnergySaverStatus == EnergySaverStatus.On)
{
userFeedback.Text = Properties.Resources.msgChangesSaved + "\n\n" + Properties.Resources.msgBatterySaver;
applyButton.IsEnab... | private async void ApplyTheme()
{
//show warning for notebook on battery with enabled battery saver
if (!builder.Config.Tunable.DisableEnergySaverOnThemeSwitch && PowerManager.EnergySaverStatus == EnergySaverStatus.On)
{
userFeedback.Text = Properties.Resources.msgChangesSaved + "\n\n" + Proper... | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | b1d2f40dd7666bdc01c471a374f95865f8614fd4 | ad7a00497a33dbc7b67d74cf296f5905332335b3b84ae81ebcd475eebffa7699 | C# |
918e222e2e831aec8ab78890d69ad603abef53245906f61ccc81299c6470df08 | //apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = int.Parse(OffsetDarkBox.Text);
offsetLight = int.Parse(OffsetLightBox.Text);
}
catch
{
use... | /// <summary>
/// Offset
/// for sunrise and sunset hours
/// </summary>
//apply offset
private void OffsetButton_Click(object sender, RoutedEventArgs e)
{
int offsetDark;
int offsetLight;
//get values from TextBox
try
{
offsetDark = Convert.ToInt32(NumberboxOffsetDark.Value);
... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | f5bffd05d58b3f03a1003c5df157b89463f4a813 | 4e4c3cd62eef8a2e9b2dd770de0907cc70e6ee4f22dc00db045ccb7d29ae0bcf | C# |
cac5a311117f008e39d4fe2e9836a9a6857d6802adb3bab58ce9008edefdb87b | private static void DownloadProgress(object sender, DownloadProgressChangedEventArgs e)
{
if (e.ProgressPercentage > Progress && e.ProgressPercentage % 10 == 0)
{
Progress = e.ProgressPercentage;
Logger.Info($"downloaded {e.BytesReceived / 1000000} of {e.TotalBytesToReceive / 1000000} MB. {... | private static void DownloadProgress(object sender, DownloadProgressChangedEventArgs e)
{
if (e.ProgressPercentage > Progress)
{
if (e.ProgressPercentage % 10 == 0)
{
string mbReceived = (e.BytesReceived / 1000000).ToString();
string mbTotal = (e.TotalBytesToReceiv... | [
"Add"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 3488bd62e8b6b328a28db4b00d25b4e1cd79df2b | f76713b7309b29b0f66584c1a02f79286500ba47c90c7b37dd112dbafa0850f1 | C# |
394e4771896ffba40f7183f953057ccc37ee77e25111db6cb4fd34382b62914b | /// <summary>
/// Checks if a new version is available
/// </summary>
/// <returns>version string with download url</returns>
public static string CheckNewVersion()
{
ApiResponse response = new();
try
{
string updateUrl = "https://raw.githubusercontent.com/Armin2208/Windows-Auto-Night-Mode/mast... | /// <summary>
/// Checks if a new version is available
/// </summary>
/// <returns>version string with download url</returns>
public static string CheckNewVersion()
{
ApiResponse response = new();
try
{
string updateUrl = "https://raw.githubusercontent.com/Armin2208/Windows-Auto-Night-Mode/mast... | [
"Modify"
] | [
"try_body_changed"
] | AutoDarkMode/Windows-Auto-Night-Mode | 42c28c1edbd6a123a53a02c39c085535fbdf56f7 | ba873aa14dad705354809438166cd57eedc196610a9a52ea47bd576ecfed9dd1 | C# |
53179124cedc32b821543def8a57a1a055dffcbbc09ce0ce57924aa7ffa25ed5 | /// <summary>
/// Prepares the update process by upgrading the updater
/// </summary>
/// <returns>A bool tuple where the first item holds the value whether the update has been successfully prepared. <br></br>
/// The second item is to determine whether the shell needs to be restarted <br/>
/// The third item is to det... | /// <summary>
/// Prepares the update process by upgrading the updater
/// </summary>
/// <returns>A bool tuple where the first item holds the value whether the update has been successfully prepared. <br></br>
/// The second item is to determine whether the shell needs to be restarted <br/>
/// The third item is to det... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 38a0cb99a6e5c058204294f73d34a37663815eb9 | f1120ee9597272e123464d74382b8d51570b709ed64de47c47bb29324ee7e594 | C# |
a84c082820c2338134fdddb399399c7baf8c747659259f26482efdd0122fbb43 | static void Main(string[] args)
{
var configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "AutoDarkMode");
// Targets where to log to: File and Console
var logfile = new NLog.Targets.FileTarget("logfile")
{
FileName = Path.Combine(configDir, "upda... | static void Main(string[] args)
{
var configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "AutoDarkMode");
// Targets where to log to: File and Console
var logfile = new NLog.Targets.FileTarget("logfile")
{
FileName = Path.Combine(configDir, "upda... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 9282038eabdb883389215090225649dd5d5b0a8f | 4a7e7bc9984f1ccd3e0e5eb9bf0380dcecbcef5754a3979b55de45dd72d455e0 | C# |
c1430fb5f3c413e6125af2e9f91aae0b118873edeaac2d00e434d972910a1963 | public override string ToString()
{
try
{
return Id.Substring(Id.IndexOf("#"), Id.IndexOf("&"));
}
catch
{
return Id;
}
} | public override string ToString()
{
return MonitorString;
} | [
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | d405b0e4918e75e0a55a44137606184500dd422a | 6f8242aca84561de4b01216ecea7558f606bac1a7b6943066418d2fe750091c7 | C# |
ca29bb54bac73e26bd45dacdeeb7a98a79354e9e42cc761046045499e506c6c0 | [PermissionSet(SecurityAction.LinkDemand)]
public static void Apply(string themeFilePath)
{
Thread thread = new Thread(() =>
{
try
{
PowerHandler.DisableEnergySaver(AdmConfigBuilder.Instance().Config);
new ThemeManagerClass().ApplyTheme(themeFilePath);
... | [PermissionSet(SecurityAction.LinkDemand)]
public static void Apply(string themeFilePath)
{
Thread thread = new Thread(() =>
{
try
{
//PowerHandler.DisableEnergySaver(AdmConfigBuilder.Instance().Config);
new ThemeManagerClass().ApplyTheme(themeFilePath);
... | [
"Add",
"Delete"
] | [] | AutoDarkMode/Windows-Auto-Night-Mode | 9edc6a23a9fb7176b90381b99966f5942dd5e54b | 478de2e216fe1ad50784faf4ddede6196892fec49199c416973a94d5d11195d2 | C# |