JD2022-TU1/main/tools/modules/JD.Inspector/Plugin/InspectorPlugin.Data.cs

66 lines
No EOL
1.5 KiB
C#

using System.Collections.ObjectModel;
namespace JD.Inspector.Plugin
{
public partial class InspectorPlugin
{
private ObservableCollection<PropertiesData> _listPropertiesData = new ObservableCollection<PropertiesData>();
public ObservableCollection<PropertiesData> ListPropertiesData
{
get
{
lock (_listPropertiesData)
{
return _listPropertiesData;
}
}
set
{
lock (_listPropertiesData)
{
_listPropertiesData = value;
}
}
}
private bool DataAreValid()
{
lock (_listPropertiesData)
{
if (_listPropertiesData.Count == 0)
{
return false;
}
foreach (PropertiesData pd in _listPropertiesData)
{
if (!pd.IsValid())
{
return false;
}
}
}
return true;
}
private bool DataInvalidate()
{
lock (_listPropertiesData)
{
_listPropertiesData.Clear();
}
return true;
}
private void DataAdd(PropertiesData pd)
{
lock (_listPropertiesData)
{
_listPropertiesData.Add(pd);
}
}
}
}