2 using System.Collections.Generic;
 
    4 using Seci.Definitions;
 
    6 namespace Seci.Managers
 
   16         private static SerialisableList<AssociatedFile> _associatedFiles = 
new SerialisableList<AssociatedFile>();
 
   18         internal static SerialisableList<AssociatedFile> AssociatedFiles { 
get { 
return _associatedFiles; } }
 
   20         #region Associated Files 
   31                 _associatedFiles.Add(file);
 
   40         public static void AddFile(String fileName)
 
   44             if (!IsDuplicate(fileName))
 
   46                 _associatedFiles.Add(file);
 
   69                     file.RestoreOriginal();
 
   82             for (
int i = 0; i < _associatedFiles.Count; ++i)
 
   84                 if (_associatedFiles[i].FileLocation.ToLower() == fileName.ToLower())
 
  101             for (
int i = 0; i < _associatedFiles.Count; ++i)
 
  103                 if (_associatedFiles[i].FileLocation == fileName)
 
  105                     _associatedFiles.RemoveAt(i);
 
  119             for (
int i = 0; i < _associatedFiles.Count; ++i)
 
  122                 if (_associatedFiles[i].FileLocation.ToLower().EndsWith(
".tpar") || _associatedFiles[i].FileLocation.ToLower().EndsWith(
".mpar"))
 
  127                 if (String.IsNullOrEmpty(_associatedFiles[i].OwningComponent) && _associatedFiles[i].HasBeenModified())
 
  142             for (
int i = 0; i < _associatedFiles.Count; ++i)
 
  145                 if (_associatedFiles[i].FileLocation.ToLower().EndsWith(
".tpar") || _associatedFiles[i].FileLocation.ToLower().EndsWith(
".mpar"))
 
  147                     if (String.IsNullOrEmpty(_associatedFiles[i].OwningComponent) && _associatedFiles[i].HasBeenModified())
 
  165             List<String> files = 
new List<String>();
 
  167             if (_associatedFiles != null)
 
  169                 for (
int i = 0; i < _associatedFiles.Count; ++i)
 
  171                     if (includeComps || String.IsNullOrEmpty(_associatedFiles[i].OwningComponent))
 
  173                         files.Add(_associatedFiles[i].FileLocation);
 
  186             List<String> files = 
new List<String>();
 
  188             if (_associatedFiles != null)
 
  190                 for (
int i = 0; i < _associatedFiles.Count; ++i)
 
  192                     if (!String.IsNullOrEmpty(_associatedFiles[i].OwningComponent))
 
  194                         files.Add(_associatedFiles[i].FileLocation);
 
static List< String > GetListOfAsscFiles(Boolean includeComps)
Gets a list of all the associated files in a configuration. Including any associated files in the com...
static void RestoreFile(String fileName)
Restores the file to the original version that came from the configuration. 
static Boolean RemoveFile(String fileName)
Remove a specfied associated file from the collection. 
static Boolean AnyModificationsToParFiles()
Indicates whether any of the tpar or mpar files have been modified 
static List< String > GetListOfComponentAsscFiles()
Gets a list of the associated files in components. 
static Boolean AnyModifications()
Indicates whether any of the associated files has been modified. 
static Boolean IsDuplicate(String fileName)
Checks that the file is not already saved in the configuration. 
static void AddFile(String fileName)
Add an associated file to the collection(i.e. ini files). The file is read and saved as bytes inside ...
This class is used for storing files as part of a configuration. Typically, the files stored are ini ...
The manager class for associated files.