GME  13
WelcomeScreenExp.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.Windows.Forms;
00005 using System.Runtime.InteropServices;
00006 
00007 namespace CSGUI
00008 {
00009     internal class WindowWrapper : IWin32Window
00010     {
00011         public IntPtr Handle { get; private set; }
00012         public WindowWrapper(IntPtr hwnd) { Handle = hwnd; }
00013     }
00014 
00015     [Guid("68FDA295-8D49-4445-BE29-1F171B4BE07D"),
00016     ProgId("CSGUI.WelcomeScreenExp"),
00017     ClassInterface(ClassInterfaceType.AutoDual)]
00018     [ComVisible(true)]
00019     public class WelcomeScreenExp
00020     {
00021         public static string sCREATE_SENTINEL = "<create>";
00022         public string CREATE_SENTINEL { get { return sCREATE_SENTINEL; } }
00023         public string ShowWelcomeWindow(Int64 parentHwnd)
00024         {
00025             WelcomeScreen ws = new WelcomeScreen();
00026             ws.ShowDialog(new WindowWrapper((IntPtr)parentHwnd), recents);
00027             return ws.SelectedProject;
00028         }
00029 
00030         List<string> recents = new List<string>();
00031 
00032         public void SetRecentProjects(object recents)
00033         {
00034             foreach (string recent in (recents as Array))
00035             {
00036                 if (!String.IsNullOrEmpty(recent))
00037                     this.recents.Add(recent);
00038             }
00039         }
00040 
00041         public void SwitchRef()
00042         {
00043             new ReferenceSwitcher().SwitchReference(null, null);
00044         }
00045     }
00046 
00047 }