Deleting Files With Events

While working on the dotNetTips Dev Cleaner utility, I wanted to make the deletion of files even faster. While writing this utility I found and worked on speed issues, almost all relating to updating the user interface. So to decouple the deleting from the UI I decided to add a new feature to the dotNetTips.Utility [...]

Advertisements

My Workflow Before I Submit Code Changes

For many years when speaking at conferences, I have shared my workflow on what I do before I submit code changes to source control. This article will explain it more in detail. I share this workflow because it makes sure that I rarely get bug tickets from quality assurance and hopefully it will for you [...]

Make Encapsulation Easy with dotNetTips.Utility

Encapsulation is the first pillar of Object Oriented Programming (OOP), yet most code that I see does not implement encapsulation correctly or not all. Like I say in many of my conference sessions "If you do not implement encapsulation, you aren't doing OOP!" I also say "Bad data in, bad data out!". Several years ago, [...]

Retrieve The Status of a Windows Service

Here is an easy way to get the status of a Windows service. Public Function ServiceStatus(serviceName As String) As  ServiceControllerStatus Dim service As ServiceController = LoadService(serviceName) If service IsNot Nothing Then Return service.Status Else Throw New InvalidOperationException("Service not  found.") End If End Function Private Function LoadService(serviceName As String) As ServiceController      Return ServiceController.GetServices().Where(Function(p) p.ServiceName = serviceName).FirstOrDefault() End Function Here are the values for service status: ContinuePending Paused PausePending Running StartPending Stopped StopPending This and lost  more code can be found in the [...]