J'utilise OpenNetCF's IoC framework et le code dans ma classe de programme ressemble à:OpenNetCF.IoC ne peut pas frapper commencer dans SmartClientApplication
public class Program : SmartClientApplication<Container>
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[MTAThread]
static void Main()
{
if (!string.Equals(RegionInfo.CurrentRegion.EnglishName, "New Zealand") ||
!string.Equals(TimeZone.CurrentTimeZone.StandardName, "New Zealand Standard Time"))
{
MessageBox.Show("Please set your regional and time zone settings to New Zealand.");
return;
}
AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
new Program().Start();
}
static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
if (Debugger.IsAttached)
{
Debugger.Break();
}
}
}
J'ai recopié OpenNETCF dans ma solution et je me attendais lorsque le programme() .start() a été appelé sauterait à la méthode de départ ici, donc je mets un point de rupture sur elle:
public abstract class SmartClientApplication<TShell>
where TShell : Form
{
/// <summary>
/// This method loads the Profile Catalog Modules by calling GetModuleInfoStore which, unless overridden, uses a DefaultModuleInfoStore instance.
/// It then creates an instance of TShell and calls Application.Run with that instance.
/// </summary>
public void Start()
{
// load up the profile catalog here
IModuleInfoStore store = GetModuleInfoStore();
Start(store);
}
Étrangement il n'a jamais atteint le point de rupture. Je pensais que c'était étrange, j'ai donc cliqué dans le programme pour accéder à la définition de la référence d'héritage à SmartClientApplication.
Cela a ouvert un fichier complètement différent de celui que je me attendais et ressemble à:
using OpenNETCF.IoC;
using System;
using System.Windows.Forms;
namespace OpenNETCF.IoC.UI
{
public abstract class SmartClientApplication<TShell> where TShell : System.Windows.Forms.Form
{
protected SmartClientApplication();
public virtual void AddServices();
protected virtual void AfterShellCreated();
public virtual IModuleInfoStore GetModuleInfoStore();
public virtual void OnApplicationRun(Form form);
public virtual void OnModuleLoadComplete(string moduleName);
public void Start();
public void Start(string profileCatalog);
}
}
Même nom, mais le contenu ne semble pas contenir de mise en œuvre. Quand je vois où son emplacement il est quelque chose comme:
C: \ Users \ mon nom d'utilisateur \ AppData \ Local \ Temp \ 7212 $ OpenNETCF.IoC.UI.dll $ v2.0.50727 \ OpenNETCF.IoC.UI.SmartClientApplication. Cela explique pourquoi il n'a pas atteint le point d'arrêt, mais ce que je veux savoir, c'est pourquoi il regarde même ce fichier fou et pas celui qu'il devrait être.