Ejemplo n.º 1
0
        private static void Serialize(FtProject project)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(FtProject));

            using (TextWriter writer = new StreamWriter(project.ProjectFilePath))
            {
                serializer.Serialize(writer, project);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
 public void Save()
 {
     FtProject.Serialize(this);
 }