protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var rxtLogger = new RxtLogger(); var config = new RxtSettings(); var telemLogger = TelemetryAccessor.Create(rxtLogger, config.TelemetryKey); Logger = new RxtLoggerWithTelemtry(rxtLogger, telemLogger); try { // Set the ServiceProvider of CodeParserBase as it's needed to get settings CodeParserBase.ServiceProvider = this; Logger.RecordInfo(StringRes.Info_ProblemsInstructionsAndLink); Logger.RecordInfo(StringRes.Info_IntializingCommands.WithParams(CoreDetails.GetVersion())); await CreateViewCommand.InitializeAsync(this, Logger); await CopyToClipboardCommand.InitializeAsync(this, Logger); await SendToToolboxCommand.InitializeAsync(this, Logger); await OpenOptionsCommand.InitializeAsync(this, Logger); await SetDatacontextCommand.InitializeAsync(this, Logger); await MoveAllHardCodedStringsToResourceFileCommand.InitializeAsync(this, Logger); await RapidXamlDropHandlerProvider.InitializeAsync(this, Logger); await this.SetUpRunningDocumentTableEventsAsync(cancellationToken); RapidXamlDocumentCache.Initialize(this); } catch (Exception exc) { Logger.RecordException(exc); throw; // Remove for launch. see issue #90 } }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var rxtLogger = new RxtLogger(); var telemKey = string.Empty; var telemLogger = TelemetryAccessor.Create(rxtLogger, telemKey); Logger = new RxtLoggerWithTelemtry(rxtLogger, telemLogger); try { // Set the ServiceProvider of AnalyzerBase as it's needed to get settings AnalyzerBase.ServiceProvider = this; Logger.RecordInfo(StringRes.Info_IntializingCommands.WithParams(CoreDetails.GetVersion())); await CreateViewCommand.InitializeAsync(this, Logger); await CopyToClipboardCommand.InitializeAsync(this, Logger); await SendToToolboxCommand.InitializeAsync(this, Logger); await OpenOptionsCommand.InitializeAsync(this, Logger); await SetDatacontextCommand.InitializeAsync(this, Logger); await InsertGridRowDefinitionCommand.InitializeAsync(this, Logger); await RapidXamlDropHandlerProvider.InitializeAsync(this, Logger); } catch (Exception exc) { Logger.RecordException(exc); throw; // Remove for launch. see issue #90 } }