Exemplo n.º 1
0
        private void PersistDelete(BinaryReader reader, Dictionary <long, string> idNameMap)
        {
            // Resource delete
            long id           = reader.ReadInt64();
            var  resourceName = idNameMap[id];
            var  resource     = JournaledSystem.GetResource(resourceName);

            JournaledSystem.Context.OnDebug(String.Format("Jounral Command: Delete {0}", resourceName));

            resource.PersistDelete();
        }
Exemplo n.º 2
0
        private void PersistSizeChange(BinaryReader reader, Dictionary <long, string> idNameMap)
        {
            // Resource size change
            long id           = reader.ReadInt64();
            long newSize      = reader.ReadInt64();
            var  resourceName = idNameMap[id];
            var  resource     = JournaledSystem.GetResource(resourceName);

            JournaledSystem.Context.OnInformation(String.Format("Jounral Command: Set Size {0} = {1}", resourceName, newSize));

            resource.PersistSetSize(newSize);
        }
Exemplo n.º 3
0
        private void PersistPageModification(BinaryReader reader, Dictionary <long, string> idNameMap)
        {
            // Page modification
            long id   = reader.ReadInt64();
            long page = reader.ReadInt64();
            int  off  = reader.ReadInt32();
            int  len  = reader.ReadInt32();

            var resourceName = idNameMap[id];
            var resource     = JournaledSystem.GetResource(resourceName);

            JournaledSystem.Context.OnDebug(String.Format(
                                                "Jounral Command: Page Change {0} page= {1} offset = {2} length = {3}", resourceName, page, off, len));

            resource.PersistPageChange(page, off, len, reader.BaseStream);
        }
Exemplo n.º 4
0
        private void PersistTag(BinaryReader reader, Dictionary <long, string> idNameMap, List <ResourceBase> resourcesUpdated)
        {
            // Resource id tag
            long          id  = reader.ReadInt64();
            int           len = reader.ReadInt32();
            StringBuilder buf = new StringBuilder(len);

            for (int i = 0; i < len; ++i)
            {
                buf.Append(reader.ReadChar());
            }

            string resourceName = buf.ToString();

            // Put this input the map
            idNameMap[id] = resourceName;

            JournaledSystem.Context.OnDebug(String.Format("Jounral Command: Tag {0} = {1}", id, resourceName));

            // Add this to the list of resources we updated.
            resourcesUpdated.Add(JournaledSystem.GetResource(resourceName));
        }