我正在开发3层解决方案:
UI引用业务,业务引用存储.
业务层包含一个类"控制器",它将驱动层之间的交互.
控制器类从UI中的main()启动.控制器轮流从业务类启动实例
但是,启动的对象在控制器类中不可用.我们做错了什么?
/* UI: Program.cs */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Business;
namespace UI
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Business.Controller instController = new Business.Controller();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new UI());
}
}
Run Code Online (Sandbox Code Playgroud)
Business.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Storage;
namespace Business
{
public class Business
{ …Run Code Online (Sandbox Code Playgroud) c# ×1