Exemplo n.º 1
0
        public static CWFile AddFile(string filepath, CWDirectory parent)
        {
            AssertOpenProject("AddFile");

            if (parent != null)
            {
                AssertValidDirectory(parent, "AddFile__CheckParent");
            }

            if (!File.Exists(filepath))
            {
                throw new PluginException(filepath + " does not exist.", "AddFile");
            }

            CProject.File newfile = g.Main.AddExistingFile(filepath, ((parent == null) ? null : GetDir(parent)));
            return(newfile.ToCWFile());
        }