I am trying to call a function that is defined in a class RFIDeas_Wrapper(used by the dll). But when I checked the reader type, and after that I used it to call the function, it shows me an errorCannot convert type T to RFIDeas_Wrapper.
EDIT
private List<string> GetTagCollection<T>(T Reader)
{
TagCollection = new List<string>();
if (Reader.GetType() == typeof(RFIDeas_Wrapper))
{
((RFIDeas_Wrapper)Reader).OpenDevice();
string Tag_Id = ((RFIDeas_Wrapper)Reader).TagID();
if(Tag_Id!="0")
TagCollection.Add(Tag_Id);
}
else if (Reader.GetType() == typeof(AlienReader))
TagCollection = ((AlienReader)Reader).TagCollection;
return TagCollection;
}
((RFIDeas_Wrapper) Reader) .OpenDevice ();
((AlienReader) Reader) .TagCollection;
I want this line to run without any problems. Since Reader will always indicate type i m. How to make the compiler understand the same thing.
source
share