Error: Does not implement interface member

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmccar
    New Member
    • Sep 2011
    • 7

    Error: Does not implement interface member

    Code:
    namespace HelloWorld
        
    {
       public class VaultFormsCmdExt : IExtension
        
       {
           public MyCustomTabControl tabControl;
    
           public static PropInst[] fileProperties = new PropInst[] { null };
    
            public static PropDef[] propDefs = new PropDef[] { null };
    
            public static File selectedFile = null;



    I am getting this message when trying to build the solution:

    "<filename> does not implement interface member ......IExtensio n.OnLogOff"


    What might be causing this error?
    Last edited by Frinavale; Oct 12 '11, 05:47 PM. Reason: Added code tags. Please post code in code tags.
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    It means exactly what it says :) You're inheriting from the interface IExtension, which defines a method called OnLogOff. The code you posted doesn't show you implementing this method. I don't now what the signature for IExtension.OnLo gOff is because you didn't post the code for it, but generally an interface works like this...

    Code:
    public interface IAnInterface
    {
      void SomeMethod();
    }
    
    public class SomeClass : IAnInterface
    {
      #region IAnInterface Implementation
      public void SomeMethod()
      {
        // Do something...
      }
      #endregion
    
      // The rest of your class here
    }
    If a method is defined in an interface and a class implements that interface, the class must implement that item.

    Comment

    • tmccar
      New Member
      • Sep 2011
      • 7

      #3
      Thanks Gary, that explains it

      Comment

      Working...