可能重复:
部分类的用途是什么?
在我的代码中,有一个用于创建新公司的部分类。我无法理解要在哪个条件下部分实施。
public partial class NewCompanyWindow : Window
{
List<Company> _companies;
public event EventHandler<CompanyAddedEventArgs> CompanyAdded;
public NewCompanyWindow()
{
InitializeComponent();
Closing += new
System.ComponentModel.CancelEventHandler(NewCompanyWindow_Closing);
}
void NewCompanyWindow_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
StartupWindow w = new StartupWindow();
w.Show();
}
public NewCompanyWindow(List<Company> companies)
: this()
{
_companies = companies;
}
private void CreateButton_Click(object sender, RoutedEventArgs e)
{..
谁能说在哪种情况下使用部分类?