Hey there 
I love to make my custom classes, for easy programming, so i dont have to go trow tons of code..
so i have created this class:
when i use the code i have to use it like this:
How do i have to modifie code so i can use it like this:
i hope you understand what i need, and can help me
I love to make my custom classes, for easy programming, so i dont have to go trow tons of code..
so i have created this class:
VB.NET:
Public Class BatteryStatus
Private Declare Auto Function GetSystemPowerStatus Lib "kernel32.dll" ( _
ByRef lpSystemPowerStatus As SYSTEM_POWER_STATUS) _
As Integer
Public Structure SYSTEM_POWER_STATUS
Public ACLineStatus As ACLineStatus
Public BatteryFlag As BatteryFlag
Public BatteryLifePercent As Byte
Public Reserved1 As Byte
Public BatteryLifeTime As Integer
Public BatteryFullLifeTime As Integer
End Structure
''' <summary>
''' Get Battery Flag status
''' </summary>
''' <remarks></remarks>
Public Enum BatteryFlag As Byte
High = 1
Low = 2
Critical = 4
Charging = 8
NoSystemBattery = 128
Unknown = 255
End Enum
''' <summary>
''' Get Power cable status
''' </summary>
''' <remarks></remarks>
Public Enum ACLineStatus As Byte
Offline = 0
Online = 1
Unknown = 255
End Enum
Public Shared Function GetStatus() As SYSTEM_POWER_STATUS
Dim SPS As New SYSTEM_POWER_STATUS
GetSystemPowerStatus(SPS)
Return SPS
End Function
End Class
when i use the code i have to use it like this:
VB.NET:
If BatteryStatus.BatteryFlag.Charging = BatteryStatus.BatteryFlag.Charging Then
End If
How do i have to modifie code so i can use it like this:
VB.NET:
If BatteryStatus.BatteryFlag = BatteryStatus.BatteryFlag.Charging Then
End If
i hope you understand what i need, and can help me