You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.4 KiB
104 lines
2.4 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using System; |
|
using System.Collections; |
|
using System.IO; |
|
using System.Windows.Forms; |
|
using System.Drawing; |
|
using System.Reflection; |
|
using System.Resources; |
|
|
|
namespace ICSharpCode.SharpDevelop |
|
{ |
|
public class SplashScreenForm : Form |
|
{ |
|
public const string VersionText = "Corsavy Beta 1, rev. " + RevisionClass.Revision; |
|
|
|
static SplashScreenForm splashScreen = new SplashScreenForm(); |
|
static ArrayList requestedFileList = new ArrayList(); |
|
static ArrayList parameterList = new ArrayList(); |
|
Bitmap bitmap; |
|
|
|
public static SplashScreenForm SplashScreen { |
|
get { |
|
return splashScreen; |
|
} |
|
} |
|
|
|
public SplashScreenForm() |
|
{ |
|
#if !DEBUG |
|
TopMost = true; |
|
#endif |
|
FormBorderStyle = FormBorderStyle.None; |
|
StartPosition = FormStartPosition.CenterScreen; |
|
ShowInTaskbar = false; |
|
#if DEBUG |
|
string versionText = VersionText + " (debug)"; |
|
#else |
|
string versionText = VersionText; |
|
#endif |
|
using (Stream stream = Assembly.GetEntryAssembly().GetManifestResourceStream("Resources.SplashScreen.jpg")) { |
|
bitmap = new Bitmap(stream); |
|
} |
|
this.ClientSize = bitmap.Size; |
|
using (Font font = new Font("Sans Serif", 4)) { |
|
using (Graphics g = Graphics.FromImage(bitmap)) { |
|
g.DrawString(versionText, font, Brushes.Black, 100, 142); |
|
} |
|
} |
|
BackgroundImage = bitmap; |
|
} |
|
|
|
protected override void Dispose(bool disposing) |
|
{ |
|
if (disposing) { |
|
if (bitmap != null) { |
|
bitmap.Dispose(); |
|
bitmap = null; |
|
} |
|
} |
|
base.Dispose(disposing); |
|
} |
|
|
|
public static string[] GetParameterList() |
|
{ |
|
return GetStringArray(parameterList); |
|
} |
|
|
|
public static string[] GetRequestedFileList() |
|
{ |
|
return GetStringArray(requestedFileList); |
|
} |
|
|
|
static string[] GetStringArray(ArrayList list) |
|
{ |
|
return (string[])list.ToArray(typeof(string)); |
|
} |
|
|
|
public static void SetCommandLineArgs(string[] args) |
|
{ |
|
requestedFileList.Clear(); |
|
parameterList.Clear(); |
|
|
|
foreach (string arg in args) { |
|
if (arg[0] == '-' || arg[0] == '/') { |
|
int markerLength = 1; |
|
|
|
if (arg.Length >= 2 && arg[0] == '-' && arg[1] == '-') { |
|
markerLength = 2; |
|
} |
|
|
|
parameterList.Add(arg.Substring(markerLength)); |
|
} else { |
|
requestedFileList.Add(arg); |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|