Imports Microsoft.VisualBasic
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms

Namespace ServerExplorerExamples
	''' <summary>
	''' Summary description for PerfCounterExample.
	''' </summary>
	Public Class PerfCounterExample : Inherits System.Windows.Forms.Form
        Private label1 As System.Windows.Forms.Label
		Private label2 As System.Windows.Forms.Label
		''' <summary>
		''' Required designer variable.
		''' </summary>
		Private components As System.ComponentModel.Container = Nothing

		Public Sub New()
			'
			' Required for Windows Form Designer support
			'
			InitializeComponent()

			'
			' TODO: Add any constructor code after InitializeComponent call
			'
		End Sub

		''' <summary>
		''' Clean up any resources being used.
		''' </summary>
		Protected Overrides Overloads Sub Dispose(ByVal disposing As Boolean)
			If disposing Then
				If Not components Is Nothing Then
					components.Dispose()
				End If
			End If
			MyBase.Dispose(disposing)
		End Sub

		#Region "Windows Form Designer generated code"
		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
        Friend WithEvents PerformanceCounter1 As System.Diagnostics.PerformanceCounter
        Private Sub InitializeComponent()
            Me.label1 = New System.Windows.Forms.Label
            Me.label2 = New System.Windows.Forms.Label
            Me.PerformanceCounter1 = New System.Diagnostics.PerformanceCounter
            CType(Me.PerformanceCounter1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'label1
            '
            Me.label1.Location = New System.Drawing.Point(8, 32)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(96, 16)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Dostêpna pamiêæ w MB:"
            '
            'label2
            '
            Me.label2.Location = New System.Drawing.Point(112, 32)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(100, 16)
            Me.label2.TabIndex = 1
            '
            'PerformanceCounter1
            '
            Me.PerformanceCounter1.CategoryName = "Memory"
            Me.PerformanceCounter1.CounterName = "Available MBytes"
            Me.PerformanceCounter1.MachineName = "TOSHIBA"
            '
            'PerfCounterExample
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.ClientSize = New System.Drawing.Size(292, 266)
            Me.Controls.Add(Me.label2)
            Me.Controls.Add(Me.label1)
            Me.Name = "PerfCounterExample"
            Me.Text = "PerfCounterExample"
            CType(Me.PerformanceCounter1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
#End Region

		Private Sub PerfCounterExample_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
			label2.Text = performanceCounter1.NextValue().ToString()

		End Sub
	End Class
End Namespace
