Initial commit
This commit is contained in:
20
srcs/RobotNet10/Commons/RobotNet10.Script/TaskAttribute.cs
Normal file
20
srcs/RobotNet10/Commons/RobotNet10.Script/TaskAttribute.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace RobotNet10.Script;
|
||||
|
||||
/// <summary>
|
||||
/// Thuộc tính để đánh dấu một phương thức là một tác vụ định kỳ trong hệ thống RobotNet.
|
||||
/// </summary>
|
||||
/// <param name="interval"></param>
|
||||
/// <param name="autoStart"></param>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
||||
public class TaskAttribute(int interval, bool autoStart = true) : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Thời gian định kỳ để thực hiện tác vụ, tính bằng giây.
|
||||
/// </summary>
|
||||
public int Interval { get; } = interval;
|
||||
|
||||
/// <summary>
|
||||
/// Cho phép tác vụ này tự động bắt đầu khi hệ thống khởi động hay không.
|
||||
/// </summary>
|
||||
public bool AutoStart { get; } = autoStart;
|
||||
}
|
||||
Reference in New Issue
Block a user