Click to See Complete Forum and Search --> : Splash screen in C#(need best object design)


visharad
October 6th, 2008, 05:26 AM
I am using Visual Studio 2008 and I have to develop a dll in C#. The dll should display a splash screen. It will expose two methods:-
1. Show
2. Done

The client exe will call these two methods. The exe calls Show with image filename(with path) and other relevant details. Show will display that image in a form.

When Done is called, then all the required cleanup is done and the form is unloaded.

I have worked on C#, so know how to achieve the above but I want to know the best design because the loading of the screen should be as fast as possible. Also, it should be able to support any image format.
If required, then Show will accept the format as an argument.

What is the best way so that the screen can be displayed very fast?

When Done is called, at that time the form is loaded on screen. Therefore, I think that Show should start a thread and the form should be displayed inside that thread. After starting the thread, Show will return. Is this OK or do you suggest something else?

What cleanups, if any, should be put inside Done other than what is done by garbage collector?

What is better? To display the image on the form itself or inside some control (e.g. PictureBox) placed on the form?
Thanks.

TheCPUWizard
October 11th, 2008, 06:23 PM
You have a pretty good basis there.

Regarding the thread...the most common convention is to use the default (main) thread ONLY for UI. Therefore the splash can live on the main thread, but you may want to move all of the heavy initialization to a worker thread.

Regarding "cleanup". Just make sure ytou have a robust architecture that will call Dispose on EVERY object that implements IDisposable at the earliest possible time.

Good Luck. :wave: :wave:

visharad
October 13th, 2008, 07:52 AM
In the beginning, this looks very simple. But the problem is that the client already has implementation of splash screen (developed by some other company). I do not know what that implementation is. But the client says that they are not happy with it mostly because it takes lots of time to load. They say that there are some other reasons too because of which they want a different implementation - though I do not know what those reasons are.
This means that the client has something big in mind but they are not specifying what exactly.

TheCPUWizard
October 13th, 2008, 08:23 AM
In the beginning, this looks very simple. But the problem is that the client already has implementation of splash screen (developed by some other company). I do not know what that implementation is. But the client says that they are not happy with it mostly because it takes lots of time to load. They say that there are some other reasons too because of which they want a different implementation - though I do not know what those reasons are.
This means that the client has something big in mind but they are not specifying what exactly.


Without knowing:

1) The existing implementation
2) The "problems" with the implementation (slow is not a problem, it is a symtom).
3) The required behaviour (performance should be part of a specification)

It is impossible to provide any further guidance. Gather the requested information from your client..THEN post back here....

victor2008
October 14th, 2008, 01:46 AM
C# is a part of .Net and it is based on the object oriented programming language. C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Because software robustness, durability and programmer productivity are important. The language should include strong type checking, array bounds checking, detection of attempts to use uninitialized variables, source code portability and automatically garbage collection.
___________________________________________
Mens Carhartt Coats (http://www.workwear1.com/browse.cfm/2,79.html) dubai real estate (http://www.choicepropertyinvestment.com/international-developments/dubai-property-investment/)