private void ShowIndividualPacket()
        {
            if (currentSelectedIndex < 0)
            {
                return;
            }
            viewPanelRTB.Text = "";
            viewPanelGB.Text  = "View Panel: Individual Instance";
            string tagString = "";

            foreach (string tag in allAnalysisInstances[currentSelectedIndex].allTags)
            {
                tagString += tag + ",";
            }
            tagString = tagString.TrimEnd(',');

            AppendBox.AppendText(viewPanelRTB, "Current Window:", Color.Black, new Font("Source Sans Pro", 16.0f, FontStyle.Bold));
            AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[currentSelectedIndex].currentWindow + "\n", Color.Black, new Font("Source Sans Pro", 16.0f, FontStyle.Regular));
            AppendBox.AppendText(viewPanelRTB, "Time Recorded:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
            AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[currentSelectedIndex].instanceTime.ToString() + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
            AppendBox.AppendText(viewPanelRTB, "Tags:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
            AppendBox.AppendText(viewPanelRTB, tagString + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
            AppendBox.AppendText(viewPanelRTB, "Click Count:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
            AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[currentSelectedIndex].clickCounts.ToString() + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
            AppendBox.AppendText(viewPanelRTB, "Keystroke Content:\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
            AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[currentSelectedIndex].instanceContent + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
        }
        private void ShowTagPackets(string currentFilter)
        {
            if (currentTag == "")
            {
                return;
            }
            viewPanelRTB.Text = "";
            viewPanelGB.Text  = "View Panel: Instances with Tag - " + currentTag;
            string tagString = "";

            //check if the tag dictionary has the tag
            //MessageBox.Show(tagsAnalysisInstances.ContainsKey(currentTag).ToString() + " " + tagsAnalysisInstances.Count.ToString());
            if (!tagsAnalysisInstances.ContainsKey(currentTag))
            {
                List <int> listOfAnalysis = new List <int>();
                for (int i = 0; i < allAnalysisInstances.Length; i++)
                {
                    if (CheckStringArrayContains(allAnalysisInstances[i].allTags, currentTag))
                    {
                        listOfAnalysis.Add(i);
                    }
                }
                tagsAnalysisInstances.Add(currentTag, listOfAnalysis);
            }


            AppendBox.AppendText(viewPanelRTB, "Displaying all instances with tag: " + currentTag + "\n", Color.Black, new Font("Source Sans Pro", 20.0f, FontStyle.Bold));

            List <int> analysisList = tagsAnalysisInstances[currentTag];

            progressBar.Value   = 0;
            progressBar.Maximum = analysisList.Count;
            for (int i = 0; i < allAnalysisInstances.Length; i++)
            {
                if (analysisList.Contains(i))
                {
                    progressBar.Increment(1);
                    debugText.Text = "Sifting through the packets to get packets with tag: " + currentTag;
                    switch (currentFilter)
                    {
                    case "Only Keystrokes > 5":
                        if (allAnalysisInstances[i].instanceContent.Length <= 5)
                        {
                            continue;
                        }
                        break;

                    case "Only Click Counts > 5":
                        if (allAnalysisInstances[i].clickCounts <= 5)
                        {
                            continue;
                        }
                        break;
                    }


                    tagString = "";
                    foreach (string tag in allAnalysisInstances[i].allTags)
                    {
                        tagString += tag + ",";
                    }
                    tagString = tagString.TrimEnd(',');
                    //then do
                    AppendBox.AppendText(viewPanelRTB, "Current Window:", Color.Black, new Font("Source Sans Pro", 16.0f, FontStyle.Bold));
                    AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[i].currentWindow + "\n", Color.Black, new Font("Source Sans Pro", 16.0f, FontStyle.Regular));
                    AppendBox.AppendText(viewPanelRTB, "Time Recorded:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
                    AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[i].instanceTime.ToString() + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
                    AppendBox.AppendText(viewPanelRTB, "Tags:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
                    AppendBox.AppendText(viewPanelRTB, tagString + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
                    AppendBox.AppendText(viewPanelRTB, "Click Count:", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
                    AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[i].clickCounts.ToString() + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
                    AppendBox.AppendText(viewPanelRTB, "Keystroke Content:\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Bold));
                    AppendBox.AppendText(viewPanelRTB, allAnalysisInstances[i].instanceContent + "\n", Color.Black, new Font("Source Sans Pro", 14.0f, FontStyle.Regular));
                }
            }
            //double loop
        }