Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
        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);
        }
Example #4
0
        // 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);
                }
            }
        }
Example #5
0
        public static Archive GetArchive(GameID id, DetectedFile file)
        {
            ArchiveID find_me = new ArchiveID(id, file);

            return(model.get(find_me));
        }
Example #6
0
 public bool setGameSyncEnabled(GameID set_me, bool to_me)
 {
     return setSpecificNodeAttrib("game", "sync",to_me.ToString(),set_me.string_array);
 }
Example #7
0
 public bool setDefaultGamePath(GameID game, string path)
 {
     return setSpecificNodeAttrib("game", "default_path",path,game.string_array);
 }
Example #8
0
 public bool isGameSyncEnabled(GameID check_me)
 {
     return getSpecificNodeAttribute("game", "sync", check_me.string_array)==true.ToString();
 }
Example #9
0
 public bool isGameBackupEnabled(GameID check_me)
 {
     return getSpecificNodeAttribute("game", "backup", check_me.string_array)!=false.ToString();
 }
Example #10
0
 public string getDefaultGamePath(GameID game)
 {
     return getSpecificNodeAttribute("game", "default_path", game.string_array);
 }
Example #11
0
 public bool clearDefaultGamePath(GameID game)
 {
     return clearSpecificNodeAttribute("game", "default_path", game.string_array);
 }
Example #12
0
 public static int Compare(GameID a, GameID b)
 {
     return a.game.CompareTo(b.game);
 }
Example #13
0
 public static int Compare(GameID a, GameID b, bool ignore_revision)
 {
     return(a.game.CompareTo(b.game, ignore_revision));
 }
Example #14
0
 public static int Compare(GameID a, GameID b)
 {
     return(a.game.CompareTo(b.game));
 }
Example #15
0
        public override int CompareTo(object comparable)
        {
            GameID id = comparable as GameID;

            return(game.CompareTo(id.game));
        }
Example #16
0
        // 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);
                }
            }
        }