---
description: >-
  This feature provides configurable properties to enable or disable various
  information collections and control refresh behavior for system information
  retrieval.
---

# Configuration Options

## Overview

The Configuration Options feature of the SiticoneSystemInfo control exposes public properties that allow you to customize which types of system information are collected and how often the data is refreshed. Developers can enable or disable hardware, operating system, network, and display data collection, as well as set the auto-refresh behavior and refresh interval. These options help tailor the control's behavior to meet application performance and data requirements.

***

### Key Points

<table><thead><tr><th width="190">Aspect</th><th>Details</th></tr></thead><tbody><tr><td>Exposed Properties</td><td>EnableHardwareInfo, EnableOperatingSystemInfo, EnableNetworkInfo, EnableDisplayInfo, AutoRefresh, RefreshInterval</td></tr><tr><td>Customization</td><td>Allows enabling/disabling of data collection for different system components (hardware, OS, network, display)</td></tr><tr><td>Refresh Behavior</td><td>AutoRefresh and RefreshInterval properties control whether data is refreshed automatically and at what frequency</td></tr><tr><td>Flexibility</td><td>Enables developers to optimize performance by selectively collecting only the necessary system information</td></tr></tbody></table>

***

### Best Practices

<table><thead><tr><th width="289">Practice</th><th>Description</th></tr></thead><tbody><tr><td>Set appropriate refresh intervals</td><td>Choose a refresh interval that balances data freshness with system performance (e.g., no less than 1000 ms).</td></tr><tr><td>Enable only required data</td><td>Disable unnecessary data collection (e.g., hardware or network information) to reduce overhead if not needed by your application.</td></tr><tr><td>Use asynchronous refresh</td><td>Always use asynchronous methods (e.g., RefreshAsync) so that UI responsiveness is maintained while data is being updated.</td></tr><tr><td>Dynamically adjust settings</td><td>Consider providing a settings UI for end-users to adjust configuration options at runtime, based on their performance needs.</td></tr></tbody></table>

***

### Common Pitfalls

<table><thead><tr><th width="239">Pitfall</th><th>Description</th><th>Recommendation</th></tr></thead><tbody><tr><td>Over-collecting data</td><td>Enabling all data collection options may impact performance if some data is not required.</td><td>Only enable the data collections you actually need by setting unnecessary options to false.</td></tr><tr><td>Setting too short refresh intervals</td><td>Extremely low refresh intervals can overwhelm system resources and lead to performance degradation.</td><td>Ensure the RefreshInterval is set to a reasonable value (e.g., 1000 ms or higher).</td></tr><tr><td>Neglecting asynchronous calls</td><td>Synchronous refresh calls can block the UI, especially when multiple data sources are refreshed simultaneously.</td><td>Always use the asynchronous RefreshAsync() method for updating configuration data.</td></tr><tr><td>Ignoring configuration dependencies</td><td>Changing one configuration property may affect others (e.g., disabling hardware info can result in missing details in composite reports).</td><td>Understand the interdependencies among configuration options and test the application after any configuration changes.</td></tr></tbody></table>

***

### Usage Scenarios

<table><thead><tr><th width="276">Scenario</th><th>Description</th></tr></thead><tbody><tr><td>Performance Optimization</td><td>Customize data collection by disabling unnecessary information (e.g., turning off network or display info) to optimize performance.</td></tr><tr><td>User-Defined Refresh Behavior</td><td>Allow users to adjust auto-refresh settings to balance between real-time updates and resource usage in a monitoring dashboard.</td></tr><tr><td>Tailored System Monitoring</td><td>Enable specific configuration options based on the application's focus, such as only collecting operating system data for compliance auditing.</td></tr></tbody></table>

***

### Real Life Usage Scenarios

<table><thead><tr><th width="318">Scenario</th><th>Description</th></tr></thead><tbody><tr><td>Custom Monitoring Tools</td><td>IT administrators can configure the control to collect only critical information (e.g., OS and hardware details) to improve performance in monitoring tools.</td></tr><tr><td>Adaptive Dashboards</td><td>A dashboard application may allow users to dynamically change configuration options to show more detailed network data during troubleshooting periods and less during normal operation.</td></tr><tr><td>Resource-Constrained Environments</td><td>In scenarios where system resources are limited, disabling non-essential data collection can ensure that the application remains responsive.</td></tr></tbody></table>

***

### Troubleshooting Tips

| Tip                                    | Description                                                                             | Recommendation                                                                                                                                    |
| -------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Verify configuration settings          | Incorrect configuration may result in missing or incomplete system information.         | Double-check that properties such as EnableHardwareInfo, EnableOperatingSystemInfo, EnableNetworkInfo, and EnableDisplayInfo are set as required. |
| Monitor refresh intervals              | Overly aggressive refresh intervals can lead to performance issues or missed updates.   | Ensure that the RefreshInterval is set to a sensible value (no less than 1000 ms) and adjust based on system performance.                         |
| Handle asynchronous calls properly     | Failing to use asynchronous methods may block the UI and lead to unresponsive behavior. | Always use asynchronous refresh methods to update configuration data and update the UI on the main thread.                                        |
| Test configuration changes dynamically | Changes in configuration may have unexpected effects on collected data.                 | Implement logging or notifications to track changes and verify that the expected data is being retrieved after configuration updates.             |

***

### Code Examples & Integration Demos

#### Example 1: Enabling/Disabling Specific Data Collections

**Description:** Configure the control to only collect operating system and network information, disabling hardware and display info.

```csharp
// Configure the control's data collection options
systemInfoControl.EnableHardwareInfo = false;
systemInfoControl.EnableOperatingSystemInfo = true;
systemInfoControl.EnableNetworkInfo = true;
systemInfoControl.EnableDisplayInfo = false;

// Refresh data asynchronously after configuration changes
await systemInfoControl.RefreshAsync();
```

#### Example 2: Adjusting AutoRefresh Settings

**Description:** Enable auto-refresh and set a custom refresh interval to update system information every 5 seconds.

```csharp
// Enable auto-refresh
systemInfoControl.AutoRefresh = true;

// Set refresh interval to 5000 milliseconds (5 seconds)
systemInfoControl.RefreshInterval = 5000;
```

#### Example 3: Dynamic Configuration via UI

**Description:** Allow users to modify configuration settings from a settings panel and refresh the data accordingly.

```csharp
// Assume checkBoxHardware and checkBoxNetwork are UI checkboxes for enabling/disabling data collection

private async void btnApplySettings_Click(object sender, EventArgs e)
{
    systemInfoControl.EnableHardwareInfo = checkBoxHardware.Checked;
    systemInfoControl.EnableNetworkInfo = checkBoxNetwork.Checked;
    // You can similarly set other configuration properties

    // Refresh the control to apply new settings
    await systemInfoControl.RefreshAsync();

    MessageBox.Show("Configuration updated successfully.", "Settings", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
```

***

### Review

<table><thead><tr><th width="216">Aspect</th><th>Review Comments</th></tr></thead><tbody><tr><td>Integration Simplicity</td><td>Provides a clear and flexible set of configuration options that are easy to bind and update via code or user interfaces.</td></tr><tr><td>Robustness</td><td>With proper error handling and reasonable refresh intervals, the configuration settings offer a robust method to control data collection without impacting performance.</td></tr><tr><td>UI Flexibility</td><td>The configuration options are straightforward to integrate into various UI elements, allowing for dynamic user control over data collection settings.</td></tr><tr><td>Documentation Clarity</td><td>The detailed best practices, common pitfalls, and code examples make it easy for developers to implement and fine-tune the configuration options in their applications.</td></tr></tbody></table>

***

### Summary

By utilizing the Configuration Options feature, you can tailor the behavior of the SiticoneSystemInfo control to suit your application's needs. Adjust settings such as data collection modes and refresh intervals to optimize performance and ensure that only the necessary system information is gathered. The provided code examples illustrate how to enable or disable specific data collections and adjust auto-refresh settings, helping you achieve a responsive and efficient implementation. Happy coding!
