mohamedradwan.com - Nothing can beat experience
Post
Cancel

Create a shortcut in Visual Studio to add interface video

When I try to find a shortcut to add interface to my project, I didn't find, this was very weird to me because I thought sure I can't find it but it's there, but when I deeply search I find there is not, so I decide to post an article on how to do it? See the video

The code for the Add interface Module as the following:

1
2
3
4
5
6
7
8
9
10
Public Module AddInterfaceModule
    Sub AddInterface()
        Dim interfaceName As String = Microsoft.VisualBasic.Interaction.InputBox("Name", "Add Interface")
        If Not interfaceName.ToLower().EndsWith(".cs") Then
            interfaceName &= ".cs"
        End If
        DTE.ItemOperations.AddNewItem("Visual C#CodeInterface", interfaceName)
    End Sub
End Module
Trending Tags