예제 #1
0
        async void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
        {
            var state = correlationManager.StateSummary;

            switch (actionId)
            {
            case "1":
                switch (state.Status)
                {
                case CorrelationStateSummary.StatusCode.Processed:
                case CorrelationStateSummary.StatusCode.ProcessingFailed:
                    if (state.Report != null)
                    {
                        ShowTextInTextViewer(state.Report);
                    }
                    break;
                }
                break;

            case Constants.RunActionId:
                switch (state.Status)
                {
                case CorrelationStateSummary.StatusCode.NeedsProcessing:
                case CorrelationStateSummary.StatusCode.Processed:
                case CorrelationStateSummary.StatusCode.ProcessingFailed:
                    this.correlationManager.Run();
                    break;
                }
                break;
            }
        }
예제 #2
0
 void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
 {
     if (newLogSourceDialog != null)
     {
         newLogSourceDialog.ShowTheDialog(newLogSourceDialog.FormatDetectorPageName);
     }
 }
        async void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
        {
            var state = postprocessorsManager.GetCorrelatorStateSummary();

            switch (actionId)
            {
            case "1":
                switch (state.Status)
                {
                case CorrelatorStateSummary.StatusCode.Processed:
                case CorrelatorStateSummary.StatusCode.ProcessingFailed:
                    if (state.Report != null)
                    {
                        ShowTextInTextViewer(state.Report);
                    }
                    break;
                }
                break;

            case "2":
                switch (state.Status)
                {
                case CorrelatorStateSummary.StatusCode.NeedsProcessing:
                case CorrelatorStateSummary.StatusCode.Processed:
                case CorrelatorStateSummary.StatusCode.ProcessingFailed:
                    await this.postprocessorsManager.RunPostprocessors(
                        postprocessorsManager.GetPostprocessorOutputsByPostprocessorId(postprocessorId), ClickFlags.None);

                    break;
                }
                break;
            }
        }
예제 #4
0
 /// <summary>
 /// Creates a new button click packet.
 /// </summary>
 /// <param name="buffer">A buffer contaning the packet data.</param>
 public IS_BTC(byte[] buffer)
     : this() {
     PacketReader reader = new PacketReader(buffer);
     Size = reader.ReadByte();
     Type = (PacketType)reader.ReadByte();
     ReqI = reader.ReadByte();
     UCID = reader.ReadByte();
     ClickID = reader.ReadByte();
     Inst = reader.ReadByte();
     CFlags = (ClickFlags)reader.ReadByte();
 }
예제 #5
0
        /// <summary>
        /// Creates a new button click packet.
        /// </summary>
        /// <param name="buffer">A buffer contaning the packet data.</param>
        public IS_BTC(byte[] buffer)
            : this()
        {
            PacketReader reader = new PacketReader(buffer);

            Size    = reader.ReadByte();
            Type    = (PacketType)reader.ReadByte();
            ReqI    = reader.ReadByte();
            UCID    = reader.ReadByte();
            ClickID = reader.ReadByte();
            Inst    = reader.ReadByte();
            CFlags  = (ClickFlags)reader.ReadByte();
        }
        async void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
        {
            switch (actionId)
            {
            case "show":
                if (lazyOutputForm != null)
                {
                    lazyOutputForm().Show();
                }
                break;

            case "action":
                if (!await this.postprocessorsManager.RunPostprocessors(postprocessorsManager.GetPostprocessorOutputsByPostprocessorId(postprocessorKind)))
                {
                    return;
                }
                if (lazyOutputForm != null)
                {
                    var outputs = postprocessorsManager.GetPostprocessorOutputsByPostprocessorId(postprocessorKind);
                    if (outputs.Any(x => x.OutputStatus == LogSourcePostprocessorOutput.Status.Finished))
                    {
                        lazyOutputForm().Show();
                    }
                }
                break;

            case "report":
            {
                var outputs   = postprocessorsManager.GetPostprocessorOutputsByPostprocessorId(postprocessorKind);
                var summaries =
                    outputs
                    .Select(output => output.LastRunSummary)
                    .Where(summary => summary != null)
                    .OrderBy(summary => summary.HasErrors ? 0 : summary.HasWarnings ? 1 : 2);
                var text = new StringBuilder();
                foreach (var summary in summaries)
                {
                    text.Append(summary.Report ?? "");
                    text.AppendLine();
                    text.AppendLine();
                }
                if (text.Length > 0)
                {
                    var fname = Path.ChangeExtension(tempFiles.GenerateNewName(), ".txt");
                    File.WriteAllText(fname, text.ToString());
                    shellOpen.OpenInTextEditor(fname);
                }
            }
            break;
            }
        }
예제 #7
0
 public static async Task <bool> RunPostprocessors(this IPostprocessorsManager postprocessorsManager, LogSourcePostprocessorOutput[] logs, ClickFlags flags)
 {
     return(await postprocessorsManager.RunPostprocessor(
                logs
                .Select(output => new KeyValuePair <ILogSourcePostprocessor, ILogSource>(output.PostprocessorMetadata, output.LogSource))
                .ToArray(),
                forceSourcesSelection : (flags & ClickFlags.AnyModifier) != 0
                ));
 }
 async void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
 {
     await postprocessorsManager.RunPostprocessors(GetRelevantLogSourcePostprocessors().ToArray());
 }
 void IViewModel.OnActionClick(string actionId, ViewControlId viewId, ClickFlags flags)
 {
     viewControlHandlers[viewId].ExecuteAction(actionId, flags);
 }
예제 #10
0
 private void MoveClickWrapper(uint x, uint y, ClickFlags flag = ClickFlags.LeftClick)
 {
     SuperInputSim.MoveMouseTo((uint)(x + this.GameRect.Left), (uint)(y + this.GameRect.Top));
     SuperInputSim.SendClick((uint)(x + this.GameRect.Left), (uint)(y + this.GameRect.Top), flag);
 }
예제 #11
0
 async void IViewControlHandler.ExecuteAction(string actionId, ClickFlags flags)
 {
     await postprocessorsManager.RunPostprocessors(getOutputs());
 }