Sep 12, 2011 at 8:46 PM
Edited Sep 12, 2011 at 9:01 PM
Thanks for your reply. I'm looking to add application specific functionality rather than functionality relevant to all applications (which White.Core.Application already does well).
For example, I don't want the end user to have to know the exe path for each application I'm implementing as I can do the install location lookup in the registry myself. Taking the Visual Studio idea again..
is clear, an extension like
less so, and then if I want more than one application implementation if fails. For example...
makes sense but extension method Application.Launch() can only use one path internally. Also going with the previous posts example given something like..
VisualStudio vs = VisualStudio.Launch();
VSProject vsp = vs.OpenNewProject( "myproject.sln" );
OpenNewProject(..) makes sense for Visual Studio but not for Notepad so a White.Core.Application extension method OpenNewProject(..) doesn't make sense.
So at the moment I'm wrapping an Application object in each application implementation which is OK for adding new functionality but to expose the composed Application objects existing functionality with this method I have to wrap each of its methods without
adding any functionality which is pointless.. what I really want is to subclass Application directly. I'm hoping I am missing something and this is possible.
public class VisualStudio : IDisposable
protected Application m_Application; //
protected VisualStudio( Application application)
m_Application = application;
public static VisualStudio Launch( )
Application application = Application.Launch( "visual_studio_path_goes_here" );
return new VisualStudio( application );
// here's the problem i have to wrap existing Application methods when I'm not typically adding any functionality to them
public Window GetWindow( String title )
return m_Application.GetWindow( title );
public void Kill()
Then the same applies for Notepad and any other application I want to implement. Boo! Anyone, have a different idea/pattern?