Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to add private use only methods to a class that implements a certain interface?
    primarykey
    data
    text
    <p>I am working on an automation platform that is using Google Protocol buffers, the C# implementation of the protocol service inherits from a generated base class.</p> <p>Each service represents a portion of the page and the actions that can be taken on that page, with this there are going to be several services that represent similar actions, ie any section that is a tab based interface.</p> <p>Within the implementation of one of the services I have some utility code that handles navigating between the tabs, and waiting for the tab to be loaded.</p> <p>What I would like to do is add an interface (possibly an empty interface) to the implementation and for any class that inherits that interface have the utility code accessible.</p> <p>Some code to illustrate the configuration of what I'm looking for, the code is not an exact implementation only a super simplified version to get the point across:</p> <pre><code>public class TabWindowServiceImpl : AbstractTabWindowService, ITabNavigation { public ActionResult NavigateToTab1() { return TryNavigateToTab("tab1"); } public ActionResult NavigateToTab2() { return TryNavigateToTab("tab2"); } } public interface ITabNavigation {} // This is an example of a function I would like to add to the ITabNavigation Interface public ActionResult TryNavigateToTab(string tabId, string tabLoadedElementId) { try { //Driver is a static singelton Driver.FindElement(tabId).Click(); Driver.WaitUntilPresent(tabLoadedElementId); } catch (Exception ex) { return new FailureActionResult(ex.Message); } } </code></pre> <p>Just final note, the TryNavigateToTab method ideally should not be publicly available on the TabWindowServiceImpl, only privately.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload