private void RemoveTableRow(object sender, EventArgs e)
        {
            TableLayoutPanel panel = (TableLayoutPanel)((Control)sender).Parent;

            HelperMethodsLibrary.RemoveRowInTableLayoutPanel(panel, panel.GetPositionFromControl((Control)sender).Row);
            UpdateLabelCounter(panel);
        }
Beispiel #2
0
        // Find the regex pairs we can match the pip to
        private bool FindMatchingRegexPairsForPip(string pip, WireType wireType)
        {
            matchedRegexPairsAndGroupIndices = new Dictionary <int, Dictionary <string, Tuple <int, int> > >();

            for (int i = 0; i < regexPairs[wireType].Count; i++)
            {
                if (regexPairs[wireType][i].Item2.Match(pip).Success)
                {
                    string keyword        = wireType == WireType.Out ? keyword_outpin : keyword_inpin;
                    bool   keywordPresent = regexPairs[wireType][i].Item2.GetGroupNames().Contains(keyword);

                    List <string> belGroupNames = new List <string>(regexPairs[wireType][i].Item1.GetGroupNames());
                    belGroupNames.Remove(regexPairs[wireType][i].Item1.GroupNameFromNumber(0));

                    List <string> wireGroupNames = new List <string>(regexPairs[wireType][i].Item2.GetGroupNames());
                    wireGroupNames.Remove(regexPairs[wireType][i].Item2.GroupNameFromNumber(0));
                    if (keywordPresent)
                    {
                        wireGroupNames.Remove(keyword);
                    }

                    if (HelperMethodsLibrary.CompareListsIgnoringOrder(belGroupNames, wireGroupNames))
                    {
                        matchedRegexPairsAndGroupIndices.Add(i, new Dictionary <string, Tuple <int, int> >());
                        foreach (var groupName in belGroupNames)
                        {
                            Tuple <int, int> tuple = new Tuple <int, int>(
                                regexPairs[wireType][i].Item1.GroupNumberFromName(groupName),
                                regexPairs[wireType][i].Item2.GroupNumberFromName(groupName));
                            matchedRegexPairsAndGroupIndices[i].Add(groupName, tuple);
                        }
                    }
                }
            }

            return(matchedRegexPairsAndGroupIndices.Count > 0);
        }