/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ISessionSummary> sessionSummaries) { try { _addInContext.Log.Verbose(LogCategory, "Processing " + commandName + " command", null); switch (commandName) { case "view": if (sessionSummaries.Count > 0) { ProcessViewCommand(sessionSummaries[0]); } break; case "export": ProcessExportCommand(sessionSummaries); break; case "edit": ProcessEditCommand(sessionSummaries); break; } } catch (Exception ex) { _addInContext.Log.Error(ex, LogCategory, "Unhandled Exception processing " + commandName + " command", "Called with {0} sessions", sessionSummaries.Count); throw; } }
/// <summary> /// Create a new defect in the defect tracking system with the provided set messages /// </summary> /// <param name="controller"></param> /// <param name="messages"></param> private static void ActionAddDefect(IUserInterfaceContext controller, IList <ILogMessage> messages) { using (AddDefectDialog dialog = new AddDefectDialog()) { dialog.AddDefect(messages); } }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of messages. /// </summary> /// <param name="controller"/><param name="messages">The selected messages.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// If exactly one session is currently selected it will be provided so you can customize commands and labels. /// For performance reasons, if multiple sessions are selected they aren't provided (since some operations could /// conceivably affect hundreds or thousands of sessions) /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList<ILogMessage> messages) { string toolTip = (messages.Count > 1) ? "Use these messages to create a new defect" : "Use this message to create a new defect"; controller.UpdateCommand(AddDefectCommandName, "Create New Defect...", toolTip, true); }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of messages. /// </summary> /// <param name="controller"/><param name="messages">The selected messages.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// If exactly one session is currently selected it will be provided so you can customize commands and labels. /// For performance reasons, if multiple sessions are selected they aren't provided (since some operations could /// conceivably affect hundreds or thousands of sessions) /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ILogMessage> messages) { string toolTip = (messages.Count > 1) ? "Use these messages to create a new defect" : "Use this message to create a new defect"; controller.UpdateCommand(AddDefectCommandName, "Create New Defect...", toolTip, true); }
/// <summary> /// Create a new defect in the defect tracking system with the provided set messages /// </summary> /// <param name="controller"></param> /// <param name="messages"></param> private void ActionAddDefect(IUserInterfaceContext controller, IList <ILogMessage> messages) { using (AddDefectDialog dialog = new AddDefectDialog()) { FBApi api = m_Controller.GetApi(); dialog.AddDefect(m_Context, messages, m_Controller, api); } }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList<ISessionSummary> sessionSummaries) { switch (commandName) { case "DoNothing": Trace.WriteLine("Don't do anything at all", "Loupe.Extension"); break; } }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of sessions. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ISessionSummary> sessionSummaries) { controller.UpdateCommand("export", "Save Session as Text", "Exports the session as a text file in all of its detail", true); //now we only want to enable our custom open command if there's exactly one session enabled. controller.UpdateCommand("openSession", sessionSummaries.Count == 1); controller.UpdateCommand("invisible", false); }
/// <summary> /// Initializes a new instance of the <see cref="Context"/> class. /// </summary> /// <param name="testConfiguration">The test configuration.</param> /// <param name="dataContext">The data context.</param> /// <param name="userInterfaceContext">The User interface context.</param> public Context( ITestConfiguration testConfiguration, IDataContext dataContext, IUserInterfaceContext userInterfaceContext) { Data = dataContext; UserInterface = userInterfaceContext; Config = testConfiguration; }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ISessionSummary> sessionSummaries) { switch (commandName) { case "DoNothing": Trace.WriteLine("Don't do anything at all", "Loupe.Extension"); break; } }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <param name="commandName">The command that was requested.</param> /// <param name="messages">The selected messages to be processed.</param> /// <remarks> /// <para> /// All of the currently selected messages are provided. The set of messages will always contain at least one value and be from the same session. /// If the command was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ILogMessage> messages) { switch (commandName) { case AddDefectCommandName: ActionAddDefect(controller, messages); break; } }
/// <summary> /// Called to have the command object register all commands that it supports. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </remarks> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("sample1", true, "Grouped Command 1", "Our first global command", "firstgroup", null); controller.RegisterCommand("sample2", false, "Second Global", "Our second global command"); controller.RegisterCommand("sample3", true, "Third Command", "Our third global command"); controller.RegisterCommand("sample4", true, "Grouped Command 2", "Our second global command", "firstgroup", null); controller.RegisterCommand("configure", true, "Configure", "Show the configuration dialog for our add in"); controller.RegisterCommand("sample6", true, "Group 2 Command 1", "Our second global command", "secondgroup", null); controller.RegisterCommand("sample7", true, "Group 2 Command 2", "Our second global command", "secondgroup", null); controller.RegisterCommand("sample8", true, "Grouped Command 3", "Our second global command", "firstgroup", null); controller.RegisterCommand("sample9", true, "Group 3 Command 1", "Our second global command", "thirdgroup", null); }
/// <summary> /// Called just prior to displaying the list of commands to a user. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller) { //make sure we have a server to connect to... if (string.IsNullOrEmpty(m_Controller.CommonConfiguration.Url)) { controller.UpdateCommand(OpenSiteCommand, false); } else { controller.UpdateCommand(OpenSiteCommand, true); } }
/// <summary> /// Execute the specified command /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param> /// <remarks> /// <para> /// If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName) { switch (commandName) { case ConfigureCommand: m_Context.EditConfiguration(); break; case OpenSiteCommand: m_Controller.WebSiteOpen(null); break; } }
/// <summary> /// Called to have the log message command object register all commands that it supports. /// </summary> /// <param name="controller"/> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand(AddDefectCommandName, true, "Create New Defect...", "Use this message to create a new defect"); controller.RegisterCommand("sample1", true, "Grouped Command 1", "Our first log message command", "firstgroup", null); controller.RegisterCommand("sample2", false, "Second Global", "Our second log message command"); controller.RegisterCommand("sample3", true, "Third Command", "Our third log message command"); controller.RegisterCommand("sample4", true, "Grouped Command 2", "Our second log message command", "firstgroup", null); controller.RegisterCommand("sample5", false, "Configure", "Show the configuration dialog for our add in"); controller.RegisterCommand("sample6", true, "Group 2 Command 1", "Our second log message command", "secondgroup", null); controller.RegisterCommand("sample7", true, "Group 2 Command 2", "Our second log message command", "secondgroup", null); controller.RegisterCommand("sample8", true, "Grouped Command 3", "Our second log message command", "firstgroup", null); controller.RegisterCommand("sample9", true, "Group 3 Command 1", "Our second log message command", "thirdgroup", null); }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ISessionSummary> sessionSummaries) { switch (commandName) { case "export": foreach (ISessionSummary summary in sessionSummaries) { ExportSession(summary.Session()); } break; case "openSession": m_AddInContext.DisplaySession(sessionSummaries[0].Id, null); break; } }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ISessionSummary> sessionSummaries) { try { _addInContext.Log.Verbose(ExtentionDefinition.LogCategory, "Processing " + commandName + " command", null); switch (commandName) { case "scan": ProcessScanCommand(sessionSummaries); break; } } catch (Exception ex) { _addInContext.Log.Error(ex, ExtentionDefinition.LogCategory, "Unhandled Exception processing " + commandName + " command", "Called with {0} sessions", sessionSummaries.Count); throw; } }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList <ISessionSummary> sessionSummaries) { switch (commandName) { case "scan": foreach (ISessionSummary summary in sessionSummaries) { // Ignore sessions that do not contain any errors. Checking the header first saves the time to load the session data if (summary.ErrorCount == 0) { Log.Verbose(LogCategory, "Skipping session because there are no errors to inspect", null); } else { ActionProcessSession(summary.Session()); } } break; } }
/// <summary> /// Called just prior to displaying the list of commands to a user. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller) { //suppress everything in the middle group controller.UpdateCommand("sample6", false); controller.UpdateCommand("sample7", false); }
/// <summary> /// Called to have the log message command object register all commands that it supports. /// </summary> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand(AddDefectCommandName, true, "Create New Defect...", "Use this message to create a new defect"); }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList<ISessionSummary> sessionSummaries) { try { _addInContext.Log.Verbose(LogCategory, "Processing " + commandName + " command", null); switch (commandName) { case "view": if (sessionSummaries.Count > 0) ProcessViewCommand(sessionSummaries[0]); break; case "export": ProcessExportCommand(sessionSummaries); break; case "edit": ProcessEditCommand(sessionSummaries); break; } } catch (Exception ex) { _addInContext.Log.Error(ex, LogCategory, "Unhandled Exception processing " + commandName + " command", "Called with {0} sessions", sessionSummaries.Count); throw; } }
/// <summary> /// Register the context menu commands we support. /// </summary> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("scan", false, "Scan session(s) for users", "Scan for users associated with each session", "scan", Properties.Resources.UserIcon); }
/// <summary> /// Execute the specified command /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param> /// <remarks> /// <para> /// If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName) { switch (commandName) { } }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <param name="commandName">The command that was requested.</param> /// <param name="messages">The selected messages to be processed.</param> /// <remarks> /// <para> /// All of the currently selected messages are provided. The set of messages will always contain /// at least one value and be from the same session. If the command was configured to provide its /// own user interface it will be called on the main UI thread and needs to perform its own /// background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList<ILogMessage> messages) { switch (commandName) { case AddDefectCommandName: ActionAddDefect(controller, messages); break; } }
/// <summary> /// Called to have the session command object register all commands that it supports. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </remarks> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("scan", false, "Analyze Session", "Reports errors to FogBugz"); }
/// <summary> /// Create a new defect in the defect tracking system with the provided set messages /// </summary> /// <param name="controller"></param> /// <param name="messages"></param> private static void ActionAddDefect(IUserInterfaceContext controller, IList<ILogMessage> messages) { using(AddDefectDialog dialog = new AddDefectDialog()) { dialog.AddDefect(messages); } }
/// <summary> /// Update command availability and text just prior to displaying a list of commands to the user. /// </summary> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ISessionSummary> sessionSummaries) { controller.UpdateCommand("export", sessionSummaries.Count == 1 ? "Export Session" : "Export Sessions", "Export session data to text files in configured export folder", true); controller.UpdateCommand("edit", sessionSummaries.Count == 1); }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of sessions. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ISessionSummary> sessionSummaries) { }
/// <summary> /// Called to have the session command object register all commands that it supports. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </remarks> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("DoNothing", false, "Do Nothing at All", "This just means you have a session for the demo product"); }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of sessions. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList<ISessionSummary> sessionSummaries) { controller.UpdateCommand("scan", "Analyze Session", "Reports errors to FogBugz", true); }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList<ISessionSummary> sessionSummaries) { switch (commandName) { case "scan": foreach (ISessionSummary summary in sessionSummaries) { // Ignore sessions that do not contain any errors. Checking the header first saves the time to load the session data if (summary.ErrorCount == 0) { Log.Verbose(LogCategory, "Skipping session because there are no errors to inspect", null); } else { ActionProcessSession(summary.Session()); } } break; } }
/// <summary> /// Called to have the session command object register all commands that it supports. /// </summary> /// <param name="controller"/> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("export", false, "Save Session as Text", "Exports the session as a text file in all of its detail"); controller.RegisterCommand("openSession", true, "Custom Command Open Session", null); controller.RegisterCommand("invisible", true, "Invisible", null); }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of sessions. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ISessionSummary> sessionSummaries) { controller.UpdateCommand("scan", "Analyze Session", "Reports errors to FogBugz", true); }
/// <summary> /// Create a new defect in the defect tracking system with the provided set messages /// </summary> /// <param name="controller"></param> /// <param name="messages"></param> private void ActionAddDefect(IUserInterfaceContext controller, IList<ILogMessage> messages) { using(AddDefectDialog dialog = new AddDefectDialog()) { FBApi api = m_Controller.GetApi(); dialog.AddDefect(m_Context, messages, m_Controller, api); } }
/// <summary> /// Update command availability and text just prior to displaying a list of commands to the user. /// </summary> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList<ISessionSummary> sessionSummaries) { controller.UpdateCommand("export", sessionSummaries.Count == 1 ? "Export Session" : "Export Sessions", "Export session data to text files in configured export folder", true); controller.UpdateCommand("edit", sessionSummaries.Count == 1); }
/// <summary> /// Update command availability and text just prior to displaying a list of commands to the user. /// </summary> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList <ISessionSummary> sessionSummaries) { controller.UpdateCommand("scan", sessionSummaries.Count == 1 ? "Scan session for users" : "Scan sessions for users", "Scan for users associated with each session", true); }
/// <summary> /// Register the context menu commands we support. /// </summary> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("export", false, "Export Session(s)", "Export session data to text files in configured export folder","export", null); controller.RegisterCommand("edit", true, "Configure Export based on this Session", "Copy the list of metrics in this session to the clipboard","export", null); controller.RegisterCommand("view", false, "View Exported Data", "Open the folder containing exported session data", "export", null); }
/// <summary> /// Apply the specified command to the provided set of sessions /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="commandName">The command that was requested.</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Headers of all of the currently selected sessions are provided. If the command /// was configured to provide its own user interface it will be called on the main UI thread and needs to perform /// its own background processing to keep the user interface responsive. If not, it will be called /// from a background thread and the user interface will be kept responsive by the framework. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void Process(IUserInterfaceContext controller, string commandName, IList<ISessionSummary> sessionSummaries) { try { _addInContext.Log.Verbose(ExtentionDefinition.LogCategory, "Processing " + commandName + " command", null); switch (commandName) { case "scan": ProcessScanCommand(sessionSummaries); break; } } catch (Exception ex) { _addInContext.Log.Error(ex, ExtentionDefinition.LogCategory, "Unhandled Exception processing " + commandName + " command", "Called with {0} sessions", sessionSummaries.Count); throw; } }
/// <summary> /// Called just prior to displaying the list of commands to a user on a set of sessions. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param><param name="sessionSummaries">Summaries of the selected sessions.</param> /// <remarks> /// <para> /// Use this method to change what commands are available or what their labels should be prior to being displayed. /// </para> /// <para> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </para> /// </remarks> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList<ISessionSummary> sessionSummaries) { }
/// <summary> /// Update command availability and text just prior to displaying a list of commands to the user. /// </summary> public void BeforeCommandsDisplay(IUserInterfaceContext controller, IList<ISessionSummary> sessionSummaries) { controller.UpdateCommand("scan", sessionSummaries.Count == 1 ? "Scan session for users" : "Scan sessions for users", "Scan for users associated with each session", true); }
/// <summary> /// Called to have the command object register all commands that it supports. /// </summary> /// <param name="controller">The User Interface Controller for the current process</param> /// <remarks> /// The controller should not be persisted or accessed between calls, it may change and /// the same object may get calls from multiple controllers. /// </remarks> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand(OpenSiteCommand, true, "Open FogBugz", "Display your FogBugz site in a new web browser", "view", null); controller.RegisterCommand(ConfigureCommand, true, "Configure Integration...", "View and edit the FogBugz integration configuration", "config", null); }
/// <summary> /// Register the context menu commands we support. /// </summary> public void RegisterCommands(IUserInterfaceContext controller) { controller.RegisterCommand("export", false, "Export Session(s)", "Export session data to text files in configured export folder", "export", null); controller.RegisterCommand("edit", true, "Configure Export based on this Session", "Copy the list of metrics in this session to the clipboard", "export", null); controller.RegisterCommand("view", false, "View Exported Data", "Open the folder containing exported session data", "export", null); }
public ViewModelContext(Window mainWindow) { _UserInterface = new UserInterfaceContext(mainWindow); }