Hello,
My name is Jay, I'm new here this is my first question. I am working on project and am trying to implement an interface method in the same class that inherits the interface - and I'm receiving several errors when trying to do so. I'm not sure what the proper way to implement the method is, and when searching online for this particular issue I wasn't able to locate anything. Here is the code:
Interface:
Class:
-------
Essentially, I just need to know what the syntax would be to call the PrintValues method in this class. Thank you so much for any help you can provide!!!
Best Regards,
Jay
My name is Jay, I'm new here this is my first question. I am working on project and am trying to implement an interface method in the same class that inherits the interface - and I'm receiving several errors when trying to do so. I'm not sure what the proper way to implement the method is, and when searching online for this particular issue I wasn't able to locate anything. Here is the code:
Interface:
C#:
namespace c
{
public interface IMeasuringDevice
{
string PrintValues(FixedQueue<double> myCollection);
}
}
Class:
C#:
namespace c
{
public class Measure : IMeasuringDevice
{
string IMeasuringDevice.PrintValues(FixedQueue<double> myCollection)
{
StringBuilder myString = new StringBuilder();
foreach (var i in myCollection.q)
myString.AppendLine(i.ToString());
return myString.ToString();
}
public string History => IMeasuringDevice.PrintValues(myQueue);[/ICODE] //This is where Im having the problem. Using the PrintValues method inside Measure class
}
}
public string History => IMeasuringDevice.PrintValues(myQueue);
//This is where Im having the problem. Using the PrintValues method inside the Measure class.-------
Essentially, I just need to know what the syntax would be to call the PrintValues method in this class. Thank you so much for any help you can provide!!!
Best Regards,
Jay
Last edited: