Hi Don,
Thanks for the reply.
Here is the function for WriteSerializedShapeFileOverlay. It's all using the BinaryFormatter.
public static void WriteSerializedShapeFileOverlay(FileStream output, string version, ShapeFileFeatureLayer shapeOverlay, string overlayName)
{
BinaryFormatter formatter = new BinaryFormatter();
ShapeFeatureLayerSerializer shapeRecord = new ShapeFeatureLayerSerializer(version, shapeOverlay, overlayName);
try
{
shapeRecord.ShapeFileLayer = shapeOverlay;
shapeRecord.OverlayName = overlayName;
// write Record to FileStream ( serialize object )
formatter.Serialize(output, shapeRecord);
}
catch (SerializationException)
{
MessageBox.Show("Error Writing to File", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
// notify user if error occurs regarding parameter format
catch (FormatException)
{
MessageBox.Show("Invalid Format", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
} // end catch
}
Does this new GeoSerializer class allow me to save basic information as well (like text parameters from forms)? If not, then does that mean I have to save off a file for these data separately. I did want to avoid having to save to multiple files.
I've just downloaded the project sample called Serialize to XML and I'm having some problem. Basically, it comes up asking for a login to ap.thinkgeo.com which it rejects my normal login. Then, when it switches to offline mode it doesn't see GeoSerializer class and hence won't compile. I can't call this class from any other projects I have either. Is there a reference I'm missing??? I've loaded in all dll for 5.5.0.38, so I don't know what is going on there. I'm basically stuck until I can load it. The API doesn't have anything for GeoSerializer class and the Serializer guide does not mention anything about a separate reference.
Based on the code sample, I am guessing I could just alter the above line from:
BinaryFormatter formatter = new BinaryFormatter();
to
GeoSerializer formatter = new GeoSerializer();
Regards,
Damian