forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginMetadata.cs
More file actions
55 lines (48 loc) · 1.68 KB
/
PluginMetadata.cs
File metadata and controls
55 lines (48 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace SiteServer.Plugin
{
[JsonObject(MemberSerialization.OptOut)]
[Serializable]
public class PluginMetadata
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string Version { get; set; }
public string Publisher { get; set; }
public string Icon { get; set; }
public List<string> Categories { get; set; }
public string Homepage { get; set; }
public string ExecuteFileName { get; set; }
public List<string> Includes { get; set; }
public bool Disabled { get; set; }
private string _directoryPath;
[JsonIgnore]
public string DirectoryPath
{
get { return _directoryPath; }
internal set
{
_directoryPath = value;
Id = (Publisher + "-" + Name).Replace(".", string.Empty).Replace(" ", string.Empty);
DirectoryName = Path.GetFileName(Path.GetDirectoryName(value));
ExecuteFilePath = Path.Combine(value, ExecuteFileName.Replace("/", Path.DirectorySeparatorChar.ToString()));
}
}
[JsonIgnore]
public string Id { get; private set; }
[JsonIgnore]
public string DirectoryName { get; private set; }
[JsonIgnore]
public string ExecuteFilePath { get; private set; }
[JsonIgnore]
public long InitTime { get; internal set; }
public PluginMetadata Copy()
{
return (PluginMetadata)MemberwiseClone();
}
}
}