Ejemplo n.º 1
0
        private void OnClickOk(object sender, RoutedEventArgs e)
        {
            int selectedIndex = lboProjectType.SelectedIndex;

            if (selectedIndex == -1)
            {
                return;
            }

            //Windows Forms App
            if (selectedIndex == 0)
            {
                string projectName = tboProjectName.Text;
                string projectPath = tboProjectPath.Text;

                if (string.IsNullOrWhiteSpace(projectName) || string.IsNullOrWhiteSpace(projectPath))
                {
                    System.Windows.MessageBox.Show("프로젝트 이름 또는 경로를 입력해주세요.");
                    return;
                }
                else if (!System.IO.Directory.Exists(projectPath))
                {
                    System.Windows.MessageBox.Show("유효하지 않은 경로입니다.");
                    return;
                }
                else if (int.TryParse(projectName.Substring(0, 1), out int result))
                {
                    System.Windows.MessageBox.Show("파일의 이름은 숫자로 시작할 수 없습니다.");
                    return;
                }

                //솔루션 탐색기에 프로젝트 생성
                if (MakeProject != null)
                {
                    MakeProject.Invoke(this, new MakeProjectEventArgs(projectName, projectPath));
                    this.Close();

                    return;
                }

                throw new Exception("프로젝트 탐색기에 이벤트 핸들러 미등록");
            }
        }
Ejemplo n.º 2
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            MakeProject fr = new MakeProject();

            fr.Show();
        }