Пример #1
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            CranMirrorList.Download();
            base.Initialize();

            _fs = Services.FileSystem();

            ProjectIconProvider.LoadProjectImages(Services);
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            LoadEditorSettings();
            BuildFunctionIndex();
            AddConnectionStatusBar();
            RtvsTelemetry.Initialize(_packageIndex, Services);

            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());
            ExpansionsCache.Load(Services);
        }
Пример #2
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            using (var p = Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p?.LoadSettings();
            }

            RtvsTelemetry.Initialize(_packageIndex, VsAppShell.Current.ExportProvider.GetExportedValue <IRSettings>());
            base.Initialize();

            ProjectIconProvider.LoadProjectImages();
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            BuildFunctionIndex();
            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache), VsAppShell.Current);
            IdleTimeAction.Create(() => RtvsTelemetry.Current.ReportConfiguration(), 5000, typeof(RtvsTelemetry), VsAppShell.Current);
        }
Пример #3
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            base.Initialize();

            ProjectIconProvider.LoadProjectImages(VsAppShell.Current.Services);
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            var settings       = VsAppShell.Current.GetService <IRToolsSettings>();
            var editorSettings = VsAppShell.Current.GetService <IREditorSettings>();

            RtvsTelemetry.Initialize(_packageIndex, settings, editorSettings);

            BuildFunctionIndex();
            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());
            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache), VsAppShell.Current);
        }
Пример #4
0
        protected override void Dispose(bool disposing)
        {
            SavePackageIndex();

            LogCleanup.Cancel();
            ProjectIconProvider.Close();
            CsvAppFileIO.Close(VsAppShell.Current.FileSystem());

            RtvsTelemetry.Current?.Dispose();
            VsAppShell.Terminate();

            base.Dispose(disposing);
        }
Пример #5
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Application.SetCompatibleTextRenderingDefault(false);

            Program.FFmpegAvailable = File.Exists(FFmpeg.FFmpegPath);
            Program._arguments      = new List <string>(args);

            // Up the connection limit for getting the file sizes of video formats
            System.Net.ServicePointManager.DefaultConnectionLimit = 20;

            LogCleanup.RunAsync();

            new App().Run(args);
        }
Пример #6
0
        protected override void Dispose(bool disposing)
        {
            SavePackageIndex();

            LogCleanup.Cancel();
            ProjectIconProvider.Close();
            CsvAppFileIO.Close(new FileSystem());

            RtvsTelemetry.Current.Dispose();

            using (var p = Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p?.SaveSettings();
            }

            base.Dispose(disposing);
        }
Пример #7
0
        protected override void Dispose(bool disposing)
        {
            if (_indexBuildingTask != null && !_indexBuildingTask.IsFaulted)
            {
                _indexBuildingTask.Wait(2000);
                _indexBuildingTask = null;
            }

            LogCleanup.Cancel();
            ProjectIconProvider.Close();
            CsvAppFileIO.Close();

            RtvsTelemetry.Current.Dispose();

            using (var p = RPackage.Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p.SaveSettings();
            }

            base.Dispose(disposing);
        }
Пример #8
0
        protected override void Initialize()
        {
            Current = this;

            // Force app shell creation before everything else
            var shell = VsAppShell.Current;

            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            RtvsTelemetry.Initialize();

            using (var p = Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p.LoadSettings();
            }

            MicrosoftRClient.CheckInstall(VsAppShell.Current);
            base.Initialize();

            ProjectIconProvider.LoadProjectImages();
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            _indexBuildingTask = FunctionIndex.BuildIndexAsync();

            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());

            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache));
        }