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); }
private static void SetPreserializedData(ResourceWriter resourceWriter, string resourceName, byte[] data) { IDictionary resourcesHashtable = (IDictionary)resourceWriter.GetFieldValue("_preserializedData"); resourcesHashtable[resourceName].SetFieldValue("Data", data); }