English 中文(简体)
结构与Windows格式
原标题:StructureMap with Windows Forms

I m用于与结构Map合作,使用Web Apps...,但现在,Im在视窗项目上工作,我想加以利用,但我没有如何配置。

在网络上,我有一个供申请使用的boot门级。 开始于全球,但我不知道如何在温福斯这样做。

感谢!

最佳回答

您可以在启动申请的静态主力方法中启动集装箱。 然后从集装箱中取回你的形式,以便注入任何必要的附属设施。 你们仍然可以把初始化法放在诱杀装置中。

static class Program
{
    [STAThread]
    static void Main()
    {
        ObjectFactory.Initialize(...);
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(ObjectFactory.GetInstance<Form1>());
    }
}
问题回答

关于Winforms申请的对应部分: 开始是首先采用第一个表格的主要方法。

在使用带有网络应用程序的用户时,一般都有按要求创建数据环境/会议的一般规则。 关于温带应用,你倾向于按操作或每形式进入一个环境。

你以同样的方式安排了boot和IoC的配置(尽管我不敢肯定你如何将形式班本身包括在内,但我没有与温福斯做很多工作)。 你们所需要的唯一真正的差别是,初始者何时或何时被召唤。 这只是申请的开始。 在网络应用方面,你确实把它从申请中称作应用。 首先,我想在WinForms中会看到:http://msdn.microsoft.com/en-us/library/86faxx0d%28v=VS100%29.aspx” rel=“nofollow”>。 主要形式为

如果在任何地方(与青少年相类似)都有<条码> 主要方法,那么这种方法也会奏效。 比如,如果WinForms用一个ole子输送,就可以做到这一点。





相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签