private static String GetKey(Mode mode, BinaryReader rdr, out Mode newMode) { newMode = mode; // these strings are null-terminated String retval = rdr.ReadSZString(); if (mode == Mode.StringFileInfoOrVarFileInfo) { if (retval == "StringFileInfo") { newMode = Mode.StringFileInfo; } else if (retval == "VarFileInfo") { newMode = Mode.VarFileInfo; } else { throw new ResourceDataException("Invalid Key Name"); } } return(retval); }
private static Mode GetNextMode(Mode mode) { switch (mode) { case Mode.Root: return(Mode.StringFileInfoOrVarFileInfo); case Mode.StringFileInfo: return(Mode.StringTable); case Mode.StringTable: return(Mode.String); case Mode.String: return(Mode.None); case Mode.VarFileInfo: return(Mode.Var); case Mode.Var: return(Mode.None); default: throw new ResourceDataException("GetNextMode, invalid mode"); } }
public override String ToString() { String ret = Mode.ToString() + " - " + Key; if (Value != null) { ret += " : " + Value.ToString(); } return(ret); }
private VersionItem GetFirstItem(VersionItem parent, Mode mode) { if (parent.Mode == mode) { return(parent); } foreach (VersionItem item in parent.Children) { if (item.Mode == mode) { return(item); } VersionItem match = GetFirstItem(item, mode); if (match != null) { return(match); } } return(null); }