|
Imports System.Windows.Forms
Imports System.Diagnostics
Public Class SettingsForm
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add all the running instances of .NET apps to the drop down list
If PerformanceCounterCategory.CounterExists("# GC Handles", Form_Dashboard.COUNTER_CATEGORY_MEMORY) Then
Dim pcInst As New PerformanceCounterCategory(Form_Dashboard.COUNTER_CATEGORY_MEMORY)
With pcInst
Dim Items() As String = .GetInstanceNames
For Each f As String In Items
Me.ComboBox_ApplicationInstances.Items.Add(f)
Next
End With
End If
Try
If My.Settings.MonitoredInstanceName <> "" Then
Me.ComboBox_ApplicationInstances.SelectedItem = My.Settings.MonitoredInstanceName
End If
Catch ex As Exception
Debug.Fail(ex.ToString)
End Try
With My.Settings
Me.TextBox_Max_Classes.Text = .DialClassesMaximum.ToString
Me.TextBox_Max_Exceptions.Text = .DialExceptionsMaximum.ToString
Me.TextBox_Max_Garbage.Text = .DialGarbageMaximum.ToString
Me.TextBox_Max_Memory.Text = .DialMemoryMaximum.ToString
Me.TextBox_Max_Threads.Text = .DialThreadsMaximum.ToString
Me.TextBox_Min_Classes.Text = .DialClassesMinimum.ToString
Me.TextBox_Min_Exceptions.Text = .DialExceptionsMinimum.ToString
Me.TextBox_Min_Garbage.Text = .DialGarbageMinimum.ToString
Me.TextBox_Min_Memory.Text = .DialMemoryMinimum.ToString
Me.TextBox_Min_Threads.Text = .DialThreadsMinimum.ToString
End With
End Sub
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Public ReadOnly Property SelectedInstanceName() As String
Get
Return Me.ComboBox_ApplicationInstances.Text
End Get
End Property
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.