public ArchiveID(GameID game, DetectedFile first_file) { this.Game = game; this.Owner = first_file.owner; this.Type = first_file.Type; DetectedLocationPathHolder loc = first_file.OriginalLocation; OriginalLocation = loc.FullDirPath; OriginalEV = loc.EV; OriginalRelativePath = loc.Path; }
public static IList <Archive> GetArchives(GameID id) { IList <Archive> archives = new List <Archive>(); foreach (Archive archive in model.Items) { if (archive.id.Game.Equals(id, true)) { archives.Add(archive); } } return(archives); }
// Pre-0.10 MASGAU didn't embed a path hash public ArchiveID(XmlElement root) { foreach (XmlElement element in root.ChildNodes) { switch (element.Name) { case "game": Game = new GameID(element); foreach (XmlAttribute attr in element.Attributes) { if (GameIdentifier.attributes.Contains(attr.Name) || attr.Name == "name") continue; throw new NotSupportedException(attr.Name); } break; case "archive": foreach (XmlAttribute attr in element.Attributes) { switch (attr.Name) { case "type": Type = attr.Value; break; default: throw new NotSupportedException(attr.Name); } } break; case "original_location": OriginalLocation = element.InnerText; break; case "original_relative_path": OriginalRelativePath = element.InnerText; break; case "original_ev": OriginalEV = ALocation.parseEnvironmentVariable(element.InnerText); break; case "owner": if (!element.HasAttribute("name")) throw new Exception("NAME MISSING FROM ARCHIVES"); Owner = element.GetAttribute("name"); break; case "original_location_hash": case "original_drive": break; default: throw new NotSupportedException(element.Name); } } }
public static Archive GetArchive(GameID id, DetectedFile file) { ArchiveID find_me = new ArchiveID(id, file); return(model.get(find_me)); }
public bool setGameSyncEnabled(GameID set_me, bool to_me) { return setSpecificNodeAttrib("game", "sync",to_me.ToString(),set_me.string_array); }
public bool setDefaultGamePath(GameID game, string path) { return setSpecificNodeAttrib("game", "default_path",path,game.string_array); }
public bool isGameSyncEnabled(GameID check_me) { return getSpecificNodeAttribute("game", "sync", check_me.string_array)==true.ToString(); }
public bool isGameBackupEnabled(GameID check_me) { return getSpecificNodeAttribute("game", "backup", check_me.string_array)!=false.ToString(); }
public string getDefaultGamePath(GameID game) { return getSpecificNodeAttribute("game", "default_path", game.string_array); }
public bool clearDefaultGamePath(GameID game) { return clearSpecificNodeAttribute("game", "default_path", game.string_array); }
public static int Compare(GameID a, GameID b) { return a.game.CompareTo(b.game); }
public static int Compare(GameID a, GameID b, bool ignore_revision) { return(a.game.CompareTo(b.game, ignore_revision)); }
public static int Compare(GameID a, GameID b) { return(a.game.CompareTo(b.game)); }
public override int CompareTo(object comparable) { GameID id = comparable as GameID; return(game.CompareTo(id.game)); }
// Pre-0.10 MASGAU didn't embed a path hash public ArchiveID(XmlElement root) { foreach (XmlElement element in root.ChildNodes) { switch (element.Name) { case "game": Game = new GameID(element); foreach (XmlAttribute attr in element.Attributes) { if (GameIdentifier.attributes.Contains(attr.Name) || attr.Name == "name") { continue; } throw new NotSupportedException(attr.Name); } break; case "archive": foreach (XmlAttribute attr in element.Attributes) { switch (attr.Name) { case "type": Type = attr.Value; break; default: throw new NotSupportedException(attr.Name); } } break; case "original_location": OriginalLocation = element.InnerText; break; case "original_relative_path": OriginalRelativePath = element.InnerText; break; case "original_ev": OriginalEV = ALocation.parseEnvironmentVariable(element.InnerText); break; case "owner": if (!element.HasAttribute("name")) { throw new Exception("NAME MISSING FROM ARCHIVES"); } Owner = element.GetAttribute("name"); break; case "original_location_hash": case "original_drive": break; default: throw new NotSupportedException(element.Name); } } }