0

C#에서는 인터페이스를 구현할 때 필요한 값을 어떻게 작성합니까? 여기 인터페이스 NotImplementedExceptions

내 인터페이스 코드 :

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

다음 코드가 추가 내 클래스에이 인터페이스 구현 : 무슨 값을 이제 인터페이스를 구현 한 것을

#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 

을, 다음 코드를 대체합니다.

throw new NotImplementedException() 

코드가 단순한 { get; set; } 값이 되나요? 아니면 다른 것이 필요합니까? 사전에

감사

+4

만 자동 등록이 필요합니다. 따라서'{get; set;}'로 충분합니다. – Candide

+3

* * 그렇게 보일 수도 있지만 프로그램이해야 할 일만 알면 질문에 답변 할 수 있습니다. –

+1

그건 당신이하고 싶은 일에 전적으로 달려 있습니다. –

답변

0

예 그렇게 코드가 될 것입니다

{ get; set; } 

으로 대체 할 수 있습니다 : 그것은 보인다

public string type { get; set;} 
public string thumbnailDisplayText { get; set; } 
public string thumbnailImageWebAddress { get; set; } 
+0

고맙습니다. 나는 그렇게 간단 할 것이라고 생각했습니다. – user3736648