namespace StockSharp.Messages;
///
/// Data types search result message.
///
[DataContract]
[Serializable]
public class DataTypeInfoMessage : BaseSubscriptionIdMessage
{
///
/// Initializes a new instance of the .
///
public DataTypeInfoMessage()
: base(MessageTypes.DataTypeInfo)
{
}
///
[DataMember]
public SecurityId SecurityId { get; set; }
///
/// Possible data type.
///
[DataMember]
public DataType FileDataType { get; set; }
private DateTime[] _dates = [];
///
/// Dates.
///
[DataMember]
public DateTime[] Dates
{
get => _dates;
set => _dates = value ?? throw new ArgumentNullException(nameof(value));
}
///
/// Storage format.
///
[DataMember]
public int Format { get; set; }
///
public override DataType DataType => DataType.DataTypeInfo;
///
public override void CopyTo(DataTypeInfoMessage destination)
{
base.CopyTo(destination);
destination.SecurityId = SecurityId;
destination.FileDataType = FileDataType?.TypedClone();
destination.Dates = Dates?.ToArray();
destination.Format = Format;
}
///
public override string ToString()
=> base.ToString() + $",SecId={SecurityId},DT={FileDataType},DatesLen={Dates.Length},Fmt={Format}";
}