mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-06 01:22:11 +00:00
The only way to attach an Arg to a ProcessSuspendedMessage was the adapter constructor, which loops the message back and therefore requires a non-null adapter. Add a constructor that takes just the argument for cases that feed the message directly to a manager. Fix the native-id reset test, which passed a null adapter and threw before it could verify that reset clears the suspended state.
52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
namespace StockSharp.Messages;
|
|
|
|
/// <summary>
|
|
/// Process suspended action.
|
|
/// </summary>
|
|
[DataContract]
|
|
[Serializable]
|
|
public class ProcessSuspendedMessage : Message
|
|
{
|
|
/// <summary>
|
|
/// Additional argument.
|
|
/// </summary>
|
|
[DataMember]
|
|
public object Arg { get; }
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ProcessSuspendedMessage"/>.
|
|
/// </summary>
|
|
public ProcessSuspendedMessage()
|
|
: base(MessageTypes.ProcessSuspended)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ProcessSuspendedMessage"/> carrying an argument for
|
|
/// direct processing, without a loopback adapter.
|
|
/// </summary>
|
|
/// <param name="arg">Additional argument.</param>
|
|
public ProcessSuspendedMessage(object arg)
|
|
: this()
|
|
{
|
|
Arg = arg;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ProcessSuspendedMessage"/>.
|
|
/// </summary>
|
|
/// <param name="adapter">Adapter.</param>
|
|
/// <param name="arg">Additional argument.</param>
|
|
public ProcessSuspendedMessage(IMessageAdapter adapter, object arg = default)
|
|
: this()
|
|
{
|
|
this.LoopBack(adapter);
|
|
Arg = arg;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Create a copy of <see cref="ProcessSuspendedMessage"/>.
|
|
/// </summary>
|
|
/// <returns>Copy.</returns>
|
|
public override Message Clone() => new ProcessSuspendedMessage(Adapter, Arg);
|
|
} |