csharp-sdk-upm/Engine/Attributes/LCEngineClassHookAttribute.cs

31 lines
730 B
C#
Raw Normal View History

2021-03-18 13:52:23 +08:00
using System;
namespace LeanCloud.Engine {
public enum LCEngineObjectHookType {
BeforeSave,
AfterSave,
BeforeUpdate,
AfterUpdate,
BeforeDelete,
AfterDelete
}
2021-03-19 11:18:46 +08:00
public class LCEngineClassHookAttribute : Attribute {
2021-03-18 13:52:23 +08:00
public string ClassName {
get;
}
public LCEngineObjectHookType HookType {
get;
}
2021-03-19 11:18:46 +08:00
public LCEngineClassHookAttribute(string className, LCEngineObjectHookType hookType) {
2021-03-25 10:46:03 +08:00
if (string.IsNullOrEmpty(className)) {
throw new ArgumentNullException(nameof(className));
}
2021-03-18 13:52:23 +08:00
ClassName = className;
HookType = hookType;
}
}
}