public void OnUserSettingsChanged() { ThreadHelper.ThrowIfNotOnUIThread(); GeneralSettingsPageGrid settings = EditorUtils.GetGeneralSettings(); LayoutWindow win = EditorUtils.GetLayoutWindow(false); ApplyUserSettingsToWindow(win, settings); }
public async System.Threading.Tasks.Task ParseAtCurrentLocationAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); OutputLog.Clear(); EditorUtils.SaveActiveDocument(); DocumentLocation location = GetCurrentLocation(); if (location == null) { string msg = "Unable to retrieve current document position."; OutputLog.Error(msg); ParseMessageWindow.Display(new ParseMessageContent(msg)); } ProjectProperties properties = GetProjectData(); if (properties == null) { string msg = "Unable to retrieve the project configuration"; OutputLog.Error(msg); ParseMessageWindow.Display(new ParseMessageContent(msg)); return; } GeneralSettingsPageGrid settings = EditorUtils.GetGeneralSettings(); parser.PrintCommandLine = settings.OptionParserShowCommandLine; //TODO ~ ramonv ~ add parsing queue to avoid multiple queries at the same time LayoutWindow prewin = EditorUtils.GetLayoutWindow(false); if (prewin != null) { prewin.SetProcessing(); } ParseResult result = await parser.ParseAsync(properties, location); //Only create or focus the window if we have a valid result LayoutWindow win = EditorUtils.GetLayoutWindow(result.Status == ParseResult.StatusCode.Found); if (win != null) { win.SetResult(result); if (result.Status == ParseResult.StatusCode.Found) { EditorUtils.FocusWindow(win); } } DisplayResult(result); }
/// <summary> /// Shows the tool window when the menu item is clicked. /// </summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event args.</param> private void Execute(object sender, EventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); LayoutWindow win = EditorUtils.GetLayoutWindow(true); if (win != null) { EditorUtils.FocusWindow(win); } }