-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
38 lines (30 loc) · 1.02 KB
/
Copy pathPlugin.cs
File metadata and controls
38 lines (30 loc) · 1.02 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
using System;
using System.IO;
using System.Reflection;
using System.Resources;
using CnSharp.VisualStudio.Extensions.Commands;
namespace CnSharp.VisualStudio.Extensions
{
public class Plugin
{
public Guid Id { get; set; }
public string Name { get; set; }
private Assembly _assembly;
public Assembly Assembly
{
get => _assembly;
set
{
_assembly = value;
Location = _assembly == null ? null : Path.GetDirectoryName(new UriBuilder(_assembly.CodeBase).Path);
}
}
public string Location { get; set; }
public CommandConfig CommandConfig { get; set; }
public CommandManager CommandManager { get; set; }
public ResourceManager ResourceManager =>
CommandConfig != null && !string.IsNullOrWhiteSpace(CommandConfig.ResourceManager) && Assembly != null ?
new ResourceManager(CommandConfig.ResourceManager, Assembly) :
null;
}
}