NoaInformationDownloadCallbacks
Configure events related to Information downloads.
By passing a class that inherits NoaInformationDownloadCallbacks to NoaInformation, you can customize download-related events.
Overridable Members
Methods
| Name | Description |
|---|---|
| OnBeforeConversion(downloadInfo) | Executes before converting the target data to a string for download. Both the argument and return value are IReadOnlyDictionary<InformationTabType, IReadOnlyList<InformationGroup>> which holds tab names and lists of system item groups. If you return edited values, they will be reflected in NOA Debugger's JSON conversion process. |
| OnBeforeDownload(info) | Refer to NoaDownloadCallbacks.OnBeforeDownload(info). |
| OnAfterDownload(info, status) | Refer to NoaDownloadCallbacks.OnAfterDownload(info, status). |
Properties
| Name | Description |
|---|---|
| IsAllowBaseDownload | Refer to NoaDownloadCallbacks.IsAllowBaseDownload. |
Related Types
INoaInformationDownloadCallbacks
NoaInformationDownloadCallbacks.OnBeforeConversion is defined in this interface.
If you want to consolidate multiple callback definitions in a custom class, or add callback functionality while inheriting an existing custom class, you can achieve this by using this interface instead of the NoaInformationDownloadCallbacks class.
InformationGroup
A class that represents a group of system information used in the OnBeforeConversion method of NoaInformationDownloadCallbacks.
It holds the group name and properties (key-value pairs) within the group.
| Name | Description |
|---|---|
| Name | The group name (read-only). |
| KeyValues | A read-only Dictionary that holds pairs of system item names and values. |
InformationTabType
An enumeration type that represents the Information tab type used in the OnBeforeConversion method of NoaInformationDownloadCallbacks.
| Value | Description |
|---|---|
| App | Represents the App tab. |
| Device | Represents the Device tab. |
| Custom | Represents the Custom tab. |
NoaInformationDownloadInfo
A struct that represents Information download data, used in the OnBeforeConversion method of NoaInformationDownloadCallbacks.
Holds InformationTabType as keys and a list of groups contained in each tab as values.
| Property Name | Description |
|---|---|
| InformationGroups | A read-only Dictionary that holds pairs of tab types and InformationGroup lists. |
Sample Code
#if NOA_DEBUGGER
using NoaDebugger;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
// Example of executing events before and after NOA Debugger's Information download process (using a class)
public class ExampleInformationDownloader : NoaInformationDownloadCallbacks
{
public override NoaInformationDownloadInfo OnBeforeConversion(NoaInformationDownloadInfo downloadInfo)
{
// Log the group count for the "App" tab
if (downloadInfo.InformationGroups.TryGetValue(InformationTabType.App, out var appGroups))
{
Debug.Log($"Information download. App group count: {appGroups.Count}");
foreach (var group in appGroups)
{
Debug.Log($"Group: {group.Name}");
foreach (var kvp in group.KeyValues)
{
Debug.Log($"{kvp.Key}: {kvp.Value}");
}
}
}
// Example of excluding the Custom tab from download
return new NoaInformationDownloadInfo(
downloadInfo.InformationGroups.Where(kvp => kvp.Key != InformationTabType.Custom)
);
}
// You can also use methods from INoaDownloadCallbacks
public override NoaDownloadInfo OnBeforeDownload(NoaDownloadInfo info)
{
info.FileName = $"Sample-{info.FileName}";
return info;
}
public override void OnAfterDownload(NoaDownloadInfo info, NoaDownloadStatus status)
{
Debug.Log($"Download finished with status: {status}");
}
}
// Example of implementing shared processing across multiple features (using the interface)
public class ExampleCommonDownloader : INoaDownloadCallbacks
{
// Set IsAllowBaseDownload to true to allow NOA Debugger’s download process.
public bool IsAllowBaseDownload => true;
public NoaDownloadInfo OnBeforeDownload(NoaDownloadInfo info)
{
Debug.Log($"Download file name: {info.FileName}");
return info;
}
public void OnAfterDownload(NoaDownloadInfo info, NoaDownloadStatus status)
{
Debug.Log($"Download finished with status: {status}");
}
}
public class ExampleDerivedInformationDownloader : ExampleCommonDownloader, INoaInformationDownloadCallbacks
{
public NoaInformationDownloadInfo OnBeforeConversion(NoaInformationDownloadInfo downloadInfo)
{
// Example of excluding specific properties within groups
var modifiedGroups = new Dictionary>();
foreach (var tabKvp in downloadInfo.InformationGroups)
{
var modifiedGroupsList = new List();
foreach (var group in tabKvp.Value)
{
// Filter out keys containing "Test" and create a new Dictionary
var filteredKeyValues = group.KeyValues
.Where(kvp => !kvp.Key.Contains("Test"))
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
// Create a new InformationGroup
var modifiedGroup = new InformationGroup(group.Name, filteredKeyValues);
modifiedGroupsList.Add(modifiedGroup);
}
modifiedGroups[tabKvp.Key] = modifiedGroupsList;
}
return new NoaInformationDownloadInfo(modifiedGroups);
}
}
#endif
