I have a bunch of properties which are common to two classes. I wanted to move those into an interface. Since these properties are both get and set, I'm not sure if I'd be allowed to set them from another class. I am implementing the interface in the class where I'd need these properties, but still I'm not being able to access these properties. My class is as follows:
public class PatchSurveyStartegy : IStrategy
{
public IEnumerable<IEnumerable<PointBase>> ReceiverGrid { get; set; }
public IEnumerable<IEnumerable<PointBase>> SourceGrid { get; set; }
public SourceParameters SourceParameters { get; set;}
public DeploymentParameters DeploymentParameters { get; set; }
public RovParameters RovParameters { get; set; }
}
So, IStrategy is the interface where I want to move all of these properties but I'm not getting access to them in this class:
internal double DeployRemainingLines()
{
return StepsForGivenLines(ReceiverGrid).Sum(step => step.CalculateStepTime());
}
I looked at these links: Interface should not have properties? and c# properties on Interface. Also, I dont want to put them in an abstract class, I want to use an interface.