오늘은 알로 먹는 포스팅을 하나 올리겠습니다.
뭐 워낙 간단한 거라고 할 수 있지만 한번 알면 사랑에 빠져버릴만한 단축키입니다.
바로 using 자동 참조를 실행해주는 단축키입니다.
아래는 WPF 프로젝트를 생성하면 자동으로 생성되는 코드입니다.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApplication6 { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); } } } |
여기서 using 절을 다 제거하고 나면 Window를 찾을수 없다는 에러가 발생합니다.
namespace WpfApplication6 { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); } } }
//아래는 발생되는 에러 메세지 입니다. Error 1 The type or namespace name 'Window' could not be found (are you missing a using directive or an assembly reference?) H:\연습실\temp\WpfApplication6\Window1.xaml.cs 6 36 WpfApplication6 |
이런 경우에 여태까지 Window를 사용할 수 있는 using 문을 찾기 위해 msdn에 들어가야 했지만 단축키만 알고 있다면 아주 쉽게 해결할 수 있습니다.
에러가 난 클래스에 커서를 놓은 후 단축키 [Shift + Alt + F10] 을 누르면 아래와 같이 친절한 Popup이 제공됩니다.
물론 클릭을 하면 자동으로 using 절이 추가됩니다. ㅋㅋ

너무 아름답지 않습니까.
제가 항상 있으면 좋겠는데 하던 기능입니다. ^^
이젠 더이상 using 문을 외울 필요가 없어졌습니다. 만쉐이!!!