Пример #1
0
        private void AddProject(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog();
            fileDialog.Filter = "MS Build Project Files|*.*proj;*.targets";

            System.Windows.Forms.DialogResult dr = fileDialog.ShowDialog();

            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                if (fileDialog.FileName != m_Project.Filename)
                {
                    m_Project.AddProjectImport(fileDialog.FileName);
                }
                else
                {
                    ErrorDialog dialog = new ErrorDialog("You cannot add a project to itself.");
                    dialog.ShowDialog();
                }
            }
        }