/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { // setup image Image image = new Image(); image.Height = 16; image.Width = 16; if (Browser.Image == null) { image.Source = VisualHelper.LoadBitmap("WebBrowser.png"); } else { image.Source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon( Browser.Image.Handle, System.Windows.Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); } // setup presenter if (host == FunctionHost.Toolbar) { presenter.Header = image; presenter.ToolTip = String.Format("Open {0}", Browser.Name); } else { presenter.Header = String.Format("Open {0}", Browser.Name); presenter.Icon = image; } }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canSave = false; bool isDirty = false; if (CurrentDocument != null) { string name = System.IO.Path.GetFileNameWithoutExtension(CurrentDocument.Path); isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.ToolTip = String.Format("Save {0}", name); } else { presenter.Header = String.Format("Save {0}", name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.InputGestureText = "Ctrl+S"; } canSave = true; } IsVisible = canSave; IsEnabled = isDirty; }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canSave = false; bool isDirty = false; if (CurrentDocument != null) { Manifest manifest = CurrentDocument.Manifest; isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.ToolTip = String.Format("Save {0}", manifest.Name); } else { presenter.Header = String.Format("Save {0}", manifest.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.InputGestureText = "Ctrl+S"; } canSave = true; } IsVisible = canSave; IsEnabled = isDirty; }
/// <summary> /// Set the header based on the currently selected snippet. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; string[] snippets = GetSelectedSnippets(); if (snippets.Length > 0) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = (snippets.Length == 1) ? String.Format("Delete {0}", System.IO.Path.GetFileNameWithoutExtension(snippets[0])) : "Delete selected snippets"; } else { presenter.Header = (snippets.Length == 1) ? String.Format("Delete {0}", System.IO.Path.GetFileNameWithoutExtension(snippets[0])) : "Delete selected snippets"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; } IsVisible = canDelete; }
/// <summary> /// Set the headers. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { ISourceFileEditorDocument document = CurrentDocument; if (document != null) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Cut.png"); presenter.ToolTip = "Cut"; } else { presenter.Header = "Cut"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Cut.png"); presenter.InputGestureText = "Ctrl+X"; } IsVisible = true; IsEnabled = !document.IsReadOnly; } else { IsVisible = false; } }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canCreate = false; bool isDirty = false; if (CurrentDocument != null) { Manifest manifest = CurrentDocument.Manifest; isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewPackage.png"); presenter.ToolTip = "New package"; } else { presenter.Header = "New package"; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewPackage.png"); } canCreate = true; } IsVisible = canCreate; IsEnabled = !isDirty; }
/// <summary> /// Set visibility. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { IsVisible = App.Instance.SalesForceApp.CurrentProject != null && App.Instance.SalesForceApp.CurrentProject.Repository.IsValid && (CurrentDocument != null); }
/// <summary> /// Set the header based on the currently selected manifest. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; Manifest[] manifests = GetSelectedManifests(); if (manifests.Length > 0) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = (manifests.Length == 1) ? String.Format("Delete {0}", manifests[0].Name) : "Delete selected manifests"; } else { presenter.Header = (manifests.Length == 1) ? String.Format("Delete {0}", manifests[0].Name) : "Delete selected manifests"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; } IsVisible = canDelete; }
/// <summary> /// Set the header based on the currently selected class. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; SourceFile file = GetSelectedSourceFile(); if (file != null) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = String.Format("Delete {0}", file.Name); } else { presenter.Header = String.Format("Delete {0}", file.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; // make sure the file isn't locked Project project = App.Instance.SalesForceApp.CurrentProject; if (project != null && file.CheckedOutBy != null && !file.CheckedOutBy.Equals(project.Client.User)) { canDelete = false; } } IsVisible = canDelete; }
/// <summary> /// Set the header based on the currently selected log. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { LogViewerDocument document = App.Instance.Content.ActiveDocument as LogViewerDocument; IsVisible = (document != null); IsEnabled = (document != null && document.SelectedLog != null); }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool isVisible = false; bool isEnabled = false; if (CurrentDocument is ClassEditorDocument) { isVisible = (CurrentDocument as ClassEditorDocument).IsTest; isEnabled = !CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "RunTests.png"); presenter.ToolTip = String.Format("Run tests for {0}", CurrentDocument.File.Name); } else { presenter.Header = String.Format("Run tests for {0}", CurrentDocument.File.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "RunTests.png"); } } IsVisible = isVisible; IsEnabled = isEnabled; }
/// <summary> /// Set header displayed. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (_padIcon) { presenter.Header = _text; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } else { presenter.Header = _text; } }
/// <summary> /// Setup the header. /// </summary> /// <param name="host">The host for the function.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Menu) { presenter.Header = "Close all documents"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } else { presenter.Header = "Close all documents"; } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Compare.png"); presenter.ToolTip = "Compare with version on server"; } else { presenter.Header = "Compare with version on server"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Compare.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "ExportData.png"); presenter.ToolTip = "Export data results"; } else { presenter.Header = "Export data results"; presenter.Icon = VisualHelper.CreateIconHeader(null, "ExportData.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Table.png"); presenter.ToolTip = "Data query tool"; } else { presenter.Header = "Data query tool"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Table.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewDocumentTrigger.png"); presenter.ToolTip = "New trigger..."; } else { presenter.Header = "New trigger..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewDocumentTrigger.png"); } }
/// <summary> /// Setup header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "History.png"); presenter.ToolTip = "Show file history"; } else { presenter.Header = "Show file history"; presenter.Icon = VisualHelper.CreateIconHeader(null, "History.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Previous.png"); presenter.ToolTip = "Go to previous difference"; } else { presenter.Header = "Go to previous difference"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Previous.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Checkpoints.png"); presenter.ToolTip = "Checkpoints"; } else { presenter.Header = "Checkpoints"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Checkpoints.png"); } }
/// <summary> /// Setup header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Empty.png"); presenter.ToolTip = "Open repository in file explorer"; } else { presenter.Header = "Open repository in file explorer"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Empty.png"); presenter.ToolTip = "Reload symbols"; } else { presenter.Header = "Reload symbols"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } }
/// <summary> /// Setup the header. /// </summary> /// <param name="host">The host for the function.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Empty.png"); presenter.ToolTip = "Configure source control..."; } else { presenter.Header = "Configure source control..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "AddFileToManifest.png"); presenter.ToolTip = "Add manual entry..."; } else { presenter.Header = "Add manual entry..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "AddFileToManifest.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewManifest.png"); presenter.ToolTip = "New manifest from selected report items..."; } else { presenter.Header = "New manifest from selected report items..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewManifest.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = "Delete project..."; } else { presenter.Header = "Delete project..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "CodeCoverage.png"); presenter.ToolTip = "Show code coverage"; } else { presenter.Header = "Show code coverage"; presenter.Icon = VisualHelper.CreateIconHeader(null, "CodeCoverage.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "AddComment.png"); presenter.ToolTip = "Comment selected lines"; } else { presenter.Header = "Comment selected lines"; presenter.Icon = VisualHelper.CreateIconHeader(null, "AddComment.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewSnippet.png"); presenter.ToolTip = "New system snippet..."; } else { presenter.Header = "New system snippet..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewSnippet.png"); } }
/// <summary> /// Setup the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Copy.png"); presenter.ToolTip = "Copy results to clipboard"; } else { presenter.Header = "Copy results to clipboard"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Copy.png"); } }
/// <summary> /// Update the menu item with current values. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public virtual void Update(FunctionHost host, IFunctionPresenter presenter) { }
/// <summary> /// Set header displayed. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { presenter.Header = "&Settings..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "Settings.png"); }
/// <summary> /// Only show the settings menu item if there are settings to display. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { IsVisible = (IDE.Current.Settings.GetRegisteredSettings().Length > 0); }
/// <summary> /// Set header displayed. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { presenter.Header = String.Format("&About {0}...", IDE.Current.Details.Title); presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); }
/// <summary> /// Called by the UI when the function is ready to be displayed in a host. /// This method is called once for each host the function is displayed in. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public virtual void Init(FunctionHost host, IFunctionPresenter presenter) { }
/// <summary> /// Set header displayed. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { presenter.Header = "E&xit"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); }