Code:
Imports MetreInjector.My
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Windows.Forms
Namespace MetreInjector
<DesignerGenerated> _
Public Class Form1
Inherits Form
' Methods
Public Sub New()
AddHandler MyBase.Load, New EventHandler(AddressOf Me.Form1_Load)
Form1.__ENCAddToList(Me)
Me.dlls = New Dictionary(Of String, String)
Me.InitializeComponent
End Sub
<DebuggerNonUserCode> _
Private Shared Sub __ENCAddToList(ByVal value As Object)
Dim list As List(Of WeakReference) = Form1.__ENCList
SyncLock list
If (Form1.__ENCLis*****unt = Form1.__ENCList.Capacity) Then
Dim index As Integer = 0
Dim num3 As Integer = (Form1.__ENCLis*****unt - 1)
Dim i As Integer = 0
Do While (i <= num3)
Dim reference As WeakReference = Form1.__ENCList.Item(i)
If reference.IsAlive Then
If (i <> index) Then
Form1.__ENCList.Item(index) = Form1.__ENCList.Item(i)
End If
index += 1
End If
i += 1
Loop
Form1.__ENCList.RemoveRange(index, (Form1.__ENCLis*****unt - index))
Form1.__ENCList.Capacity = Form1.__ENCLis*****unt
End If
Form1.__ENCList.Add(New WeakReference(RuntimeHelpers.GetObjectValue(value)))
End SyncLock
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.OpenFileDialog1.Filter = "DLL (*.dll) |*.dll"
Me.OpenFileDialog1.ShowDialog
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
If (Me.ListBox1.SelectedIndex < 0) Then
Return
End If
Me.OpenFileDialog1.Reset
Me.dlls.Remove(Conversions.ToString(Me.ListBox1.SelectedItem))
Dim num As Integer = (Me.ListBox1.SelectedItems.Count - 1)
Do While True
Dim num3 As Integer = 0
If (num < num3) Then
Return
End If
Dim num2 As Integer = (num + 2)
Me.ListBox1.Items.Remove(RuntimeHelpers.GetObjectValue(Me.ListBox1.SelectedItems.Item(num)))
num = (num + -1)
Loop
End Sub
Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
If (Me.ListBox1.Items.Count > 0) Then
If (Me.TextBox1.Text <> "") Then
If (Process.GetProcessesByName(Me.TextBox1.Text).Length = 0) Then
Interaction.MsgBox((Me.TextBox1.Text & ".exe is not running."), MsgBoxStyle.Critical, "Error")
Else
Me.Timer1.Stop
Dim id As Integer = Process.GetProcessesByName(Me.TextBox1.Text)(0).Id
Dim pair As KeyValuePair(Of String, String)
For Each pair In Me.dlls
Me.Inject(id, pair.Value)
Next
End If
Else
Interaction.MsgBox("You haven't specificed a process.", MsgBoxStyle.Critical, "Error")
End If
Else
Interaction.MsgBox("You need to select a dll file to inject.", MsgBoxStyle.Critical, "Error")
End If
End Sub
Private Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs)
Me.ListBox1.Items.Clear
Me.dlls.Clear
End Sub
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function CloseHandle(ByVal hObject As Integer) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function CreateRemoteThread(ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal lpThreadId As Integer) As Integer
End Function
<DebuggerNonUserCode> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If (disposing AndAlso (Not Me.components Is Nothing)) Then
Me.components.Dispose
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Interaction.MsgBox("---MetreInjector is BACK!--- ||Made by metre and made for MPGH!|| Much fun with hacking!", MsgBoxStyle.Information, Nothing)
If (MySettingsProperty.Settings.inject = "auto") Then
Me.RadioButton1.Checked = True
ElseIf (MySettingsProperty.Settings.inject = "manual") Then
Me.RadioButton2.Checked = True
Else
Me.RadioButton1.Checked = True
End If
If (MySettingsProperty.Settings.close = 1) Then
Me.CheckBox1.Checked = True
Else
Me.CheckBox1.Checked = False
End If
End Sub
<DllImport("kernel32", EntryPoint:="GetModuleHandleA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function GetModuleHandle(<MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpModuleName As String) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function GetProcAddress(ByVal hModule As Integer, <MarshalAs(UnmanagedType.VBByRefStr)> ByRef lpProcName As String) As Integer
End Function
<DebuggerStepThrough> _
Private Sub InitializeComponent()
Me.components = New Container
Dim manager As New ComponentResourceManager(GetType(Form1))
Me.Button1 = New Button
Me.Button2 = New Button
Me.Button3 = New Button
Me.Button4 = New Button
Me.TextBox1 = New TextBox
Me.GroupBox1 = New GroupBox
Me.RadioButton2 = New RadioButton
Me.RadioButton1 = New RadioButton
Me.CheckBox1 = New CheckBox
Me.ListBox1 = New ListBox
Me.Label1 = New Label
Me.Timer1 = New Timer(Me.components)
Me.Timer2 = New Timer(Me.components)
Me.OpenFileDialog1 = New OpenFileDialog
Me.Label2 = New Label
Me.GroupBox1.SuspendLayout
Me.SuspendLayout
Me.Button1.BackColor = Color.Black
Me.Button1.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.Button1.ForeColor = Color.White
Dim point2 As New Point(12, &H129)
Me.Button1.Location = point2
Me.Button1.Name = "Button1"
Dim size2 As New Size(&H4F, &H17)
Me.Button1.Size = size2
Me.Button1.TabIndex = 0
Me.Button1.Text = "Browse"
Me.Button1.UseVisualStyleBackColor = False
Me.Button2.BackColor = Color.Black
Me.Button2.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.Button2.ForeColor = Color.White
point2 = New Point(12, &H146)
Me.Button2.Location = point2
Me.Button2.Name = "Button2"
size2 = New Size(&H4F, &H17)
Me.Button2.Size = size2
Me.Button2.TabIndex = 1
Me.Button2.Text = "Remove"
Me.Button2.UseVisualStyleBackColor = False
Me.Button3.BackColor = Color.Black
Me.Button3.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.Button3.ForeColor = Color.White
point2 = New Point(&H95, &H17E)
Me.Button3.Location = point2
Me.Button3.Name = "Button3"
size2 = New Size(&H4F, &H17)
Me.Button3.Size = size2
Me.Button3.TabIndex = 2
Me.Button3.Text = "Inject"
Me.Button3.UseVisualStyleBackColor = False
Me.Button4.BackColor = Color.Black
Me.Button4.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.Button4.ForeColor = SystemColors.ButtonFace
point2 = New Point(12, &H164)
Me.Button4.Location = point2
Me.Button4.Name = "Button4"
size2 = New Size(&H4F, &H17)
Me.Button4.Size = size2
Me.Button4.TabIndex = 3
Me.Button4.Text = "Clear All"
Me.Button4.UseVisualStyleBackColor = False
Me.TextBox1.BorderStyle = BorderStyle.FixedSingle
Me.TextBox1.CharacterCasing = CharacterCasing.Lower
Me.TextBox1.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
point2 = New Point(&H54, &H19)
Me.TextBox1.Location = point2
Me.TextBox1.Name = "TextBox1"
size2 = New Size(&HDF, &H17)
Me.TextBox1.Size = size2
Me.TextBox1.TabIndex = 4
Me.GroupBox1.BackColor = Color.Black
Me.GroupBox1.Controls.Add(Me.RadioButton2)
Me.GroupBox1.Controls.Add(Me.RadioButton1)
Me.GroupBox1.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.GroupBox1.ForeColor = Color.White
point2 = New Point(12, &H51)
Me.GroupBox1.Location = point2
Me.GroupBox1.Name = "GroupBox1"
size2 = New Size(&H92, &H56)
Me.GroupBox1.Size = size2
Me.GroupBox1.TabIndex = 5
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Options"
Me.RadioButton2.AutoSize = True
point2 = New Point(6, &H35)
Me.RadioButton2.Location = point2
Me.RadioButton2.Name = "RadioButton2"
size2 = New Size(&H71, &H13)
Me.RadioButton2.Size = size2
Me.RadioButton2.TabIndex = 1
Me.RadioButton2.TabStop = True
Me.RadioButton2.Text = "Manual Injection"
Me.RadioButton2.UseVisualStyleBackColor = True
Me.RadioButton1.AutoSize = True
point2 = New Point(6, 30)
Me.RadioButton1.Location = point2
Me.RadioButton1.Name = "RadioButton1"
size2 = New Size(&H80, &H13)
Me.RadioButton1.Size = size2
Me.RadioButton1.TabIndex = 0
Me.RadioButton1.TabStop = True
Me.RadioButton1.Text = "Automatic Injection"
Me.RadioButton1.UseVisualStyleBackColor = True
Me.CheckBox1.AutoSize = True
Me.CheckBox1.BackColor = Color.Black
Me.CheckBox1.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.CheckBox1.ForeColor = Color.White
point2 = New Point(12, &H36)
Me.CheckBox1.Location = point2
Me.CheckBox1.Name = "CheckBox1"
size2 = New Size(&H88, &H13)
Me.CheckBox1.Size = size2
Me.CheckBox1.TabIndex = 6
Me.CheckBox1.Text = "Close After Injection"
Me.CheckBox1.UseVisualStyleBackColor = False
Me.ListBox1.Font = New Font("Comic Sans MS", 8.25!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.ItemHeight = 15
point2 = New Point(&H76, &H126)
Me.ListBox1.Location = point2
Me.ListBox1.Name = "ListBox1"
size2 = New Size(&H9D, &H4F)
Me.ListBox1.Size = size2
Me.ListBox1.TabIndex = 7
Me.Label1.AutoSize = True
Me.Label1.BackColor = Color.Black
Me.Label1.Font = New Font("Comic Sans MS", 9.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
Me.Label1.ForeColor = Color.Red
point2 = New Point(&H72, &H19D)
Me.Label1.Location = point2
Me.Label1.Name = "Label1"
size2 = New Size(&H11, &H12)
Me.Label1.Size = size2
Me.Label1.TabIndex = 8
Me.Label1.Text = "..."
Me.Timer2.Enabled = True
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
Me.Label2.AutoSize = True
Me.Label2.BackColor = Color.Black
Me.Label2.ForeColor = Color.White
point2 = New Point(15, &H1C)
Me.Label2.Location = point2
Me.Label2.Name = "Label2"
size2 = New Size(&H2D, 13)
Me.Label2.Size = size2
Me.Label2.TabIndex = 9
Me.Label2.Text = "Process"
Dim ef2 As New SizeF(6!, 13!)
Me.AutoScaleDimensions = ef2
Me.AutoScaleMode = AutoScaleMode.Font
Me.BackgroundImage = DirectCast(manager.GetObject("$this.BackgroundImage"), Image)
size2 = New Size(&H14F, 440)
Me.ClientSize = size2
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Icon = DirectCast(manager.GetObject("$this.Icon"), Icon)
Me.Name = "Form1"
Me.Text = "MetreInjector V 1.4"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout
Me.ResumeLayout(False)
Me.PerformLayout
End Sub
Private Function Inject(ByVal pID As Integer, ByVal dllLocation As String) As Boolean
If (IntPtr.Size = 8) Then
Throw New ArgumentException("Please make sure this program is compiled as x86, not x64. Memory functions don't work so well otherwise.")
End If
Dim hProcess As Integer = Form1.OpenProcess(&H1F0FFF, 1, pID)
If (hProcess = 0) Then
Return False
End If
Dim bytes As Byte() = Encoding.ASCII.GetBytes(dllLocation)
Dim lpBaseAddress As Integer = Form1.VirtualAllocEx(hProcess, 0, bytes.Length, &H1000, 4)
If (lpBaseAddress = 0) Then
Return False
End If
Dim lpModuleName As String = "kernel32.dll"
Dim moduleHandle As Integer = Form1.GetModuleHandle(lpModuleName)
lpModuleName = "LoadLibraryA"
Dim procAddress As Integer = Form1.GetProcAddress(moduleHandle, lpModuleName)
If ((moduleHandle = 0) OrElse (procAddress = 0)) Then
Return False
End If
Form1.WriteProcessMemory(hProcess, lpBaseAddress, bytes, bytes.Length, 0)
Dim hHandle As Integer = Form1.CreateRemoteThread(hProcess, 0, 0, procAddress, lpBaseAddress, 0, 0)
If (hHandle = 0) Then
Return False
End If
Form1.WaitForSingleObject(hHandle, &H1388)
Form1.CloseHandle(hHandle)
Form1.CloseHandle(hProcess)
Me.Label1.Text = "DLL injected successfully."
If Me.CheckBox1.Checked Then
Me.Close
End If
Me.Label1.ForeColor = Color.Green
Return True
End Function
Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As CancelEventArgs)
Dim item As String = Me.OpenFileDialog1.FileName.Substring(Me.OpenFileDialog1.FileName.LastIndexOf("\")).Replace("\", "")
Me.ListBox1.Items.Add(item)
Me.dlls.Add(item, Me.OpenFileDialog1.FileName)
End Sub
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function OpenProcess(ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
End Function
Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
MySettingsProperty.Settings.inject = "auto"
Me.Button3.Enabled = False
Me.Timer1.Start
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
MySettingsProperty.Settings.inject = "manual"
Me.Button3.Enabled = True
Me.Timer1.Stop
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
If (Me.ListBox1.Items.Count > 0) Then
If (Process.GetProcessesByName(Me.TextBox1.Text).Length = 0) Then
Me.Label1.Text = ("Waiting for " & Me.TextBox1.Text & ".exe")
Me.Label1.ForeColor = Color.Red
Else
Dim id As Integer = Process.GetProcessesByName(Me.TextBox1.Text)(0).Id
Me.Timer1.Stop
Me.Timer2.Stop
Dim pair As KeyValuePair(Of String, String)
For Each pair In Me.dlls
Me.Inject(id, pair.Value)
Next
End If
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As EventArgs)
If (Me.TextBox1.Text = "") Then
Me.Label1.Text = "Waiting for process to be set."
Me.Label1.ForeColor = Color.Red
Me.Timer1.Stop
ElseIf (Me.ListBox1.Items.Count = 0) Then
Me.Label1.Text = "Waiting for DLL path."
Me.Label1.ForeColor = Color.Red
Me.Timer1.Stop
ElseIf (Process.GetProcessesByName(Me.TextBox1.Text).Length = 0) Then
Me.Label1.Text = ("Waiting for " & Me.TextBox1.Text & ".exe")
Me.Label1.ForeColor = Color.Red
ElseIf Me.RadioButton1.Checked Then
Me.Timer1.Start
End If
End Sub
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function VirtualAllocEx(ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function WaitForSingleObject(ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function WriteProcessMemory(ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer As Byte(), ByVal nSize As Integer, ByVal lpNumberOfBytesWritten As UInt32) As Boolean
End Function
' Properties
Friend Overridable Property Button1 As Button
<DebuggerNonUserCode> _
Get
Return Me._Button1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Button)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Button1_Click)
If (Not Me._Button1 Is Nothing) Then
RemoveHandler Me._Button1.Click, handler
End If
Me._Button1 = WithEventsValue
If (Not Me._Button1 Is Nothing) Then
AddHandler Me._Button1.Click, handler
End If
End Set
End Property
Friend Overridable Property Button2 As Button
<DebuggerNonUserCode> _
Get
Return Me._Button2
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Button)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Button2_Click)
If (Not Me._Button2 Is Nothing) Then
RemoveHandler Me._Button2.Click, handler
End If
Me._Button2 = WithEventsValue
If (Not Me._Button2 Is Nothing) Then
AddHandler Me._Button2.Click, handler
End If
End Set
End Property
Friend Overridable Property Button3 As Button
<DebuggerNonUserCode> _
Get
Return Me._Button3
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Button)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Button3_Click)
If (Not Me._Button3 Is Nothing) Then
RemoveHandler Me._Button3.Click, handler
End If
Me._Button3 = WithEventsValue
If (Not Me._Button3 Is Nothing) Then
AddHandler Me._Button3.Click, handler
End If
End Set
End Property
Friend Overridable Property Button4 As Button
<DebuggerNonUserCode> _
Get
Return Me._Button4
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Button)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Button4_Click)
If (Not Me._Button4 Is Nothing) Then
RemoveHandler Me._Button4.Click, handler
End If
Me._Button4 = WithEventsValue
If (Not Me._Button4 Is Nothing) Then
AddHandler Me._Button4.Click, handler
End If
End Set
End Property
Friend Overridable Property CheckBox1 As CheckBox
<DebuggerNonUserCode> _
Get
Return Me._CheckBox1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As CheckBox)
Me._CheckBox1 = WithEventsValue
End Set
End Property
Friend Overridable Property GroupBox1 As GroupBox
<DebuggerNonUserCode> _
Get
Return Me._GroupBox1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As GroupBox)
Me._GroupBox1 = WithEventsValue
End Set
End Property
Friend Overridable Property Label1 As Label
<DebuggerNonUserCode> _
Get
Return Me._Label1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Label)
Me._Label1 = WithEventsValue
End Set
End Property
Friend Overridable Property Label2 As Label
<DebuggerNonUserCode> _
Get
Return Me._Label2
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Label)
Me._Label2 = WithEventsValue
End Set
End Property
Friend Overridable Property ListBox1 As ListBox
<DebuggerNonUserCode> _
Get
Return Me._ListBox1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As ListBox)
Me._ListBox1 = WithEventsValue
End Set
End Property
Friend Overridable Property OpenFileDialog1 As OpenFileDialog
<DebuggerNonUserCode> _
Get
Return Me._OpenFileDialog1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As OpenFileDialog)
Dim handler As CancelEventHandler = New CancelEventHandler(AddressOf Me.OpenFileDialog1_FileOk)
If (Not Me._OpenFileDialog1 Is Nothing) Then
RemoveHandler Me._OpenFileDialog1.FileOk, handler
End If
Me._OpenFileDialog1 = WithEventsValue
If (Not Me._OpenFileDialog1 Is Nothing) Then
AddHandler Me._OpenFileDialog1.FileOk, handler
End If
End Set
End Property
Friend Overridable Property RadioButton1 As RadioButton
<DebuggerNonUserCode> _
Get
Return Me._RadioButton1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As RadioButton)
Dim handler As EventHandler = New EventHandler(AddressOf Me.RadioButton1_CheckedChanged)
If (Not Me._RadioButton1 Is Nothing) Then
RemoveHandler Me._RadioButton1.CheckedChanged, handler
End If
Me._RadioButton1 = WithEventsValue
If (Not Me._RadioButton1 Is Nothing) Then
AddHandler Me._RadioButton1.CheckedChanged, handler
End If
End Set
End Property
Friend Overridable Property RadioButton2 As RadioButton
<DebuggerNonUserCode> _
Get
Return Me._RadioButton2
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As RadioButton)
Dim handler As EventHandler = New EventHandler(AddressOf Me.RadioButton2_CheckedChanged)
If (Not Me._RadioButton2 Is Nothing) Then
RemoveHandler Me._RadioButton2.CheckedChanged, handler
End If
Me._RadioButton2 = WithEventsValue
If (Not Me._RadioButton2 Is Nothing) Then
AddHandler Me._RadioButton2.CheckedChanged, handler
End If
End Set
End Property
Friend Overridable Property TextBox1 As TextBox
<DebuggerNonUserCode> _
Get
Return Me._TextBox1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As TextBox)
Me._TextBox1 = WithEventsValue
End Set
End Property
Friend Overridable Property Timer1 As Timer
<DebuggerNonUserCode> _
Get
Return Me._Timer1
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Timer)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Timer1_Tick)
If (Not Me._Timer1 Is Nothing) Then
RemoveHandler Me._Timer1.Tick, handler
End If
Me._Timer1 = WithEventsValue
If (Not Me._Timer1 Is Nothing) Then
AddHandler Me._Timer1.Tick, handler
End If
End Set
End Property
Friend Overridable Property Timer2 As Timer
<DebuggerNonUserCode> _
Get
Return Me._Timer2
End Get
<MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
Set(ByVal WithEventsValue As Timer)
Dim handler As EventHandler = New EventHandler(AddressOf Me.Timer2_Tick)
If (Not Me._Timer2 Is Nothing) Then
RemoveHandler Me._Timer2.Tick, handler
End If
Me._Timer2 = WithEventsValue
If (Not Me._Timer2 Is Nothing) Then
AddHandler Me._Timer2.Tick, handler
End If
End Set
End Property
' Fields
Private Shared __ENCList As List(Of WeakReference) = New List(Of WeakReference)
<AccessedThroughProperty("Button1")> _
Private _Button1 As Button
<AccessedThroughProperty("Button2")> _
Private _Button2 As Button
<AccessedThroughProperty("Button3")> _
Private _Button3 As Button
<AccessedThroughProperty("Button4")> _
Private _Button4 As Button
<AccessedThroughProperty("CheckBox1")> _
Private _CheckBox1 As CheckBox
<AccessedThroughProperty("GroupBox1")> _
Private _GroupBox1 As GroupBox
<AccessedThroughProperty("Label1")> _
Private _Label1 As Label
<AccessedThroughProperty("Label2")> _
Private _Label2 As Label
<AccessedThroughProperty("ListBox1")> _
Private _ListBox1 As ListBox
<AccessedThroughProperty("OpenFileDialog1")> _
Private _OpenFileDialog1 As OpenFileDialog
<AccessedThroughProperty("RadioButton1")> _
Private _RadioButton1 As RadioButton
<AccessedThroughProperty("RadioButton2")> _
Private _RadioButton2 As RadioButton
<AccessedThroughProperty("TextBox1")> _
Private _TextBox1 As TextBox
<AccessedThroughProperty("Timer1")> _
Private _Timer1 As Timer
<AccessedThroughProperty("Timer2")> _
Private _Timer2 As Timer
Private components As IContainer
Private dlls As Dictionary(Of String, String)
End Class
End Namespace