public BuildToolAssociation GetBuildToolAssocationAndNameFor(string fileName, out bool userCancelled, out string rfsName, out string extraCommandLineArguments)
{
userCancelled = false;
rfsName = null;
BuildToolAssociation buildToolAssociation = null;
string sourceExtension = FileManager.GetExtension(fileName);
List<BuildToolAssociation> btaList = new List<BuildToolAssociation>();
foreach (BuildToolAssociation bta in BuildToolAssociationManager.Self.ProjectSpecificBuildTools.BuildToolList)
{
if (bta.SourceFileType != null && bta.SourceFileType.ToLower() == sourceExtension.ToLower())
{
btaList.Add(bta);
}
}
NewFileWindow nfw = new NewFileWindow();
nfw.ComboBoxMessage = "Which builder would you like to use for this file?";
int commandLineArgumentsId = nfw.AddTextBox("Enter extra command line arguments:");
foreach (BuildToolAssociation bta in btaList)
{
nfw.AddOption(bta);
}
if (btaList.Count != 0)
{
nfw.SelectedItem = btaList[0];
}
nfw.ResultName = FileManager.RemoveExtension(FileManager.RemovePath(fileName));
//DialogResult result = cbmb.ShowDialog();
DialogResult result = nfw.ShowDialog();
extraCommandLineArguments = "";
if (result == DialogResult.OK)
{
buildToolAssociation = nfw.SelectedItem as BuildToolAssociation;
rfsName = nfw.ResultName;
extraCommandLineArguments = nfw.GetValueFromId(commandLineArgumentsId);
}
else
{
userCancelled = true;
}
return buildToolAssociation;
}