I have defined two properties "Name" and "ID" for an object which I use for the DisplayMember and ValueMember of a ComboBox with a BindingList datasource.
I recently installed Resharper to evaluate it. Resharper is giving me warnings on the object that the two properties are unused.
Sample code:
BindingList<ClassSample> SampleList = new BindingList<ClassSample>();
// populate SampleList
cmbSampleSelector.DisplayMember = "Name";
cmdSampleSelector.ValueMember = "ID";
cmbSampleSelector.DataSource = SampleList;
private class ClassSample
{
private string _name;
private string _id;
public string Name // Resharper believes this property is unused
{
get { return _name; }
}
public string ID // Resharper believes this property is unused
{
get {return _id; }
}
public ClassSample(string Name, string ID)
{
_name = Name;
_id = ID;
}
}
Am I doing something wrong or is Resharper clueless about this particular usage?