public UAReturn UnLoadMultiPackage(string[] packagenames)
{
UAReturn res = new UAReturn() { Success = false };
UAReturn tmp = null; //11May2014 for temporary return value
StringBuilder sb = new StringBuilder("");
StringBuilder comm = new StringBuilder(""); //11May2014 for storing multiple commands in single place
foreach (string pkgname in packagenames)
{
tmp = UnLoadPackage(pkgname.Trim());
if (tmp != null)
{
if (tmp.CommandString != null) //11May2014
{
if (comm.Length > 1) comm.Append("\n"); // if there is already something then only add new line
comm.Append(tmp.CommandString);
}
if (tmp.Error != null && tmp.Error.Length > 1) // if there is some error msg
{
sb.Append(tmp.Error);
}
}
}
res.Success = sb.Length > 0 ? false : true;
res.Error = sb.ToString();
res.CommandString = comm.ToString();//11May2014
return res;
}