コード例 #1
0
        /// <summary>
        /// 指定したファイルを閉じます。
        /// deleteHistoryにtrueを指定した場合、履歴情報も同時に削除します。
        /// </summary>
        /// <param name="file"></param>
        /// <param name="deleteHistory"></param>
        public void CloseFile(OfficeFile file, bool deleteHistory = false)
        {
            string filename = file?.FileName ?? "";

            //OfficeFile file = this.m_Project.ExcelFiles.FirstOrDefault(x => x.FileName == filename);
            if (file != null)
            {
                this.ExcelFiles.Remove(file);

                //Closeメソッドを呼び出し、テンポラリフォルダを削除する
                file.Close(deleteHistory);

                //イベント発生
                this.OnFileClosed(new EventArgs <OfficeFile>(file));
            }
        }
コード例 #2
0
 //Configの更新
 private void OnReflectConfig(XmlConfigModel config)
 {
     //LibraryFolders
     config.AddXmlContentsItem("LibraryExplorer.project:Project.LibraryFolders.Count", this.m_Libraries.Count);
     for (int i = 0; i < this.m_Libraries.Count; i++)
     {
         config.AddXmlContentsItem($"LibraryExplorer.project:Project.LibraryFolders.Folders.{i + 1}", this.m_Libraries[i].TargetFolder);
     }
     //OfficeFiels
     config.AddXmlContentsItem("LibraryExplorer.project:Project.OfficeFiles.Count", this.m_ExcelFiles.Count);
     for (int i = 0; i < this.m_ExcelFiles.Count; i++)
     {
         OfficeFile file = this.m_ExcelFiles[i];
         config.AddXmlContentsItem($"LibraryExplorer.project:Project.OfficeFiles.{i + 1}.Path", file.FileName);
         config.AddXmlContentsItem($"LibraryExplorer.project:Project.OfficeFiles.{i + 1}.ExportPath", file.WorkspaceFolder.Path);
         config.AddXmlContentsItem($"LibraryExplorer.project:Project.OfficeFiles.{i + 1}.ExportDate", file.ExportDate?.ToString() ?? "");
         config.AddXmlContentsItem($"LibraryExplorer.project:Project.OfficeFiles.{i + 1}.BackupCount", file.BackupPathList.Count);
         for (int j = 0; j < file.BackupPathList.Count; j++)
         {
             config.AddXmlContentsItem($"LibraryExplorer.project:Project.OfficeFiles.{i + 1}.Backup.{j + 1}", file.BackupPathList[j]);
         }
     }
 }