Exemple #1
0
        public static int Main(string[] args)
        {
            var tracerMock = new Mock <ITracer>();
            IChildProcessManager childProcessManager = new ChildProcessManager(tracerMock.Object);

            return(childProcessManager.RunAndListenToParentAsync <TestChildProcessInput, TestChildProcessOutput>(args, MainTask, ConvertExceptionToExitCode, false).GetAwaiter().GetResult());
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            var tracerMock = new Mock <ITracer>();
            IChildProcessManager childProcessManager = new ChildProcessManager(tracerMock.Object);

            childProcessManager.RunAndListenToParentAsync <TestChildProcessInput, TestChildProcessOutput>(args, MainTask, false).Wait();
        }
Exemple #3
0
        /// <summary>
        /// Invoked when the debug host is loading. By default this launches the remote service client.
        /// </summary>
        protected virtual void DebugHostLoading()
        {
            // Start remote console session
            string serviceClientName = ServiceClientName;

            if (!string.IsNullOrWhiteSpace(serviceClientName))
            {
                m_processManager = new ChildProcessManager();
                m_processManager.AddProcess(Process.Start(FilePath.GetAbsolutePath(serviceClientName)));
            }
        }
Exemple #4
0
        /// <summary>
        /// Creates a new instance of the <see cref="ProcessLauncher"/> class.
        /// </summary>
        public ProcessLauncher()
        {
            m_process         = new Process();
            m_messageLevelMap = new Dictionary <string, MessageLevel>(StringComparer.OrdinalIgnoreCase);
            m_processUtilizationCalculator = new ProcessUtilizationCalculator();

            // In Windows environments, make sure child processes can be terminated if parent is terminated - even if termination is not graceful
            if (!Common.IsPosixEnvironment)
            {
                m_childProcessManager = new ChildProcessManager();
            }
        }
Exemple #5
0
        public MainViewModel()
        {
            _telemetryClient = new TelemetryClient {
                InstrumentationKey = ApplicationInsightsInstrumentationKey
            };
            _telemetryClient.Context.Component.Version = _currentVersion.ToString();
#if DEBUG
            _telemetryClient.Context.Properties["DEBUG"] = "1";
#endif
            if (SendTelemetry)
            {
                _telemetryClient.TrackEvent(TelemetryEventNames.Start);
            }

            Application.Current.DispatcherUnhandledException += (o, e) => OnUnhandledDispatcherException(e);
            AppDomain.CurrentDomain.UnhandledException       += (o, e) => OnUnhandledException((Exception)e.ExceptionObject, flushSync: true);
            TaskScheduler.UnobservedTaskException            += (o, e) => OnUnhandledException(e.Exception);

            NuGet = new NuGetViewModel();
            NuGetConfiguration  = new NuGetConfiguration(NuGet.GlobalPackageFolder, NuGetPathVariableName);
            RoslynHost          = new RoslynHost(NuGetConfiguration, new[] { Assembly.Load("RoslynPad.RoslynEditor") });
            ChildProcessManager = new ChildProcessManager();

            NewDocumentCommand          = new DelegateCommand((Action)CreateNewDocument);
            CloseCurrentDocumentCommand = new DelegateCommand(CloseCurrentDocument);
            ClearErrorCommand           = new DelegateCommand(() => LastError = null);
            ReportProblemCommand        = new DelegateCommand((Action)ReportProblem);

            _editorFontSize = Properties.Settings.Default.EditorFontSize;

            DocumentRoot  = CreateDocumentRoot();
            Documents     = DocumentRoot.Children;
            OpenDocuments = new ObservableCollection <OpenDocumentViewModel>(LoadAutoSaves(DocumentRoot.Path));
            OpenDocuments.CollectionChanged += (sender, args) => OnPropertyChanged(nameof(HasNoOpenDocuments));
            if (HasNoOpenDocuments)
            {
                CreateNewDocument();
            }
            else
            {
                CurrentOpenDocument = OpenDocuments[0];
            }

            if (HasCachedUpdate())
            {
                HasUpdate = true;
            }
            else
            {
                Task.Run(CheckForUpdates);
            }
        }