public bool TryRenameScript(string from, string to)
{
string newpath = Path.Combine(lscriptsdir, to);
try
{
File.Move(from, newpath);
}
catch
{
return false;
}
RefreshProjectTree();
LuaScriptEditPane editPane;
if (editPanes.TryGetValue(from, out editPane))
{
editPanes.Remove(from);
editPanes[newpath] = editPane;
editPane.contentDocument.Visible = false;
editPane.contentDocument.Name = to;
editPane.contentDocument.Visible = true;
}
return true;
}