PDA

View Full Version : Reflector Like App UI


Anonymous
12-12-2004, 06:23 AM
Just found this and thought I would start upa thread about a UI I am working on.

My app is based on the MMC and Reflector. I want the Intrerface based esign of Reflector with the all-purpose abilities of the MMC. My first question is about the use of ApplicationContext in the Main method versus Application.Run(new Form)

What are peoples thoughts on something like this.

[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.DoEvents();

MyContext context = MyContext.Instance;

Application.Run(context);
}

public class MyContext : ApplicationContext {
private Context () : base(){

_console = new MyForm();

_console.Closed +=new EventHandler(OnFormClosed);
formCount++;

_console.Show();

}
}

In this context is where I would add all of my IApplicationContext stuff.

Any thoughts?

Mark Pollack
12-13-2004, 02:50 PM
Hi,

Best practices and any supporting classes spring should provide for UI development is a hot topic right now. The dev mailing list now has a thread on this topic.

Currently my suggestion would be to create the application context in the main of your program as you would normally and set this instance to be accessible via a singleton helper class. I am currently digging through the factory/context access namespace which offers some built-in support for singleton access to the context. You may also want to define some winform classes that are singletons lazy-init = true so they aren't created at startup - but on demand when you ask for them later. Another possibility (I think...) is to put the application context itself in a top level container from the component model and get at it via getservice. While the .net component model isn't as flexible as spring's, for this particular case it maybe a nice integration point.

Please let us know what you are discovering that works for you - your input is greatly appreciated.

Cheers,
Mark