예제 #1
0
        private void ShowFolderContent(string path)
        {
            CurrentPath = path;

            RelatedFiles.Clear();

            foreach (var item in FileHelper.GetFolderContent(path))
            {
                RelatedFiles.Add(item);
            }
        }
예제 #2
0
 public void AddNewFolder(string newFolderName)
 {
     if (_editableComponent == null)
     {
         Directory.CreateDirectory($"{_currentPath}/{NewFolderName}");
         ShowFolderContent(_currentPath);
     }
     else
     {
         var index = RelatedFiles.IndexOf(_editableComponent);
         _editableComponent.Rename(newFolderName);
         RelatedFiles.Insert(index, _editableComponent);
         RelatedFiles.RemoveAt(index + 1);
         _editableComponent = null;
     }
     NewFolderName         = "";
     IsAddFilePanelVisible = false;
 }
예제 #3
0
        private void DeleteFile(object param)
        {
            var component = (IData)param;
            var message   = string.Empty;

            if (component is IFolder)
            {
                message = "Do you want to delete this folder?";
            }
            else
            {
                message = "Do you want to delete this file?";
            }

            MessageBoxResult result = MessageBox.Show(message, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                component.Delete();
                RelatedFiles.Remove(component);
            }
        }
예제 #4
0
#pragma warning disable SA1202 // Elements must be ordered by access
        public void Dispose()
#pragma warning restore SA1202 // Elements must be ordered by access
        {
            if (isDisposing)
            {
                return;
            }

            isDisposing = true;
            foreach (ModuleFile alias in LinkedAliases)
            {
                alias.Dispose();
            }

            LinkedAliases.Clear();

            foreach (FileData opened in OpenedFiles)
            {
                opened.Dispose();
            }

            OpenedFiles.Clear();

            foreach (FileData related in RelatedFiles)
            {
                related.Dispose();
            }

            RelatedFiles.Clear();

            foreach (FileData referenced in ReferencedByFileData.Values)
            {
                referenced.Dispose();
            }

            ReferencedByFileData.Clear();
        }
        /**
          <see cref="GetDependencies(PdfName)"/>
        */
        private void SetDependencies(
      PdfName key,
      RelatedFiles value
      )
        {
            PdfDictionary dependenciesObject = (PdfDictionary)BaseDictionary[PdfName.RF];
              if(dependenciesObject == null)
              {BaseDictionary[PdfName.RF] = dependenciesObject = new PdfDictionary();}

              dependenciesObject[key] = value.BaseObject;
        }
예제 #6
0
 public void AddLinkingJsonFile(JsonFileData file)
 {
     RelatedFiles.Add(file);
 }