[MS] A hypothetical redesign of System.Diagnostics.Process to avoid confusion over properties that are valid only when you are the one who called Start - devamazonaws.blogspot.com
Some time ago, I noted that the Process. StandardOutput property is an attractive nuisance because it is valid only on Process objects that you called Start on. You can't just grab any old Process object and try to access its standard handles. Others in the comments had their ideas on how to remove the confusion. Here's mine. The principle is that the properties and methods of the Process object should be valid for all instances of the Process class. If a property or method is valid only conditionally, then either move it to a place that is accessible only if the condition is met, or get rid of it entirely if it adds no value. The standard handles are the three properties that make sense only for Process objects that were created by the static Start method. There are also four methods related to those standard handles, as well as two events. Move them all to a new class, call it Process StartResult : class Process StartResult { public Process Process { get; ...