private string GetShortcutTarget(string target) { string targetPath = null; // This may be a Folder or File! BaseFile targetFile = mVdProject.GetFileById(target); if (targetFile == null) { targetPath = mVdProject.GetFolderPathById(target); } else { // Get file with whole path targetPath = mVdProject.GetFolderPathById(targetFile.FolderId) + "\\" + targetFile.GetName(); } // Still null? Maybe the target is ProjectOutput or other stuff switch (mVdProject.mInputProject) { case InputProject.VdProject: { if (targetFile == null || targetPath == null) { BaseOtherType otherTypeObject = mVdProject.GetOtherTypeObjectById(target); // Get whole path targetPath = mVdProject.GetFolderPathById(otherTypeObject.FolderId) + "\\" + otherTypeObject.DestName; } break; } case InputProject.IsleProject: { /*if (targetFile == null || targetPath == null) * { * BaseOtherType otherTypeObject = mVdProject.GetOtherTypeObjectById(target); * // Get whole path * targetPath = mVdProject.GetFolderPathById(otherTypeObject.FolderId) + "\\" + otherTypeObject.DestName; * }*/ break; } } // ReplaceFolderVariables() will translate [TARGETDIR] into {app} return(ReplaceFolderVariables(targetPath, 0)); }
// Search in mOtherTypeObjects public BaseOtherType GetOtherTypeObjectById(string id) { BaseOtherType result = null; if (mOtherTypeObjects == null || mOtherTypeObjects.Count == 0) { result = null; } else { for (int i = 0; i < mOtherTypeObjects.Count; i++) { if (mOtherTypeObjects[i].Id == id) { result = mOtherTypeObjects[i]; break; } } } return(result); }