Beispiel #1
0
        bool OpenFileForPath(string f, string objectId, BinaryXmlTypeMap typeMap, bool checkOnly, out object result)
        {
            result = null;

            if (!Exists(f))
            {
                return(false);
            }
            using (Stream s = OpenRead(f)) {
                BinaryXmlReader reader = new BinaryXmlReader(s, typeMap);
                reader.ReadBeginElement();
                string id = reader.ReadStringValue("id");
                if (objectId == null || objectId == id)
                {
                    if (!checkOnly)
                    {
                        result = reader.ReadValue("data");
                    }
                    return(true);
                }
            }
            return(false);
        }