添加项目文件。
This commit is contained in:
35
common/Tnb.CollectiveOAuth/Enums/EnumHelper/EnumObject.cs
Normal file
35
common/Tnb.CollectiveOAuth/Enums/EnumHelper/EnumObject.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
public struct EnumObject
|
||||
{
|
||||
public EnumObject(Enum um, string picture = null)
|
||||
{
|
||||
this.ID = (int)Convert.ChangeType(um, typeof(int));
|
||||
this.Name = um.ToString();
|
||||
this.Description = um.GetDesc();
|
||||
this.Picture = picture;
|
||||
}
|
||||
|
||||
public EnumObject(int id, string name)
|
||||
{
|
||||
this.ID = id;
|
||||
this.Name = this.Description = name;
|
||||
this.Picture = null;
|
||||
}
|
||||
|
||||
public EnumObject(int id, string name, string description, string picture)
|
||||
{
|
||||
this.ID = id;
|
||||
this.Name = name;
|
||||
this.Description = description;
|
||||
this.Picture = picture;
|
||||
}
|
||||
|
||||
public int ID;
|
||||
|
||||
public string Name;
|
||||
|
||||
public string Description;
|
||||
|
||||
public string Picture;
|
||||
}
|
||||
Reference in New Issue
Block a user