public void CreateConsolePad() { PadDescriptor pad = WorkbenchSingleton.Workbench.GetPad(typeof(PackageManagementConsolePad)); pad.BringPadToFront(); EnsurePackageManagementConsoleViewModelIsCreated(pad); }
public void ActivatePad(PadDescriptor content) { if (workbenchLayout != null) { workbenchLayout.ActivatePad(content); } }
private void ShowSelectedItemEntry(string indexTerm, int indexSlot) { PadDescriptor indexResults = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexResultsPad)); if (indexResults == null) { return; } try { IHxTopicList matchingTopics = indexControl.IndexData.GetTopicsFromSlot(indexSlot); try { ((HtmlHelp2IndexResultsPad)indexResults.PadContent).CleanUp(); ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.BeginUpdate(); foreach (IHxTopic topic in matchingTopics) { ListViewItem lvi = new ListViewItem(); lvi.Text = topic.get_Title(HxTopicGetTitleType.HxTopicGetRLTitle, HxTopicGetTitleDefVal.HxTopicGetTitleFileName); lvi.Tag = topic; lvi.SubItems.Add(topic.Location); ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.Items.Add(lvi); } } finally { ((HtmlHelp2IndexResultsPad)indexResults.PadContent).IndexResultsListView.EndUpdate(); ((HtmlHelp2IndexResultsPad)indexResults.PadContent).SortLV(0); ((HtmlHelp2IndexResultsPad)indexResults.PadContent).SetStatusMessage(indexTerm); } switch (matchingTopics.Count) { case 0: break; case 1: IHxTopic topic = (IHxTopic)matchingTopics.ItemAt(1); if (topic != null) { ShowHelpBrowser.OpenHelpView(topic); } break; default: indexResults.BringPadToFront(); break; } } catch (System.Runtime.InteropServices.COMException cEx) { LoggingService.Error("Help 2.0: cannot get matching index entries; " + cEx.ToString()); } }
private void ToolStripButtonClicked(object sender, EventArgs e) { ToolStripItem item = (ToolStripItem)sender; PadDescriptor pad = null; switch (item.ImageIndex) { case 0: pad = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad)); break; case 1: pad = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2IndexPad)); break; case 2: pad = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2SearchPad)); break; } if (pad != null) { pad.BringPadToFront(); } }
/// <summary> /// Displays the output from NAnt after it has exited. /// </summary> /// <param name="sender">The event source.</param> /// <param name="e">The NAnt exit event arguments.</param> void NAntExited(object sender, NAntExitEventArgs e) { // Update output window. string outputText = String.Empty; System.Diagnostics.Debug.Assert(e.Error.Length == 0); outputText = String.Concat(outputText, e.Output); // Update task list. TaskCollection tasks = NAntOutputParser.Parse(outputText); foreach (SDTask task in tasks) { SD.MainThread.InvokeAsyncAndForget(() => TaskService.Add(task)); } // Bring task list to front. if (tasks.Count > 0 && ErrorListPad.ShowAfterBuild) { PadDescriptor padDescriptor = SD.Workbench.GetPad(typeof(ErrorListPad)); if (padDescriptor != null) { SD.MainThread.InvokeAsync(padDescriptor.BringPadToFront); } } }
/// <summary> /// Brings the specified pad to the front. /// </summary> protected void ShowPad(PadDescriptor padDescriptor) { if (padDescriptor != null) { WorkbenchSingleton.SafeThreadAsyncCall(padDescriptor.BringPadToFront); } }
public override void Run() { PadDescriptor pad = WorkbenchSingleton.Workbench.GetPad(typeof(FSharpInteractive)); pad.BringPadToFront(); FSharpInteractive fsharpInteractive = (FSharpInteractive)pad.PadContent; if (fsharpInteractive.foundCompiler) { ITextEditorControlProvider editorProvider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorControlProvider; if (editorProvider != null) { var textArea = editorProvider.TextEditorControl.ActiveTextAreaControl.TextArea; if (textArea.SelectionManager.HasSomethingSelected) { foreach (var selection in textArea.SelectionManager.SelectionCollection) { fsharpInteractive.fsiProcess.StandardInput.WriteLine(selection.SelectedText); } } else { var line = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); var lineSegment = textArea.Document.GetLineSegment(line); var lineText = textArea.Document.GetText(lineSegment.Offset, lineSegment.TotalLength); fsharpInteractive.fsiProcess.StandardInput.WriteLine(lineText); } fsharpInteractive.fsiProcess.StandardInput.WriteLine(";;"); } } }
/// <summary> /// Displays the output from NAnt after it has exited. /// </summary> /// <param name="sender">The event source.</param> /// <param name="e">The NAnt exit event arguments.</param> void NAntExited(object sender, NAntExitEventArgs e) { // Update output window. string outputText = String.Empty; System.Diagnostics.Debug.Assert(e.Error.Length == 0); outputText = String.Concat(outputText, e.Output); // Update task list. TaskCollection tasks = NAntOutputParser.Parse(outputText); foreach (Task task in tasks) { WorkbenchSingleton.SafeThreadAsyncCall(TaskService.Add, task); } // Bring task list to front. if (tasks.Count > 0 && ErrorListPad.ShowAfterBuild) { IWorkbench workbench = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.Workbench; PadDescriptor padDescriptor = workbench.GetPad(typeof(ErrorListPad)); if (padDescriptor != null) { WorkbenchSingleton.SafeThreadAsyncCall(padDescriptor.BringPadToFront); } } }
public void ShowPad(PadDescriptor content) { if (content == null) { return; } PadContentWrapper dockContent; if (!contentHash.TryGetValue(content.Class, out dockContent)) { dockContent = CreateContent(content); // TODO: read the default dock state from the PadDescriptor // we'll also need to allow for default-hidden (HideOnClose) contents // which seems to be not possible using any Show overload. dockContent.Show(dockPanel); } else if (dockContent.VisibleState == DockState.Unknown) { dockContent.Show(dockPanel); } else { dockContent.Show(); } }
void AddFileToProject(ResourceStorage storage) { FileName resourceFileName = storage.OpenedFile.FileName; FileName formFileName = viewContent.PrimaryFileName; IProject project = SD.ProjectService.FindProjectContainingFile(formFileName); // Add this resource file to the project if (project != null && !project.IsFileInProject(resourceFileName)) { FileProjectItem newFileProjectItem = new FileProjectItem(project, ItemType.EmbeddedResource); newFileProjectItem.DependentUpon = Path.GetFileName(formFileName); newFileProjectItem.Include = FileUtility.GetRelativePath(project.Directory, resourceFileName); ProjectService.AddProjectItem(project, newFileProjectItem); FileService.FireFileCreated(resourceFileName, false); PadDescriptor pd = SD.Workbench.GetPad(typeof(ProjectBrowserPad)); FileNode formFileNode = ((ProjectBrowserPad)pd.PadContent).ProjectBrowserControl.FindFileNode(formFileName); if (formFileNode != null) { LoggingService.Info("FormFileNode found, adding subitem"); FileNode fileNode = new FileNode(resourceFileName, FileNodeStatus.BehindFile); fileNode.AddTo(formFileNode); fileNode.ProjectItem = newFileProjectItem; } project.Save(); } }
PadDescriptor AddCodeCoveragePadToMockWorkbench() { PadDescriptor padDescriptor = new PadDescriptor(typeof(CodeCoveragePad), "Code Coverage", String.Empty); context.MockUnitTestWorkbench.AddPadDescriptor(padDescriptor); return(padDescriptor); }
public void HidePad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { contentHash[padContent.Class].Hide(); } }
public void Save() { if (resources != null) { foreach (KeyValuePair <string, ResourceStorage> entry in resources) { string cultureName = entry.Key; string resourceFileName = CalcResourceFileName(FormFileName, cultureName); FileUtility.ObservedSave(new NamedFileOperationDelegate(entry.Value.Save), resourceFileName, FileErrorPolicy.Inform); IProject project = GetProject(FormFileName); // Add this resource file to the project if (entry.Value.ContainsData && project != null && !project.IsFileInProject(resourceFileName)) { FileProjectItem newFileProjectItem = new FileProjectItem(project, ItemType.EmbeddedResource); newFileProjectItem.DependentUpon = Path.GetFileName(FormFileName); newFileProjectItem.Include = FileUtility.GetRelativePath(project.Directory, resourceFileName); ProjectService.AddProjectItem(project, newFileProjectItem); PadDescriptor pd = WorkbenchSingleton.Workbench.GetPad(typeof(ProjectBrowserPad)); FileNode formFileNode = ((ProjectBrowserPad)pd.PadContent).ProjectBrowserControl.FindFileNode(FormFileName); if (formFileNode != null) { LoggingService.Info("FormFileNode found, adding subitem"); FileNode fileNode = new FileNode(resourceFileName, FileNodeStatus.BehindFile); fileNode.AddTo(formFileNode); fileNode.ProjectItem = newFileProjectItem; } project.Save(); } } } }
public void ShowSearchResults(SearchResult result) { if (result == null) { throw new ArgumentNullException("result"); } PadDescriptor searchResultPanel = WorkbenchSingleton.Workbench.GetPad(typeof(SearchResultPanel)); if (searchResultPanel != null) { searchResultPanel.BringPadToFront(); } lastSearches.Insert(0, result); if (result.SpecialPanel != null) { ShowSpecialPanel(result.SpecialPanel); } else if (result.Results != null) { ShowSearchResults(result.Pattern, result.Results); } if (SearchResultsShown != null) { SearchResultsShown(this, EventArgs.Empty); } }
public override void Run() { PadDescriptor pad = SD.Workbench.GetPad(typeof(FSharpInteractive)); pad.BringPadToFront(); FSharpInteractive fsharpInteractive = (FSharpInteractive)pad.PadContent; if (fsharpInteractive.foundCompiler) { ITextEditor textEditor = SD.GetActiveViewContentService <ITextEditor>(); if (textEditor != null) { if (textEditor.SelectionLength > 0) { fsharpInteractive.fsiProcess.StandardInput.WriteLine(textEditor.SelectedText); } else { var line = textEditor.Document.GetLineByNumber(textEditor.Caret.Line); fsharpInteractive.fsiProcess.StandardInput.WriteLine(textEditor.Document.GetText(line)); } fsharpInteractive.fsiProcess.StandardInput.WriteLine(";;"); } } }
public override void Run() { PadDescriptor pad = WorkbenchSingleton.Workbench.GetPad(typeof(FSharpInteractive)); pad.BringPadToFront(); FSharpInteractive fsharpInteractive = (FSharpInteractive)pad.PadContent; if (fsharpInteractive.foundCompiler) { ITextEditorProvider editorProvider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider; if (editorProvider != null) { var textEditor = editorProvider.TextEditor; if (textEditor.SelectionLength > 0) { fsharpInteractive.fsiProcess.StandardInput.WriteLine(textEditor.SelectedText); } else { var line = textEditor.Document.GetLine(textEditor.Caret.Line); fsharpInteractive.fsiProcess.StandardInput.WriteLine(line.Text); } fsharpInteractive.fsiProcess.StandardInput.WriteLine(";;"); } } }
public MockUnitTestWorkbench() { CompilerMessageViewPadDescriptor = new PadDescriptor(typeof(CompilerMessageView), "Output", String.Empty); AddPadDescriptor(CompilerMessageViewPadDescriptor); ErrorListPadDescriptor = new PadDescriptor(typeof(ErrorListPad), "Errors", String.Empty); AddPadDescriptor(ErrorListPadDescriptor); }
public bool IsVisible(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { return(!contentHash[padContent.Class].IsHidden); } return(false); }
public void ActivatePad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { //contentHash[padContent.Class].ActivateContent(); contentHash[padContent.Class].Show(); } }
public void OnAfterRunTestsWhenCriticalErrorsCodeCoveragePadIsNotShown() { context.MockTaskService.HasCriticalErrorsReturnValue = true; PadDescriptor padDescriptor = AddCodeCoveragePadToMockWorkbench(); command.CallOnAfterRunTests(); Assert.AreEqual(0, context.MockUnitTestWorkbench.SafeThreadAsyncMethodCalls.Count); }
public override void Run() { PadDescriptor toc = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2TocPad)); if (toc != null) { toc.BringPadToFront(); } }
public void BringToFront() { PadDescriptor d = this.PadDescriptor; if (d != null) { d.BringPadToFront(); } }
static void InitializeInstance() { PadDescriptor pad = SD.Workbench.GetPad(typeof(CompilerMessageView)); if (pad != null) { pad.CreatePad(); } }
public override void Run() { PadDescriptor padContent = WorkbenchSingleton.Workbench.GetPad(typeof(ICSharpCode.SharpDevelop.Gui.PropertyPad)); if (padContent != null) { padContent.BringPadToFront(); } }
public bool IsVisible(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { PadContentWrapper dockContent = contentHash[padContent.Class]; return(!dockContent.IsHidden && dockContent.VisibleState != DockState.Unknown); } return(false); }
public void UnloadPad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { contentHash[padContent.Class].Close(); contentHash[padContent.Class].Dispose(); contentHash.Remove(padContent.Class); } }
public override void Run() { PadDescriptor search = WorkbenchSingleton.Workbench.GetPad(typeof(Help3SearchPad)); if (search != null) { search.BringPadToFront(); } }
public override void Run() { PadDescriptor dynamicHelp = WorkbenchSingleton.Workbench.GetPad(typeof(HtmlHelp2DynamicHelpPad)); if (dynamicHelp != null) { dynamicHelp.BringPadToFront(); } }
public virtual void ShowPad(PadDescriptor content) { PadContentCollection.Add(content); if (layout != null) { layout.ShowPad(content); } }
public void HidePad(PadDescriptor padDescriptor) { AvalonPadContent p; if (pads.TryGetValue(padDescriptor, out p)) { p.Hide(); } }
public AvalonPadContent(AvalonDockLayout layout, PadDescriptor descriptor) { this.descriptor = descriptor; this.layout = layout; CustomFocusManager.SetRememberFocusedChild(this, true); this.Name = descriptor.Class.Replace('.', '_'); this.SetValueToExtension(TitleProperty, new StringParseExtension(descriptor.Title)); placeholder = new TextBlock { Text = this.Title }; this.Content = placeholder; this.Icon = PresentationResourceService.GetBitmapSource(descriptor.Icon); placeholder.IsVisibleChanged += AvalonPadContent_IsVisibleChanged; }
public void UnloadPad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { contentHash[padContent.Class].Close(); contentHash[padContent.Class].Dispose(); contentHash.Remove(padContent.Class); } }
public void UnloadPad(PadDescriptor padDescriptor) { AvalonPadContent p = pads[padDescriptor]; p.Hide(); DockablePane pane = p.Parent as DockablePane; if (pane != null) pane.Items.Remove(p); p.Dispose(); }
public bool IsVisible(PadDescriptor padDescriptor) { AvalonPadContent p; if (pads.TryGetValue(padDescriptor, out p)) return p.State != DockableContentState.Hidden; else return false; }
public bool IsVisible(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { return !contentHash[padContent.Class].IsHidden; } return false; }
PadContentWrapper CreateContent(PadDescriptor content) { if (contentHash.ContainsKey(content.Class)) { return contentHash[content.Class]; } Properties properties = (Properties)PropertyService.Get("Workspace.ViewMementos", new Properties()); PadContentWrapper newContent = new PadContentWrapper(content); if (!string.IsNullOrEmpty(content.Icon)) { newContent.Icon = IconService.GetIcon(content.Icon); } newContent.Text = StringParser.Parse(content.Title); contentHash[content.Class] = newContent; return newContent; }
public void ShowPad(PadDescriptor content) { WorkbenchSingleton.AssertMainThread(); if (content == null) throw new ArgumentNullException("content"); if (padDescriptorCollection.Contains(content)) throw new ArgumentException("Pad is already loaded"); padDescriptorCollection.Add(content); if (WorkbenchLayout != null) { WorkbenchLayout.ShowPad(content); } }
public void DetachContent() { Controls.Clear(); padDescriptor = null; }
PadContentWrapper CreateContent(PadDescriptor content) { if (contentHash.ContainsKey(content.Class)) { return contentHash[content.Class]; } PadContentWrapper newContent = new PadContentWrapper(content); if (!string.IsNullOrEmpty(content.Icon)) { newContent.Icon = IconService.GetIcon(content.Icon); } newContent.Text = StringParser.Parse(content.Title); contentHash[content.Class] = newContent; return newContent; }
public void ActivatePad(PadDescriptor content) { if (workbenchLayout != null) workbenchLayout.ActivatePad(content); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (padDescriptor != null) { padDescriptor.Dispose(); padDescriptor = null; } } }
public bool IsVisible(PadDescriptor padDescriptor) { AvalonPadContent p; if (pads.TryGetValue(padDescriptor, out p)) return p.IsVisible; else return false; }
public virtual void ShowPad(PadDescriptor content) { PadContentCollection.Add(content); if (layout != null) { layout.ShowPad(content); } }
public void UnloadPad(PadDescriptor content) { }
public bool IsVisible(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { PadContentWrapper dockContent = contentHash[padContent.Class]; return !dockContent.IsHidden && dockContent.VisibleState != DockState.Unknown; } return false; }
public PadContentWrapper(PadDescriptor padDescriptor) { if (padDescriptor == null) throw new ArgumentNullException("padDescriptor"); this.padDescriptor = padDescriptor; this.DockableAreas = ((((WeifenLuo.WinFormsUI.DockAreas.Float | WeifenLuo.WinFormsUI.DockAreas.DockLeft) | WeifenLuo.WinFormsUI.DockAreas.DockRight) | WeifenLuo.WinFormsUI.DockAreas.DockTop) | WeifenLuo.WinFormsUI.DockAreas.DockBottom); HideOnClose = true; }
public void ShowPad(PadDescriptor content) { if (content == null) { return; } if (!contentHash.ContainsKey(content.Class)) { DockContent newContent = CreateContent(content); // TODO: read the default dock state from the PadDescriptor // we'll also need to allow for default-hidden (HideOnClose) contents // which seems to be not possible using any Show overload. newContent.Show(dockPanel); } else { contentHash[content.Class].Show(); } }
/// <summary> /// Closes and disposes a <see cref="IPadContent"/>. /// </summary> public void UnloadPad(PadDescriptor content) { PadContentCollection.Remove(content); if (layout != null) { layout.UnloadPad(content); } content.Dispose(); }
public void ActivatePad(PadDescriptor padDescriptor) { AvalonPadContent p; if (pads.TryGetValue(padDescriptor, out p)) { if (!p.IsVisible) p.Show(); p.Activate(); } else { ShowPad(padDescriptor); } }
public void ShowPad(PadDescriptor content) { if (content == null) throw new ArgumentNullException("content"); PadContentCollection.Add(content); if (layout != null) { layout.ShowPad(content); } }
public void ActivatePad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { //contentHash[padContent.Class].ActivateContent(); contentHash[padContent.Class].Show(); } }
public void ShowPad(PadDescriptor content) { if (content == null) { return; } PadContentWrapper dockContent; if (!contentHash.TryGetValue(content.Class, out dockContent)) { dockContent = CreateContent(content); // TODO: read the default dock state from the PadDescriptor // we'll also need to allow for default-hidden (HideOnClose) contents // which seems to be not possible using any Show overload. dockContent.Show(dockPanel); } else if (dockContent.VisibleState == DockState.Unknown) { dockContent.Show(dockPanel); } else { dockContent.Show(); } }
public void ShowPad(PadDescriptor content) { SD.MainThread.VerifyAccess(); if (content == null) throw new ArgumentNullException("content"); if (padDescriptorCollection.Contains(content)) throw new ArgumentException("Pad is already loaded"); padDescriptorCollection.Add(content); if (content.ServiceInterface != null) { SD.Services.AddService(content.ServiceInterface, delegate { return content.PadContent; }); } if (WorkbenchLayout != null) { WorkbenchLayout.ShowPad(content); } }
public void HidePad(PadDescriptor padDescriptor) { AvalonPadContent p; if (pads.TryGetValue(padDescriptor, out p)) p.Hide(); }
public MyMenuItem(PadDescriptor padDescriptor) : base(null, null) { this.padDescriptor = padDescriptor; Text = StringParser.Parse(padDescriptor.Title); if (!string.IsNullOrEmpty(padDescriptor.Icon)) { base.Image = IconService.GetBitmap(padDescriptor.Icon); } if (padDescriptor.Shortcut != null) { ShortcutKeys = ICSharpCode.Core.MenuCommand.ParseShortcut(padDescriptor.Shortcut); } }
public void ShowPad(PadDescriptor padDescriptor) { AvalonPadContent pad; if (pads.TryGetValue(padDescriptor, out pad)) { pad.Show(dockingManager); } else { //LoggingService.Debug("Add pad " + padDescriptor.Class + " at " + padDescriptor.DefaultPosition); pad = new AvalonPadContent(this, padDescriptor); pads.Add(padDescriptor, pad); padsByClass.Add(padDescriptor.Class, pad); pad.ShowInDefaultPosition(); } }
public BringPadToFrontCommand(PadDescriptor padDescriptor) { this.padDescriptor = padDescriptor; }
public PadContentWrapper(PadDescriptor padDescriptor) { if (padDescriptor == null) throw new ArgumentNullException("padDescriptor"); this.padDescriptor = padDescriptor; this.DockAreas = DockAreas.Float | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom; HideOnClose = true; }
public void HidePad(PadDescriptor padContent) { if (padContent != null && contentHash.ContainsKey(padContent.Class)) { contentHash[padContent.Class].Hide(); } }