- demo.zip
- Demo
- .vsdoc
- _ReSharper.Demo
- 2fa8f55f-93da-4535-b660-d3aa9eb558d3.Metadata
- 44c1ee5a-86f2-4693-bd23-9ea432f70311.Metadata
- 796da43d-eca6-4338-bd5f-b3c977cf5406.Metadata
- 796da43d-eca6-4338-bd5f-b3c977cf5406.XmlDocIndex
- 9124bfb1-a467-4919-a61b-ce63e2a2f9c4.Metadata
- CachesImage.bin
- e90f139d-8dee-4949-bdfd-469c2c3e6f72.Metadata
- e971f214-98e6-4894-ae97-b15970f0d8ab.Metadata
- ReflectionCache.xml
- TodoCache
- .version
- 8
- 9
- 56e4b1dd.dat
- WordIndex.New
- .version
- 3
- 5f139496.dat
- 4
- Demo.4.1.resharper.user
- Demo.sln
- Demo.sln.vsdoc
- Demo
- splashscreen.zip
- SplashScreen
- SplashScreen
- .vsdoc
- _ReSharper.SplashScreen
- a37a97bd-afea-4cc4-aab6-1ad9be1bfbfe.Metadata
- a37a97bd-afea-4cc4-aab6-1ad9be1bfbfe.XmlDocIndex
- CachesImage.bin
- ReflectionCache.xml
- TodoCache
- .version
- 4
- 9
- 2e4b3532.dat
- WordIndex.New
- SplashScreen.4.1.resharper.user
- SplashScreen.sln
- SplashScreen.sln.vsdoc
- SplashScreen
|
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using DGDev;
namespace Demo
{
static class Program
{
private static SplashScreen splash;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
/*****************************************
* Setup and display splash screen
*************************************** */
const String resourceName = "Splash.png"; // Name of EmbeddedResource Image
var InfoLabel = new Point(25, 92); // Creates the point to position the ProgramInfoLabel
var StatusLabel = new Point(28, 261); // Creates the point to position the StatusLabel
splash = SplashScreen.Current; //
splash.SetTransparentKey = Color.Fuchsia;
var rs = GetResourceStream(resourceName);
splash.SetBackgroundImage = new Bitmap(rs);
//splash.SetFade = true; // This fades the splash screen in and out. However, when using TransparencyKey, doesn't not display correctly.
splash.SetInfoLabel(InfoLabel, 499, 117);
splash.SetStatusLabel(StatusLabel, 490, 17);
splash.ShowSplashScreen();
splash.SetInfo = "This program is just an example.";
// Create and AssemblyHandler
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyLoad += asmLoadHandler;
splash.SetStatus = "Reading Configuration ...";
LoadConfigData();
Application.Run(new Form1());
}
private static System.IO.Stream GetResourceStream(String resource)
{
var ea = System.Reflection.Assembly.GetExecutingAssembly();
foreach (String curResource in ea.GetManifestResourceNames())
{
if (curResource.EndsWith(resource))
{
return ea.GetManifestResourceStream(curResource);
}
}
return null;
}
static void asmLoadHandler(object sender, AssemblyLoadEventArgs args)
{
// This probably won't display anything for the demo because there is hardly anything to load.
splash.SetStatus = "Loading Assembly: " + args.LoadedAssembly.GetName().Name + " ...";
}
private static void LoadConfigData()
{
// Simulate loading...
// This would not normally be done here, but rather in the Form_Load, etc etc
splash.SetStatus = "Loading module 1";
Thread.Sleep(500);
splash.SetStatus = "Loading module 2";
Thread.Sleep(300);
splash.SetStatus = "Loading module 3";
Thread.Sleep(900);
splash.SetStatus = "Loading module 4";
Thread.Sleep(100);
splash.SetStatus = "Loading module 5";
Thread.Sleep(500);
splash.SetStatus = "Loading module 6";
Thread.Sleep(600);
splash.SetStatus = "Loading module 7";
Thread.Sleep(200);
splash.SetStatus = "Loading module 8";
Thread.Sleep(800);
splash.SetStatus = "Loading module 9";
Thread.Sleep(400);
splash.CloseSplashScreen();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.