-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
70 lines (61 loc) · 2.41 KB
/
Copy pathPlugin.cs
File metadata and controls
70 lines (61 loc) · 2.41 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pluginVerilog
{
public class Plugin : codeEditorPlugin.IPlugin
{
public static string StaticID = "Verilog";
public string Id { get { return StaticID; } }
public bool Register()
{
// register filetypes
{
FileTypes.VerilogFile fileType = new FileTypes.VerilogFile();
codeEditor.Global.FileTypes.Add(fileType.ID, fileType);
}
{
FileTypes.VerilogHeaderFile fileType = new FileTypes.VerilogHeaderFile();
codeEditor.Global.FileTypes.Add(fileType.ID, fileType);
}
{
FileTypes.SystemVerilogFile fileType = new FileTypes.SystemVerilogFile();
codeEditor.Global.FileTypes.Add(fileType.ID, fileType);
}
{
FileTypes.SystemVerilogHeaderFile fileType = new FileTypes.SystemVerilogHeaderFile();
codeEditor.Global.FileTypes.Add(fileType.ID, fileType);
}
// append navigate context menu items
System.Windows.Forms.ContextMenuStrip menu = codeEditor.Controller.NavigatePanel.GetContextMenuStrip();
menu.Items.Insert(0,Global.SetupForm.IcarusVerilogTsmi);
menu.Items.Insert(0, Global.SetupForm.VerilogDebugTsmi);
foreach (var menuItem in menu.Items)
{
if(menuItem is System.Windows.Forms.ToolStripMenuItem)
{
var tsmi = menuItem as System.Windows.Forms.ToolStripMenuItem;
if(tsmi.Text == "Add")
{
tsmi.DropDownItems.Add(Global.SetupForm.CreateVerilogFileTsmi);
}
}
}
// register project property creator
codeEditor.Data.Project.Created += projectCreated;
return true;
}
private void projectCreated(codeEditor.Data.Project project)
{
project.ProjectProperties.Add(Id, new ProjectProperty(project));
}
public bool Initialize()
{
// register project property form tab
codeEditor.Tools.ProjectPropertyForm.FormCreated += Tools.ProjectPropertyTab.ProjectPropertyFromCreated;
return true;
}
}
}