private static void Serialize(FtProject project) { XmlSerializer serializer = new XmlSerializer(typeof(FtProject)); using (TextWriter writer = new StreamWriter(project.ProjectFilePath)) { serializer.Serialize(writer, project); } }
private static FtProject Deserialize(string filepath) { XmlSerializer deserializer = new XmlSerializer(typeof(FtProject)); TextReader reader = new StreamReader(filepath); object obj = deserializer.Deserialize(reader); FtProject project = (FtProject)obj; reader.Close(); return(project); }
public FtMap(FtProject project) : base() { this.BackColor = System.Drawing.Color.White; Init(project); project.DataChangedEventHandler += DataChangedEventHandler; ActiveVectorLayers = new Dictionary <FtTransmitterDataset, FtPuntualVectorLayer>(); ActivePolygonalVectorLayers = new Dictionary <FtTransmitterMCPDataEntry, PolygonalVectorLayer>(); PuntualLegendDecoration = new PuntualLegendDecoration(); PolygonalLegendDecoration = new PolygonalLegendDecoration(); }
private void Init(FtProject project) { foreach (var rasterLayer in project.MapConfig.RasterLayer) { if (rasterLayer.Active) { this.AddTiffLayer(Path.GetFileNameWithoutExtension(rasterLayer.FilePath), rasterLayer.FilePath); } } foreach (var vektorLayer in project.MapConfig.VektorLayer) { if (vektorLayer.Active) { this.AddShapeLayer(Path.GetFileNameWithoutExtension(vektorLayer.FilePath), vektorLayer.FilePath); } } if (Properties.Settings.Default.MapScalebarActive) { AddScaleBar(); } }
public void Save() { FtProject.Serialize(this); }