NotImplementedException 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
요청한 메서드 또는 연산이 구현되지 않을 때 throw되는 예외입니다.
public ref class NotImplementedException : Exception
public ref class NotImplementedException : SystemException
public class NotImplementedException : Exception
public class NotImplementedException : SystemException
[System.Serializable]
public class NotImplementedException : SystemException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class NotImplementedException : SystemException
type NotImplementedException = class
inherit Exception
type NotImplementedException = class
inherit SystemException
[<System.Serializable>]
type NotImplementedException = class
inherit SystemException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type NotImplementedException = class
inherit SystemException
Public Class NotImplementedException
Inherits Exception
Public Class NotImplementedException
Inherits SystemException
- 상속
- 상속
- 특성
예제
다음 예제에서는 개발되지 않은 메서드에 대해 이 예외를 throw합니다.
static void Main(string[] args)
{
try
{
FutureFeature();
}
catch (NotImplementedException notImp)
{
Console.WriteLine(notImp.Message);
}
}
static void FutureFeature()
{
// Not developed yet.
throw new NotImplementedException();
}
open System
let futureFeature () =
// Not developed yet.
raise (NotImplementedException())
[<EntryPoint>]
let main _ =
try
futureFeature ()
with :? NotImplementedException as notImp ->
printfn $"{notImp.Message}"
0
Sub Main()
Try
FutureFeature()
Catch NotImp As NotImplementedException
Console.WriteLine(NotImp.Message)
End Try
End Sub
Sub FutureFeature()
' not developed yet.
Throw New NotImplementedException()
End Sub
설명
NotImplementedException 특정 메서드, get 접근자 또는 set 접근자가 형식의 멤버로 있지만 구현되지 않은 경우 예외가 throw됩니다.
NotImplementedException 기본값을 사용 하 여 Object.Equals 구현을 참조 일치를 지원 합니다. 인스턴스 NotImplementedException의 초기 값 목록은 생성자를 참조 NotImplementedException 하세요.
예외 throw
해당 멤버가 NotImplementedException 아직 개발 중이고 나중에 프로덕션 코드에서만 구현될 때 고유한 형식의 속성 또는 메서드에서 예외를 throw하도록 선택할 수 있습니다. 즉, 예외는 NotImplementedException "아직 개발 중"과 동의어여야 합니다.
예외 처리
예외는 NotImplementedException 호출하려는 메서드 또는 속성에 구현이 없으므로 기능을 제공하지 않음을 나타냅니다. 따라서 블록에서 try/catch
이 오류를 처리해서는 안 됩니다. 대신 코드에서 멤버 호출을 제거해야 합니다. 라이브러리의 프로덕션 버전에서 구현될 때 멤버에 대한 호출을 포함할 수 있습니다.
경우에 따라 NotImplementedException 사전 프로덕션 라이브러리에서 아직 개발 중인 기능을 나타내기 위해 예외를 사용하지 않을 수 있습니다. 그러나 이는 여전히 기능을 사용할 수 없음을 나타내며 코드에서 멤버 호출을 제거해야 합니다.
NotImplementedException 및 기타 예외 형식
.NET Framework 다른 두 가지 예외 형식도 포함하며 PlatformNotSupportedException형식 NotSupportedException 의 특정 멤버에 대한 구현이 없음을 나타냅니다. 다음 조건에서 예외 대신 NotImplementedException 이러한 항목 중 하나를 throw해야 합니다.
PlatformNotSupportedException 예외
일부 플랫폼 또는 일부 버전에서는 사용할 수 없지만 다른 버전에서는 사용할 수 없는 하나 이상의 멤버를 사용하여 형식을 디자인한 경우 기능이 지원되지 않는 플랫폼에서 이 예외를 throw할 수 있습니다.
NotSupportedException 예외
NotSupportedException 인터페이스 멤버 또는 추상 기본 클래스 메서드에 대한 재정의를 구현할 수 없는 경우 예외를 throw합니다. 예를 들어 Convert.ToInt32(DateTime) 날짜와 시간과 32비트 부백된 정수 간에 의미 있는 변환이 없으므로 메서드는 예외를 throw NotSupportedException 합니다. 클래스가 인터페이스를 구현하기 때문에 이 경우 메서드가 Convert IConvertible 있어야 합니다.
추상 기본 클래스를 NotSupportedException 구현한 경우 예외를 throw하고 파생 클래스에서 재정의해야 하는 새 멤버를 추가해야 합니다. 이 경우 멤버를 추상화하면 기존 서브클래스가 로드되지 않습니다.
생성자
NotImplementedException() |
기본 속성을 사용하여 NotImplementedException 클래스의 새 인스턴스를 초기화합니다. |
NotImplementedException(SerializationInfo, StreamingContext) |
serialize된 데이터를 사용하여 NotImplementedException 클래스의 새 인스턴스를 초기화합니다. |
NotImplementedException(String) |
지정된 오류 메시지를 사용하여 NotImplementedException 클래스의 새 인스턴스를 초기화합니다. |
NotImplementedException(String, Exception) |
지정된 오류 메시지와 해당 예외의 원인인 내부 예외에 대한 참조를 사용하여 NotImplementedException 클래스의 새 인스턴스를 초기화합니다. |
속성
Data |
예외에 대한 사용자 정의 정보를 추가로 제공하는 키/값 쌍 컬렉션을 가져옵니다. (다음에서 상속됨 Exception) |
HelpLink |
이 예외와 연결된 도움말 파일에 대한 링크를 가져오거나 설정합니다. (다음에서 상속됨 Exception) |
HResult |
특정 예외에 할당된 코드화된 숫자 값인 HRESULT를 가져오거나 설정합니다. (다음에서 상속됨 Exception) |
InnerException |
현재 예외를 발생시킨 Exception 인스턴스를 가져옵니다. (다음에서 상속됨 Exception) |
Message |
현재 예외를 설명하는 메시지를 가져옵니다. (다음에서 상속됨 Exception) |
Source |
오류를 발생시키는 애플리케이션 또는 개체의 이름을 가져오거나 설정합니다. (다음에서 상속됨 Exception) |
StackTrace |
호출 스택의 직접 실행 프레임 문자열 표현을 가져옵니다. (다음에서 상속됨 Exception) |
TargetSite |
현재 예외를 throw하는 메서드를 가져옵니다. (다음에서 상속됨 Exception) |
메서드
Equals(Object) |
지정된 개체가 현재 개체와 같은지 확인합니다. (다음에서 상속됨 Object) |
GetBaseException() |
파생 클래스에서 재정의된 경우 하나 이상의 후속 예외의 근본 원인이 되는 Exception 을 반환합니다. (다음에서 상속됨 Exception) |
GetHashCode() |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
GetObjectData(SerializationInfo, StreamingContext) |
파생 클래스에서 재정의된 경우 예외에 관한 정보를 SerializationInfo 에 설정합니다. (다음에서 상속됨 Exception) |
GetType() |
현재 인스턴스의 런타임 형식을 가져옵니다. (다음에서 상속됨 Exception) |
MemberwiseClone() |
현재 Object의 단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
ToString() |
현재 예외에 대한 문자열 표현을 만들고 반환합니다. (다음에서 상속됨 Exception) |
이벤트
SerializeObjectState |
사용되지 않습니다.
예외에 대한 serialize된 데이터가 들어 있는 예외 상태 개체가 만들어지도록 예외가 serialize될 때 발생합니다. (다음에서 상속됨 Exception) |