我正在根据CRM系统的动态物体在VS2010年制作实体包裹。 除了实体法之外,我还要加上所有实体继承的实体基础。 如果项目前有档案,则不应添加。 我正在利用伊瓦希德执行,向发电机提供标名等。
在IWizard执行中,如果项目从前存在,是否可以确定是否增列一个项目? 我如何在“是否应当”项目方法中或之前处理项目及其项目?
我的法典(尚未完成):
public class EntityWizardImplementation : IWizard
{
public void BeforeOpeningFile(ProjectItem projectItem)
{
//Note: Nothing here.
}
public void ProjectFinishedGenerating(Project project)
{
//Note: Nothing here.
}
public void ProjectItemFinishedGenerating(ProjectItem projectItem)
{
//Note: Nothing here.
}
public void RunFinished()
{
//Note: Nothing here.
}
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
try
{
var window = new WizardWindow();
// Replace parameters gathered from the wizard
replacementsDictionary.Add("$crmEntity$", window.CrmEntity);
replacementsDictionary.Add("$crmOrganization$", window.CrmOrganization);
replacementsDictionary.Add("$crmMetadataServiceUrl$", window.CrmMetadataUrl);
window.Close();
}
catch (SoapException se)
{
MessageBox.Show(se.ToString());
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
public bool ShouldAddProjectItem(string filePath)
{
// This is where I assume it is correct to handle the preexisting file.
return true;
}
}