Esempio n. 1
0
        public void OpenProject(string filename)
        {
            isLoadingProjectSuccess = false;

            Console.WriteLine("Open project({0})", filename);
            if (!workbenchIsRunning)
            {
                workbenchSettings.InitialFileList.Clear();
                if (!host.IsSolutionOrProject(filename))
                {
                    WCFCommunicationService.SdaCallback.ProjectOpenError();
                }
                else
                {
                    workbenchSettings.InitialFileList.Add(filename);
                    RunWorkbench();
                    loadingProjectTimer.Start();
                }
            }
            else
            {
                if (host.IsSolutionOrProject(filename))
                {
                    loadingProjectTimer.Start();
                    host.OpenProject(filename);
                }
                else
                {
                    WCFCommunicationService.SdaCallback.ProjectOpenError();
                }
            }
            lastProjectOpened = filename;
        }
Esempio n. 2
0
        void OpenFileButtonClick(object sender, System.EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog()) {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (runButton.Enabled)
                    {
                        // create host with InitialFile set
                        runButton.Enabled = false;
                        unloadHostDomainButton.Enabled = true;

                        WorkbenchSettings wbSettings = new WorkbenchSettings();
                        wbSettings.InitialFileList.Add(dlg.FileName);
                        RunWorkbench(wbSettings);
                    }
                    else if (host != null)
                    {
                        if (host.IsSolutionOrProject(dlg.FileName))
                        {
                            // won't occur because no project types are defined
                            // in our reduces .addin file.
                            host.OpenProject(dlg.FileName);
                        }
                        else
                        {
                            host.OpenDocument(dlg.FileName);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        internal void OpenProject(string fileName)
        {
            if (!_sdHost.IsSolutionOrProject(fileName))
            {
                CommunicationService.SdaCallback.ProjectOpenError();
                return;
            }

            if (!StateHolder.Instance.CanOpenProject())
            {
                // TODO AA : exception?
                return;
            }
            if (StateHolder.Instance.IDEHostAppState == StateHolder.IDEHostApplicationStates.Running)
            {
                _sdHost.OpenProject(fileName);
            }
            else
            {
                _workbenchSettings.InitialFileList.Clear();
                _workbenchSettings.InitialFileList.Add(fileName);
                RunWorkbench();
            }
        }