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

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

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

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

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

Loading…
Cancel
Save