반응형
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection; 

// 인터페이스 , 추상클래스 , 델리게이트,  이벤트, 어트리뷰 !! 

namespace 인덱서
{
    // 배열 !! 
    // --> 인덱스 --> []연산자를 이용해서 각각의 요소에 접근 !! 
    // 인덱스를 사용할수 있게 해주는것 !! 
    // []연산자를 오버로딩 !!    
    // C#에서는 [] 연산자를 통해 값에 접근 할수 있는 방법을 제공 !! 

    class MyArray
    {
        private int[] buf = new int[10];
        // 인덱서 !!
        public int this[int index]
        {
            get
            {
                return buf[index];
            }
            set
            {
                buf[index] = value;
            }
        }
        public int this[string str]
        {
            get { return this.buf[int.Parse(str)]; }
            set { this.buf[int.Parse(str)] = value; }
        }


    }

    class Program
    {
        static void Main(string[] args)
        {
            //1. 윈폼 트리 컨트롤로 구현하것 !
            //2. 똑같이 구현할것 !! 
            //3. C# 클래스 안에 들어갈수 있는 모든 것들에 대한 타입정보 !! 
            Assembly asm = Assembly.LoadFile(@"C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll");
            Console.WriteLine(@"C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll");
             Module [] modules =    asm.GetModules();
             foreach (Module module in modules)
             {
                   Console.WriteLine( "      "  + module.ToString());
                   Type[] type = module.GetTypes();
                   foreach (Type item in type)
                   {
                       Console.WriteLine( "            " + item.ToString());
                         MethodInfo [] mi =  item.GetMethods();
         
                         foreach (MethodInfo i in mi)
                         {
                             if( i.IsStatic ) 

                             Console.WriteLine("                 " + i.ToString());
                         }
                   }
             }
        }
    }
}

'C#' 카테고리의 다른 글

[C#] 추상클래스  (0) 2014.11.18
[C#] 인터페이스  (0) 2014.11.18
[C#] 이벤트  (0) 2014.11.18
[C#] 예외처리  (0) 2014.11.18
[C#] 생성자  (0) 2014.11.18

+ Recent posts