Esempio n. 1
0
        public void SetBlockList(List <PatternBlock> flatBlockList, PatternArgs patternArgs)
        {
            this.patternArgs = patternArgs;
            blockList.Clear();
            List <PatternBlock> singeList = new List <PatternBlock>();

            //int blockId = -1;
            for (int i = 0; i < flatBlockList.Count; ++i)
            {
                PatternBlock block = flatBlockList[i];
                singeList.Add(block);
                //if (block.blockId != blockId)
                //{
                //  singeList = new List<PatternBlock>();
                //  PatternBlock selfRefBlock = new PatternBlock();
                //  selfRefBlock.targetStart = block.startLine;
                //  selfRefBlock.targetEnd = block.endLine;
                //  selfRefBlock.blockId = block.blockId;
                //  singeList.Add(selfRefBlock);
                //  singeList.Add(block);
                //  this.blockList.Add(singeList);
                //  blockId = block.blockId;
                //}
                //else
                //{
                //  singeList.Add(block);
                //}
            }
            this.blockList.Add(singeList);
            this.Invoke(new MethodInvoker(SetBlockListGuiStuff));
        }
Esempio n. 2
0
		public void SetBlockList(List<PatternBlock> flatBlockList, PatternArgs patternArgs)
		{
			this.patternArgs = patternArgs;
			blockList.Clear();
			List<PatternBlock> singeList = new List<PatternBlock>();
			//int blockId = -1;
			for (int i = 0; i < flatBlockList.Count; ++i)
			{
				PatternBlock block = flatBlockList[i];
				singeList.Add(block);
				//if (block.blockId != blockId)
				//{
				//  singeList = new List<PatternBlock>();
				//  PatternBlock selfRefBlock = new PatternBlock();
				//  selfRefBlock.targetStart = block.startLine;
				//  selfRefBlock.targetEnd = block.endLine;
				//  selfRefBlock.blockId = block.blockId;
				//  singeList.Add(selfRefBlock);
				//  singeList.Add(block);
				//  this.blockList.Add(singeList);
				//  blockId = block.blockId;
				//}
				//else
				//{
				//  singeList.Add(block);
				//}
			}
			this.blockList.Add(singeList);
			this.Invoke(new MethodInvoker(SetBlockListGuiStuff));
		}
Esempio n. 3
0
 public void PatternStatistic(PatternArgs patternArgs)
 {
     Action<PatternArgs, Interfaces.ILogWindowSearch> fx = new Action<PatternArgs, Interfaces.ILogWindowSearch>(_fuzzyBlockDetection.TestStatistic);
     fx.BeginInvoke(patternArgs, this, null, null);
 }
Esempio n. 4
0
 public void PatternStatisticSelectRange(PatternArgs patternArgs)
 {
     if (dataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect)
     {
         List<int> lineNumList = new List<int>();
         foreach (DataGridViewRow row in dataGridView.SelectedRows)
         {
             if (row.Index != -1)
             {
                 lineNumList.Add(row.Index);
             }
         }
         lineNumList.Sort();
         patternArgs.startLine = lineNumList[0];
         patternArgs.endLine = lineNumList[lineNumList.Count - 1];
     }
     else
     {
         if (dataGridView.CurrentCellAddress.Y != -1)
         {
             patternArgs.startLine = dataGridView.CurrentCellAddress.Y;
         }
         else
         {
             patternArgs.startLine = 0;
         }
         patternArgs.endLine = dataGridView.RowCount - 1;
     }
 }