Menu

Syn Script - Project.Files.Add()

Help
simplix
2005-06-03
2013-04-17
  • simplix

    simplix - 2005-06-03

    Syn-Version: 2.1.0.46

    I am working on a Syn plugin and I would like to use the mehtod Project.Files.Add() to add files to a project.

    My problem is: The new file appears in the project-options on the "files" tab but it does not appear in the workspace as
    a subitem of the project node.

    What is wrong?

     
    • Danail Traichev

      Danail Traichev - 2005-06-04

      The problem is, that Project.Files is designed only to give users *read* access to project files. Code for updating syn interface (and even project file) is not implemented. However, I have changed the latest CVS to allow adding a file to project using following code:

              var projname = Project.FileName;
          Project.Files.Add(SomeFileName);
          Project.Close(false);
          Project.Open(false, projname);

      Project.Close and Project.Open is a workaround to make  that change visible in the interface too. If you want, I can compile one syn.exe with that and send it to you by email.

      Regards,
      Danail

       

Log in to post a comment.