Files

86 lines
3.0 KiB
C#
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.PedestrianAndHeadReports
{
/// <summary>
/// this is a helper class for internal information in the report
/// mostly these are just filled in information by the end user before producing the report
/// </summary>
public class ReportProperty
{
/// <summary>
/// id, should be unique, this way if the report is serialized as a setup we have a handy way of identifying properties and values ...
/// in practice in the Pedestrian and Head report this is the Field enum, as all our properties are fields
/// </summary>
protected string _Id;
public string Id { get { return _Id; } }
/// <summary>
/// what to display the property as, if it's displayed
/// </summary>
private string _displayName;
public string DisplayName { get; set; }
/// <summary>
/// property value
/// </summary>
private string _value;
public string Value
{
get { return _value; }
}
/// <summary>
/// sets the value of the property
/// </summary>
/// <param name="value"></param>
public void SetValue(string value)
{
_value = value;
}
/// <summary>
/// the possible values for the property.
/// null if the value is enterred by end user, or a list of values if a drop down is used
/// </summary>
private string[] _possibleValues;
/// <summary>
/// returns all the possible values for a property.
/// null if value is enterred manually by enduser, or a list of strings if user selects from a list
/// </summary>
/// <returns></returns>
public string[] GetAvailableValues() { return _possibleValues; }
/// <summary>
/// sets the possible values for a property
/// </summary>
/// <param name="values"></param>
public void SetAvailableValues(string[] values) { _possibleValues = values; }
/// <summary>
/// constructs a report property with a given name, display, and values
/// </summary>
/// <param name="id"></param>
/// <param name="displayname"></param>
/// <param name="possibleValues"></param>
/// <param name="propertyType"></param>
public ReportProperty(string id, string displayname, string[] possibleValues, Type propertyType)
{
_Id = id;
_possibleValues = possibleValues;
_displayName = displayname;
_type = propertyType;
}
/// <summary>
/// the System.Type of the property value
/// the value must be serializable as string, but this indicates what the value actually is natively
/// </summary>
private Type _type;
}
}