Interaction logic for Window1.xaml
상속: DialogWindow
예제 #1
0
        private void MenuItemCallback(object sender, EventArgs e)
        {
            string filename   = "";
            string folderName = "";
            string name       = "";

            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.DefaultExt       = ".cproject"; // Default file extension
            dlg.Filter           = "Native Core Application Project Files (*.cproject, *.project)|*.cproject;*.project;";
            dlg.Title            = "Open BlackBerry Core Native Application Project Files";
            dlg.Multiselect      = false;
            dlg.InitialDirectory = Environment.SpecialFolder.MyComputer.ToString();
            dlg.CheckFileExists  = true;

            bool?result = dlg.ShowDialog();

            if (result == true)
            {
                filename = dlg.FileName;
                FileInfo fi = new FileInfo(filename);
                folderName = fi.DirectoryName;

                Array   projs   = (Array)_dte.ActiveSolutionProjects;
                Project project = (Project)projs.GetValue(0);
                name = project.FullName;

                // Create the dialog instance without Help support.
                var ImportSummary = new Import.Import(project, folderName, name);
                ImportSummary.ShowModel2();
            }
        }
예제 #2
0
        private void MenuItemCallback(object sender, EventArgs e)
        {
            string filename = "";
            string folderName = "";
            string name = "";

            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.DefaultExt = ".cproject"; // Default file extension
            dlg.Filter = "Native Core Application Project Files (*.cproject, *.project)|*.cproject;*.project;";
            dlg.Title = "Open BlackBerry Core Native Application Project Files";
            dlg.Multiselect = false;
            dlg.InitialDirectory = Environment.SpecialFolder.MyComputer.ToString();
            dlg.CheckFileExists = true;

            bool? result = dlg.ShowDialog();
            if (result == true)
            {
                filename = dlg.FileName;
                FileInfo fi = new FileInfo(filename);
                folderName = fi.DirectoryName;

                Array projs = (Array)_dte.ActiveSolutionProjects;
                Project project = (Project)projs.GetValue(0);
                name = project.FullName;

                // Create the dialog instance without Help support.
                var ImportSummary = new Import.Import(project, folderName, name);
                ImportSummary.ShowModel2();
            }
        }