set not being called when editing a collection

  • Thread starter Thread starter Tech Aspirant
  • Start date Start date
T

Tech Aspirant

Guest
Hello,

Setter for collection property is not getting fired in my case. Below is the code for reference.

I am using default collection editor in my case. I want to run my code once setter for the property is fired.

public class ControlLineConfig
{
[XmlIgnore()]
public ControlLine line;

public ControlLineConfig()
{
line = new ControlLine();
line.Config = this;
}

[XmlArray("LinePointList")]
[XmlArrayItem("PointListItem")]
[ReadOnly(false)]
public List<PointLatLng> PointList
{
get { return line.PointList; }
set { line.PointList = value; }
}
}


public class ControlLine
{
public GISControlLineConfig Config = null;

public ControlLine(string name, Control controlref) : base(name)
{
Config = new ControlLineConfig(this);
}

public List<PointLatLng> PointList
{
get { return Points; }
set {
// My Code
}
}

}


public struct PointLatLng
{
public static readonly PointLatLng Empty = new PointLatLng();
private double lat;
private double lng;

bool NotEmpty;

public PointLatLng(double lat, double lng)
{
this.lat = lat;
this.lng = lng;
NotEmpty = true;
}

public bool IsEmpty
{
get
{
return !NotEmpty;
}
}

public double Lat
{
get
{
return this.lat;
}
set
{
this.lat = value;
NotEmpty = true;
}
}

public double Lng
{
get
{
return this.lng;
}
set
{
this.lng = value;
NotEmpty = true;
}
}

return string.Format(CultureInfo.CurrentCulture, "{{Lat={0}, Lng={1}}}", this.Lat, this.Lng);
}
}

Continue reading...
 
Back
Top