Ejemplo n.º 1
0
 public void LegendTextIsNotChangedWhenDataSetIsNotRealFile()
 {
     const string legendText = "Custom Legend Text";
     var target = new ImageLayer { LegendText = legendText };
     Assert.AreEqual(legendText, target.LegendText);
     var imageData = new ImageData {Filename = ""};
     target.DataSet = imageData; // assign dataset
     // Legend should be same
     Assert.AreEqual(legendText, target.LegendText);
 }
Ejemplo n.º 2
0
 public void LegendTextIsEqualsToFileNameWhenDataSetIsRealFile()
 {
     var target = new ImageLayer();
     Assert.IsNull(target.LegendText);
     var imageData = new ImageData
     {
         Filename = Path.GetTempFileName(),
     };
     target.DataSet = imageData;
     // Legend should be equals to filename
     Assert.AreEqual(Path.GetFileName(imageData.Filename), target.LegendText);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new instance of a MapRasterLayer and the specified image data to use for rendering it.
 /// </summary>
 public MapRasterLayer(IRaster baseRaster, ImageData baseImage)
     : base(baseRaster)
 {
     base.LegendText = Path.GetFileNameWithoutExtension(baseRaster.Filename);
     BitmapGetter = baseImage;
 }