public unsafe void RemoveItem(string path) { if (!TryRemoveItem(path)) { ABSLog.ThrowError($"ABSoftware Core: Failed to remove item at path: '{path}'"); } }
public static unsafe void RemoveItem(string path) { if (!TryRemoveItem(path)) { ABSLog.ThrowError("T"); } }
public unsafe void AddItem(string path, IRegItem item) { if (TryAddItem(path, item) != AddItemResult.Success) { ABSLog.ThrowError($"ABSoftware Core: Failed to add item at path: '{path}'"); } }
public static unsafe void AddItem(string path, IRegItem item) { if (TryAddItem(path, item) != AddItemResult.Success) { ABSLog.ThrowError("T"); } }
public BaseViewModel() { var allProperties = typeof(T).GetProperties(); PropertyChanged += (s, e) => UpdateRegistry(e.PropertyName); for (int i = 0; i < allProperties.Length; i++) { var attribute = allProperties[i].GetCustomAttribute <RegistrySyncAttribute>(); if (attribute != null) { var regItem = ABSRegistry.GetItem(attribute.RegistryPath); if (regItem is RegGroup) { ABSLog.ThrowError("Cannot registry sync to a group."); } var syncInfo = new RegistrySyncInfo(allProperties[i], regItem, attribute.BooleanGroupPos); _registrySyncProperties.Add(allProperties[i].Name, syncInfo); AddEventHandlerToItem(syncInfo, regItem); UpdateProperty(syncInfo); } } }
public unsafe IRegItem GetItem(string path) { if (!TryGetItem(path, out IRegItem item)) { ABSLog.ThrowError($"ABSoftware Core: Failed to get the item at path: '{path}'"); } return(item); }
public static unsafe RegGroup CreateGroup(string path) { if (TryCreateGroup(path, out RegGroup newGroup) != AddItemResult.Success) { ABSLog.ThrowError("T"); } return(newGroup); }
public static unsafe IRegItem GetItem(string path) { if (!TryGetItem(path, out IRegItem item)) { ABSLog.ThrowError("T"); } return(item); }
public static ComponentCategory GetCategory(string categoryName) { if (Components.TryGetValue(categoryName, out ComponentCategory res)) { return(res); } ABSLog.ThrowError("An attempt was made to access a non-existant component category. Always use 'CategoryExists' or 'TryGetCategory' if the category is not guaranteed to exist."); return(null); }
internal static void StartMessageLoop() { if (MessageLoopRunning) { ABSLog.ThrowError("An attempt to made to start a message loop while one was already running!"); } MessageLoopRunning = true; Task.Run(async() => { while (true) { // Run immediate processes. while (ImmediateProcesses.TryPeek(out Process immediateProcess)) { immediateProcess.ProcessIsRunning = true; await immediateProcess.ExecuteAsync(); ImmediateProcesses.TryDequeue(out _); } // Run background processes. if (BackgroundProcesses.TryPeek(out Process backgroundProcess)) { backgroundProcess.ProcessIsRunning = true; await backgroundProcess.ExecuteAsync(); BackgroundProcesses.TryDequeue(out _); } else { StopProcessing?.Invoke(null, null); waitForNext.Wait(); if (!MessageLoopRunning) { return; } waitForNext.Reset(); StartProcessing?.Invoke(null, null); } } }); }