コード例 #1
0
        private void fichiers_Click(object sender, EventArgs e)
        {
            FileImport   fi = new FileImport();
            DialogResult dr = fi.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                foreach (string f in fi.FileNames)
                {
                    FileAttributes fa = System.IO.File.GetAttributes(f);
                    if (fa == FileAttributes.Directory)
                    {
                        Project.Copy(Project.CurrentProject,
                                     f,
                                     fi.DestinationPath);
                    }
                    else
                    {
                        Project.AddFile(Project.CurrentProject,
                                        fi.DestinationPath,
                                        f);
                    }
                }
                Project.Save(Project.CurrentProject, ConfigDirectories.GetDocumentsFolder(), AppDomain.CurrentDomain.GetData("fileName").ToString());
                Project.CurrentProject.ReloadProject();
            }
        }
コード例 #2
0
        private void btnBrowseImage_Click(object sender, EventArgs e)
        {
            FileImport   fi = new FileImport();
            DialogResult dr = fi.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ConfigDirectories.AddFile(Library.Project.CurrentProject.Title,
                                          Path.Combine(ConfigDirectories.GetBuildFolder(Library.Project.CurrentProject.Title),
                                                       fi.path.Text),
                                          fi.FileNames[0]);
                Library.Project.Save(Library.Project.CurrentProject, ConfigDirectories.GetDocumentsFolder(), AppDomain.CurrentDomain.GetData("fileName").ToString());
                Library.Project.CurrentProject.ReloadProject();
                this.pic.ImageLocation = fi.FileNames[0];
                int index = this.cmbFiles.Items.Add(fi.path.Text);
                this.cmbFiles.Text = fi.path.Text;
            }
        }