public MainViewModel() { var hockeyClient = (HockeyClient)HockeyClient.Current; if (SendTelemetry) { hockeyClient.Configure(HockeyAppId) .RegisterCustomDispatcherUnhandledExceptionLogic(OnUnhandledDispatcherException) .UnregisterDefaultUnobservedTaskExceptionHandler(); var platformHelper = (HockeyPlatformHelperWPF)hockeyClient.PlatformHelper; platformHelper.AppVersion = _currentVersion.ToString(); hockeyClient.TrackEvent(TelemetryEventNames.Start); } else { Application.Current.DispatcherUnhandledException += (sender, args) => OnUnhandledDispatcherException(args); var platformHelper = new HockeyPlatformHelperWPF { AppVersion = _currentVersion.ToString() }; hockeyClient.PlatformHelper = platformHelper; hockeyClient.AppIdentifier = HockeyAppId; } NuGet = new NuGetViewModel(); NuGetConfiguration = new NuGetConfiguration(NuGet.GlobalPackageFolder, NuGetPathVariableName); RoslynHost = new RoslynHost(NuGetConfiguration, new[] { Assembly.Load("RoslynPad.RoslynEditor") }); 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); } }
public NuGetDocumentViewModel(NuGetViewModel nuGetViewModel) { _nuGetViewModel = nuGetViewModel; InstallPackageCommand = new DelegateCommand <PackageData>(InstallPackage); IsEnabled = true; }
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); } }
public MainViewModel(IServiceProvider serviceProvider, ITelemetryProvider telemetryProvider, ICommandProvider commands, IApplicationSettings settings, NuGetViewModel nugetViewModel, DocumentFileWatcher documentWatcher) : base(serviceProvider, telemetryProvider, commands, settings, nugetViewModel, documentWatcher) { }
public MainViewModel(IServiceProvider serviceProvider, IExceptionManager exceptionManager, ICommandProvider commands, IApplicationSettings settings, NuGetViewModel nugetViewModel, DocumentFileWatcher documentFileWatcher) : base(serviceProvider, exceptionManager, commands, settings, nugetViewModel, documentFileWatcher) { }
public MainViewModel() { NuGet = new NuGetViewModel(); RoslynHost = new RoslynHost(new NuGetProvider(NuGet.GlobalPackageFolder, NuGetPathVariableName)); }
public MainViewModel(IServiceProvider serviceProvider, ITelemetryProvider telemetryProvider, ICommandProvider commands, IApplicationSettings settings, NuGetViewModel nugetViewModel) : base(serviceProvider, telemetryProvider, commands, settings, nugetViewModel) { }