コード例 #1
0
ファイル: DBHelper.cs プロジェクト: rgiot/phactory
        static private void RenameResourceRecursive(PhactoryHost.Database.Resource resource, string previousName, string newName)
        {
            List <PhactoryHost.Database.Resource> outputResources = GetOutputResources(resource);

            foreach (PhactoryHost.Database.Resource outputResource in outputResources)
            {
                outputResource.DisplayName  = outputResource.DisplayName.Replace(previousName, newName);
                outputResource.RelativePath = outputResource.RelativePath.Replace(previousName, newName);

                FileInfo fileInfo = new FileInfo(newName);
                PhactoryHost.EditorPlugin editor = App.Controller.PluginManager.GetEditor(fileInfo.Extension);
                if (editor != null)
                {
                    editor.CreateEmptyResource(outputResource);
                }

                RenameResourceRecursive(outputResource, previousName, newName);
            }
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: rgiot/phactory
        public void CreateNewResource(PhactoryHost.Database.Resource resource)
        {
            string extension = Helper.StringHelper.GetFileInfo(resource).Extension;

            PhactoryHost.EditorPlugin editor = pluginManager.GetEditor(extension);
            if (editor != null)
            {
                editor.CreateEmptyResource(resource);
            }

            PhactoryHost.CompilerPlugin compiler = pluginManager.GetCompiler(extension);
            if (compiler != null)
            {
                resource.IsIncludeResource = compiler.IsIncludeResource(resource);

                compiler.RefreshOutput(resource);
            }

            InsertFileMostRecentUsed(Helper.StringHelper.GetFileInfo(resource).FullName);
        }