This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
using DTS.Common.Converters;
using System.ComponentModel;
namespace DTS.Common.Enums.Sensors
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum SensitivityInspectionType
{
[Description("SensitivityInspection_NotSet")]
NotSet = 0,
[Description("SensitivityInspection_Required")]
Required = 1,
[Description("SensitivityInspection_Cleared")]
Cleared = 2
}
}

View File

@@ -0,0 +1,70 @@
using System;
using System.ComponentModel;
using System.Globalization;
namespace DTS.Common.Classes.DSP
{
/// <summary>
/// this converter is used for displaying StreamingFilterCollection/array in property grids
/// </summary>
public class StreamingFilterConverter : ArrayConverter
{
private StreamingFilterProfileCollection _collection = null;
private static readonly object MyLock = new object();
private StreamingFilterProfile[] _values = null;
private StreamingFilterProfileCollection GetCollection()
{
lock (MyLock)
{
if (null == _collection)
{
_collection = StreamingFilterProfileCollection.GetCollection();
}
return _collection;
}
}
public StreamingFilterProfile[] Values
{
get
{
lock (MyLock)
{
if (null == _values)
{
var collection = GetCollection();
var array = new StreamingFilterProfile[collection.Count];
collection.CopyTo(array, 0);
_values = array;
}
}
return _values;
}
}
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string)) { return true; }
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
var result = Array.Find(Values, x => x.DisplayString == (string)value);
if (result != null) { return result; }
return base.ConvertFrom(context, culture, value);
}
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
var collection = GetCollection();
return new StandardValuesCollection(collection);
}
}
}