Exemplo n.º 1
0
        /// <summary>
        /// Creates a new workspace. Returns false if a workspace already exists
        /// </summary>
        /// <returns>If the creation was a success.</returns>
        public static bool Create()
        {
            if (Exists())
            {
                return(false);
            }

            if (DirectoryUtility.Create(WorkspaceFolderPath()))
            {
                if (!DirectoryUtility.Create(AutoGeneratedFolderPath()))
                {
                    return(false);
                }

                if (!DirectoryUtility.Create(ResourcesFolderFilePath()))
                {
                    return(false);
                }

                if (!DirectoryUtility.Create(DataFolderPath()))
                {
                    return(false);
                }

                if (!DirectoryUtility.Create(LanguageDataFolderPath()))
                {
                    return(false);
                }

                if (!GenerateCultureInfoCollection())
                {
                    return(false);
                }

                LanguageHandlerEditor.CreateRootResourceFile();

                AssetDatabase.Refresh();
                return(true);
            }

            return(false);
        }