示例#1
0
        internal override bool Execute(TreeListNode node)
        {
            object nodeValue1 = node.GetValue(_column1);
            object nodeValue2 = node.GetValue(_column2);

            if (nodeValue1 == null || nodeValue2 == null)
            {
                return(false);
            }

            bool isDifferent = nodeValue1.ToString().ToLower() != nodeValue2.ToString().ToLower();

            TreeListTags.BaseTreeListTag tag = node.Tag as TreeListTags.BaseTreeListTag;
            if (_importByIDDiscrepancies != null && tag != null)
            {
                if (_importByIDDiscrepancies.GetDiscrepancy(tag.GetIDsWithinAllSystems()) != string.Empty)
                {
                    if (!isDifferent)
                    {
                        ++_countImportByIDDiscrepancies; //assess count of differences only due to the little red/green squares
                    }
                    isDifferent = true;
                }
            }
            return(isDifferent);
        }
        internal override bool Execute(TreeListNode senderNode)
        {
            if (!senderNode.Visible || !_column.Visible) //do not take into account cells which are hidden due to row-hiding or columns moved to the hidden-system-box
            {
                return(false);                           //(not visible cells cannot be focused and thus are a e.g. a problem with search next)
            }
            if (_mustBeExpanded && !IsFullyExpanded(senderNode))
            {
                return(false);
            }

            if (_mustBeWithinNodes != null && !_mustBeWithinNodes.Contains(senderNode))
            {
                return(false);
            }

            object cellValue = senderNode.GetValue(_column);

            if (cellValue == null)
            {
                return(false);
            }
            foreach (string pattern in ConditionalFormattingHelper.GetFormatConditionPatterns(_patterns))
            {
                if (EM_Helpers.DoesValueMatchPattern(pattern, cellValue.ToString(), _matchCase, _matchWord))
                {
                    return(true);
                }

                if (_includePrivateComments && TreeListManagement.TreeListBuilder.IsCommentColumn(_column))
                {
                    TreeListTags.BaseTreeListTag tag = senderNode.Tag as TreeListTags.BaseTreeListTag;
                    if (tag != null && EM_Helpers.DoesValueMatchPattern(pattern, tag.GetPrivateComment(), _matchCase, _matchWord))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }