Beispiel #1
0
        private static bool TryGetPreserializedData(ResourceWriter resourceWriter, string resourceName, out byte[] preserializedData)
        {
            IDictionary resourcesHashtable = (IDictionary)resourceWriter.GetFieldValue("_preserializedData");

            if (resourcesHashtable == null || !resourcesHashtable.Contains(resourceName))
            {
                preserializedData = null;
                return(false);
            }

            object precannedResource = resourcesHashtable[resourceName];

            preserializedData = precannedResource.GetFieldValue("Data") as byte[];

            return(true);
        }
Beispiel #2
0
        private static void SetPreserializedData(ResourceWriter resourceWriter, string resourceName, byte[] data)
        {
            IDictionary resourcesHashtable = (IDictionary)resourceWriter.GetFieldValue("_preserializedData");

            resourcesHashtable[resourceName].SetFieldValue("Data", data);
        }