다음을 통해 공유


방법: 추상 기본 클래스 구현

업데이트: 2007년 11월

이 절차를 사용하여 추상 기본 클래스 구현이라는 IntelliSense 작업을 수행할 수 있습니다. 자세한 내용은 추상 기본 클래스 구현을 참조하십시오.

IntelliSense를 사용하여 추상 기본 클래스를 구현하려면

  1. 콘솔 응용 프로그램을 만듭니다. 자세한 내용은 콘솔 응용 프로그램 템플릿을 참조하십시오.

  2. class Program 문 뒤에 커서를 놓습니다.

  3. 클래스 선언이 class Program : StringComparer가 되도록 : StringComparer 를 입력합니다.

  4. StringComparer 아래의 스마트 태그를 클릭하고 추상 클래스 'System.StringComparer' 구현을 클릭합니다.

    StringComparer 클래스의 세 개의 재정의 메서드가 Program 클래스로 추가됩니다.

    using System;
    using System.Collections.Generic;
    using System.Text;
    namespace ConsoleApplication1
    {
        class Program : StringComparer
        {
            static void Main(string[] args)
            {
    
                }
    
                public override int Compare(string x, string y)
                {
                    throw new Exception ("The method or operation is not implemented.");
                }
    
                public override bool Equals(string x, string y)
                {
                    throw new Exception ("The method or operation is not implemented.");
                }
                public override int GetHashCode(string obj)
                {
                    throw new Exception ("The method or operation is not implemented.");
                }
    
        }
    }
    

예제

개발 환경에서 만들어진 새 콘솔 응용 프로그램은 다음 선언으로 시작됩니다.

using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
     class Program
     {
          static void Main(string[] args)
          {
     
          }
      }
}

참고 항목

참조

추상 기본 클래스 구현

StringComparer

기타 리소스

자동 코드 생성