-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRsharpDevMain.vb
More file actions
79 lines (61 loc) · 3.05 KB
/
RsharpDevMain.vb
File metadata and controls
79 lines (61 loc) · 3.05 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
71
72
73
74
75
76
77
78
79
Imports Config
Imports Microsoft.VisualBasic.My
Imports My
Imports RibbonLib.Interop
Imports WeifenLuo.WinFormsUI.Docking
Partial Public Class RsharpDevMain : Inherits Form
Implements IApplyVsTheme
Friend ReadOnly ribbon As RibbonItems
Public Sub New()
InitializeComponent()
ribbon = New RibbonItems(_ribbon)
AddHandler ribbon.ButtonNew.ExecuteEvent, Sub() Call VisualStudio.AddDocument(New RsharpDevVscode)
AddHandler ribbon.License.ExecuteEvent, Sub() Call New RsharpDevAbout().ShowDialog()
AddHandler ribbon.About.ExecuteEvent, Sub() Call showAboutSplash()
AddHandler ribbon.ButtonOpen.ExecuteEvent, Sub() Call VisualStudio.OpenFile()
AddHandler ribbon.ConfigServer.ExecuteEvent, Sub() VisualStudio.LinuxServerList.DockState = DockState.DockLeft
AddHandler ribbon.Console.ExecuteEvent, Sub() VisualStudio.AddDocument(SingletonHolder(Of RsharpDevConsole).Instance)
AddHandler ribbon.ViewProperty.ExecuteEvent, Sub() Call VisualStudio.OpenSolution()
AddHandler ribbon.Config.ExecuteEvent, Sub() Call New ConfigApp().ShowDialog()
AddHandler ribbon.StartPage.ExecuteEvent, Sub() Call VisualStudio.AddDocument(SingletonHolder(Of StartPage).Instance)
AddHandler ribbon.Close.ExecuteEvent, Sub() Call Me.Close()
ribbon.SoluationTabGroup.ContextAvailable = ContextAvailability.NotAvailable
ribbon.SoluationTabGroup.Label = "Solution [RsharpDev]"
ribbon.SolutionTab.Label = "Solution [RsharpDev]"
MyApplication.Register(Me)
End Sub
Private Sub showAboutSplash()
Call New SplashScreen() With {.AutoClose = True}.ShowDialog()
End Sub
Private Async Sub RsharpDevMain_Load(sender As Object, e As EventArgs) Handles Me.Load
AutoScaleMode = AutoScaleMode.Dpi
Call Program.Initialize()
Call InitializeVsUI()
Call VisualStudio.InitializeUI()
Call VisualStudio.vsWindow.Add(Me)
Call VisualStudio.AddDocument(SingletonHolder(Of StartPage).Instance)
Await MyApplication.LaunchLanguageServer
End Sub
Public Sub ShowStatusMsg(message As String, Optional icon As Image = Nothing)
If icon Is Nothing Then
icon = My.Resources.preferences_system_notifications
End If
Call Me.Invoke(
Sub()
ToolStripStatusLabel1.Image = icon
ToolStripStatusLabel1.Text = message
End Sub)
End Sub
ReadOnly _toolStripProfessionalRenderer As New ToolStripProfessionalRenderer()
Private Sub InitializeVsUI()
VisualStudioToolStripExtender1.DefaultRenderer = _toolStripProfessionalRenderer
DockPanel1.Theme = VS2015LightTheme1
DockPanel1.ShowDocumentIcon = True
EnableVSRenderer()
End Sub
Private Sub EnableVSRenderer() Implements IApplyVsTheme.ApplyVsTheme
' vsToolStripExtender1.SetStyle(mainMenu, version, theme)
' vsToolStripExtender1.SetStyle(toolBar, version, theme)
VisualStudioToolStripExtender1.ApplyVsTheme(StatusStrip1)
End Sub
End Class