Пример #1
0
        public static FileInfoCollection FromXml(XDocument xmlGame)
        {
            var collection = new FileInfoCollection();
            XElement files = xmlGame.Root.Element("Files");

            foreach (XElement fileInfo in files.Elements("FileInfo")) {
                var info = new FileInfo();
                info.Path = fileInfo.Element("Path").Value;
                info.Type = fileInfo.Element("Type").Value;
                info.Parameters = fileInfo.Element("Parameters");
                fileInfo.Elements("DependsOn")
                    .InDocumentOrder()
                    .All(d => { info.AddDependency(d.Value); return true; });
                collection.AddFileInfo(info);
            }

            return collection;
        }
Пример #2
0
 private FileManager(FileContainer root, FileInfoCollection infoCollection)
 {
     this.Root = root;
     this.InfoCollection = infoCollection;
     InitializeAddins();
 }
Пример #3
0
 public static void Initialize(FileContainer rootDir, FileInfoCollection infoCollection)
 {
     Instance = new FileManager(rootDir, infoCollection);
 }