コード例 #1
0
        FileInfo[] GetFilesFromBaseFiles(FileMapCollection basefiles)
        {
            List <FileInfo> retVal = new List <FileInfo>();

            foreach (FileMap m in basefiles)
            {
                if (m.Source.Contains("*") || m.Source.Contains("?"))
                {
                    //more than one file, wildcarded.
                    string sourceFle = m.Source;

                    int i = sourceFle.LastIndexOf('\\');
                    if (i >= 0)
                    {
                        sourceFle = sourceFle.Substring(0, i);
                    }
                    string filePath = Path.Combine(InstalledPath, sourceFle);
                    if (Directory.Exists(filePath))
                    {
                        retVal.AddRange(new DirectoryInfo(filePath).GetFiles("*.*", SearchOption.AllDirectories));
                    }
                    else
                    {
                        Locations.MessageBoxShow(
                            string.Format("MOD Definition is INCORRECT.\r\nPath \"{0}\" was NOT FOUND in MOD package.", filePath),
                            MessageBoxButton.OK, MessageBoxImage.Hand);
                    }
                }
                else
                {
                    string src = Path.Combine(InstalledPath, m.Source);
                    retVal.Add(new FileInfo(src));
                }
            }
            return(retVal.ToArray());
        }
コード例 #2
0
 public FileGroup()
 {
     Files = new FileMapCollection();
     Files.ObjectChanged += new EventHandler(Files_ObjectChanged);
 }