Ejemplo n.º 1
0
        public bool CopyFile(bool editImmediately = false)
        {
            try
            {
                string copyResult = CopyHelper.SafeFileDuplicate(fullFilePath);

                if (copyResult.Length > 0)
                {
                    //Debug.Log("Successful copy: [" + copyResult + "]\n");

                    //Ask PackageViewer to create a representation of that file.
                    LibraryManager.Inst.Selection.CreateRepresentations(copyResult);
                    LibraryManager.Inst.Selection.SortElements();

                    if (editImmediately)
                    {
                        //If we want to edit it immediately, open it.
                        OpenFile(copyResult);
                    }
                }
            }

            catch (Exception e)
            {
                Debug.LogError("Failure to duplicate file \n\t[" + fullFilePath + "]\n" + e.Message);
                return(false);
            }

            return(true);
        }