Browse Source

removed namespace declartions and imports from code

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1034 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 20 years ago
parent
commit
85355ee6dd
  1. 30
      data/templates/file/VBNet/VBNet.Patterns.Singleton.xft
  2. 103
      data/templates/project/VBNet/SharpDevelopAddin.xpt
  3. 76
      data/templates/project/VBNet/SharpDevelopMacro.xpt

30
data/templates/file/VBNet/VBNet.Patterns.Singleton.xft

@ -22,24 +22,18 @@ @@ -22,24 +22,18 @@
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Namespace ${StandardNamespace}
''' <summary>
'' Description of ${ClassName}.
''' </summary>
Public NotInheritable Class ${ClassName}
Private Shared _instance As ${ClassName} = New ${ClassName}()
Public Shared ReadOnly Property Instance As ${ClassName}
Get
Return _instance
End Get
End Property
End Class
End Namespace
''' <summary>
'' Description of ${ClassName}.
''' </summary>
Public NotInheritable Class ${ClassName}
Private Shared _instance As ${ClassName} = New ${ClassName}()
Public Shared ReadOnly Property Instance As ${ClassName}
Get
Return _instance
End Get
End Property
End Class
]]></File>
</Files>

103
data/templates/project/VBNet/SharpDevelopAddin.xpt

@ -30,6 +30,9 @@ @@ -30,6 +30,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Windows.Forms" />
</ProjectItems>
<Files>
<File name="${ProjectName}.addin" copyToOutputDirectory="Always"><![CDATA[<AddIn name = "${ProjectName}"
@ -85,69 +88,63 @@ Imports System @@ -85,69 +88,63 @@ Imports System
Imports System.Windows.Forms
Imports ICSharpCode.SharpDevelop.Gui.XmlForms
Namespace ${ProjectName}
Public Class MyUserControl
Inherits BaseSharpDevelopUserControl
Public Sub New
SetupFromXmlStream(Me.GetType().Assembly.GetManifestResourceStream("test4.Resources.MyUserControl.xfrm"))
AddHandler (Me.Get(Of Button)("test")).Click, AddressOf ButtonClick
End Sub
Sub ButtonClick(sender As Object, e As EventArgs)
System.Windows.Forms.MessageBox.Show("The button was clicked!")
End Sub
End Class
End Namespace
Public Class MyUserControl
Inherits BaseSharpDevelopUserControl
Public Sub New
SetupFromXmlStream(Me.GetType().Assembly.GetManifestResourceStream("${ProjectName}.Resources.MyUserControl.xfrm"))
AddHandler (Me.Get(Of Button)("test")).Click, AddressOf ButtonClick
End Sub
Sub ButtonClick(sender As Object, e As EventArgs)
System.Windows.Forms.MessageBox.Show("The button was clicked!")
End Sub
End Class
]]>
</File>
<File name="Src/TestPad.vb">
<![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Windows.Forms
Imports ICSharpCode.Core
Imports ICSharpCode.SharpDevelop.Gui
Namespace ${ProjectName}
''' <summary>
''' Description of the pad content
''' </summary>
Public Class TestPad
Inherits AbstractPadContent
Private ctl As MyUserControl
''' <summary>
''' Description of the pad content
''' Creates a new TestPad object
''' </summary>
Public Class TestPad
Inherits AbstractPadContent
Private ctl As MyUserControl
''' <summary>
''' Creates a new TestPad object
''' </summary>
Public Sub New
ctl = new MyUserControl()
End Sub
''' <summary>
''' The <see cref="System.Windows.Forms.Control"/> representing the pad
''' </summary>
Public Overrides ReadOnly Property Control As Control
Get
return ctl
End Get
End Property
''' <summary>
''' Refreshes the pad
''' </summary>
Public Overrides Sub RedrawContent()
' TODO: Refresh the whole pad control here, renew all resource strings whatever
' Note that you do not need to recreate the control.
End Sub
''' <summary>
''' Cleans up all used resources
''' </summary>
Public Overrides Sub Dispose()
ctl.Dispose()
End Sub
End Class
End Namespace
Public Sub New
ctl = new MyUserControl()
End Sub
''' <summary>
''' The <see cref="System.Windows.Forms.Control"/> representing the pad
''' </summary>
Public Overrides ReadOnly Property Control As Control
Get
return ctl
End Get
End Property
''' <summary>
''' Refreshes the pad
''' </summary>
Public Overrides Sub RedrawContent()
' TODO: Refresh the whole pad control here, renew all resource strings whatever
' Note that you do not need to recreate the control.
End Sub
''' <summary>
''' Cleans up all used resources
''' </summary>
Public Overrides Sub Dispose()
ctl.Dispose()
End Sub
End Class
]]></File>
<File name="Configuration/AssemblyInfo.vb">
<![CDATA[Imports System.Reflection

76
data/templates/project/VBNet/SharpDevelopMacro.xpt

@ -31,6 +31,10 @@ @@ -31,6 +31,10 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Import Include="System" />
<Import Include="System.Text" />
<Import Include="System.Collections" />
<Import Include="System.Windows.Forms" />
</ProjectItems>
<Files>
@ -53,50 +57,46 @@ @@ -53,50 +57,46 @@
<File name="Src/Command.vb">
<![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Text
Imports ICSharpCode.Core
Imports ICSharpCode.SharpDevelop
Imports ICSharpCode.SharpDevelop.Gui
Imports ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
Imports ICSharpCode.TextEditor
Namespace ${StandardNamespace}
Public Class ToolCommand1
Inherits AbstractMenuCommand
Public Overrides Sub Run()
'' Here an example that shows how to access the current text document:
Dim tecp As ITextEditorControlProvider = CType(WorkbenchSingleton.Workbench.ActiveContent, ITextEditorControlProvider)
If tecp Is Nothing Then
' active content is not a text editor control
Return
End If
' Get the active text area from the control:
Dim textArea As TextArea = tecp.TextEditorControl.ActiveTextAreaControl.TextArea
If Not textArea.SelectionManager.HasSomethingSelected Then
Return
End If
' get the selected text:
Dim text As String = textArea.SelectionManager.SelectedText
' reverse the text:
Dim b As StringBuilder = new StringBuilder(text.Length)
For i As Integer = text.Length - 1 To 0
b.Append(text(i))
Next
Dim newText As String = b.ToString()
' ensure caret is at start of selection
textArea.Caret.Position = textArea.SelectionManager.SelectionCollection(0).StartPosition
' deselect text
textArea.SelectionManager.ClearSelection()
' replace the selected text with the new text:
' Replace() takes the arguments: start offset to replace, length of the text to remove, new text
textArea.Document.Replace(textArea.Caret.Offset, text.Length, newText)
' Redraw:
textArea.Refresh()
End Sub
End Class
End Namespace
Public Class ToolCommand1
Inherits AbstractMenuCommand
Public Overrides Sub Run()
'' Here an example that shows how to access the current text document:
Dim tecp As ITextEditorControlProvider = CType(WorkbenchSingleton.Workbench.ActiveContent, ITextEditorControlProvider)
If tecp Is Nothing Then
' active content is not a text editor control
Return
End If
' Get the active text area from the control:
Dim textArea As TextArea = tecp.TextEditorControl.ActiveTextAreaControl.TextArea
If Not textArea.SelectionManager.HasSomethingSelected Then
Return
End If
' get the selected text:
Dim text As String = textArea.SelectionManager.SelectedText
' reverse the text:
Dim b As StringBuilder = new StringBuilder(text.Length)
For i As Integer = text.Length - 1 To 0
b.Append(text(i))
Next
Dim newText As String = b.ToString()
' ensure caret is at start of selection
textArea.Caret.Position = textArea.SelectionManager.SelectionCollection(0).StartPosition
' deselect text
textArea.SelectionManager.ClearSelection()
' replace the selected text with the new text:
' Replace() takes the arguments: start offset to replace, length of the text to remove, new text
textArea.Document.Replace(textArea.Caret.Offset, text.Length, newText)
' Redraw:
textArea.Refresh()
End Sub
End Class
]]></File>
<File name="Configuration/AssemblyInfo.vb">
<![CDATA[${StandardHeader.VBNET}

Loading…
Cancel
Save