コード例 #1
0
        /// <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;
            }
        }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 /// <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;
     }
 }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
 /// <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;
 }
コード例 #9
0
 /// <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;
     }
 }
コード例 #10
0
        /// <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;
            }
        }
コード例 #11
0
 /// <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);
 }
コード例 #12
0
 /// <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);               
     }
 }
コード例 #13
0
 /// <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);
     }
 }
コード例 #14
0
 /// <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);
 }
コード例 #15
0
        /// <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;
            }
        }
コード例 #16
0
 /// <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);
 }
コード例 #17
0
        /// <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);

        }
コード例 #18
0
        /// <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;
            }
        }
コード例 #19
0
 /// <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;
     }
 }
コード例 #20
0
 /// <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;
     }
 }
コード例 #21
0
 /// <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);
 }
コード例 #22
0
 /// <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");
 }
コード例 #23
0
        /// <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;
            }
        }
コード例 #24
0
 /// <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);
 }
コード例 #25
0
 /// <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)
     {
     }
 }
コード例 #26
0
        /// <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;
            }
        }
コード例 #27
0
 /// <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");
 }
コード例 #28
0
 /// <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);
     }
 }
コード例 #29
0
 /// <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);
 }
コード例 #30
0
 /// <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)
 {
 }
コード例 #31
0
 /// <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");
 }
コード例 #32
0
 /// <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);
 }
コード例 #33
0
 /// <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");
 }
コード例 #34
0
 /// <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;
     }
 }
コード例 #35
0
 /// <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;
     }
 }
コード例 #36
0
 /// <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");
 }
コード例 #37
0
 /// <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);
 }
コード例 #38
0
 /// <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);
 }
コード例 #39
0
 /// <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)
     {
     }
 }
コード例 #40
0
 /// <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);
     }
 }
コード例 #41
0
 /// <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);
 }
コード例 #42
0
 /// <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);
 }
コード例 #43
0
 /// <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);
 }
コード例 #44
0
 /// <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);
 }
コード例 #45
0
 /// <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");
 }
コード例 #46
0
 /// <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;
     }
 }
コード例 #47
0
 /// <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)
 {
 }
コード例 #48
0
 /// <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);
 }
コード例 #49
0
 /// <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);
 }
コード例 #50
0
 /// <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);
 }
コード例 #51
0
 /// <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);
 }
コード例 #52
0
 /// <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);
 }
コード例 #53
0
 public ViewModelContext(Window mainWindow)
 {
     _UserInterface = new UserInterfaceContext(mainWindow);
 }