0

In C#, how do I fill out the required values when implementing an interface.

Here is my interface code:

public interface IGridViewWithImageAndTextItem
{
    string type { get; set;}
    string thumbnailDisplayText { get; set; }
    string thumbnailImageWebAddress { get; set; }
}

When implementing this interface into a class of mine the following code is added:

#region IGridViewWithImageAndTextItem implementation
public string type {
    get {
        throw new NotImplementedException ();
    }
    set {
        throw new NotImplementedException ();
    }
}
public string thumbnailDisplayText {
    get {
        throw new NotImplementedException ();
    }
    set {
        throw new NotImplementedException ();
    }
}
public string thumbnailImageWebAddress {
    get {
        throw new NotImplementedException ();
    }
    set {
        throw new NotImplementedException ();
    }
}
#endregion

Now that I have implemented the interface, what values do I substitute for the following code occurrences:

throw new NotImplementedException ()

Do I change the code to be simple { get; set; } values, or does something else need to be done?

Thanks in advance

jww
  • 97,681
  • 90
  • 411
  • 885
Simon
  • 7,991
  • 21
  • 83
  • 163

1 Answers1

0

yes you can replace them by

{ get; set; }

so your code will be:

public string type { get; set;}
public string thumbnailDisplayText { get; set; }
public string thumbnailImageWebAddress { get; set; }
Ali Baghdadi
  • 648
  • 1
  • 5
  • 17