AGS.Plugin.Lua.LuaForAGSEditorComponent.TryRenameScript C# (CSharp) Метод

TryRenameScript() публичный Метод

public TryRenameScript ( string from, string to ) : bool
from string
to string
Результат bool
        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;
        }