예제 #1
0
        private ComparisonItem CompareProperties(IMDPropertyProvider Left, IMDPropertyProvider Right, ComparisonItem parentNode)
        {
            var PropStub = parentNode.AddStaticNode("Свойства");

            bool HasDifference = false;

            foreach (PropDef propDef in Left.Properties.Values)
            {
                if (m_CurrentMode == MatchingMode.ByName && propDef.Key == "ID")
                {
                    continue;
                }

                object  RightVal      = null;
                PropDef RightProperty = null;

                if (Right != null)
                {
                    RightVal      = Right.GetValue(propDef.Key);
                    RightProperty = Right.Properties[propDef.Key];
                }

                bool childDifference = !propDef.CompareTo(RightVal);
                HasDifference = HasDifference || childDifference;

                var newNode = new ComparisonItem(propDef, RightProperty, propDef.Name);
                newNode.IsDiffer = childDifference;

                PropStub.Items.Add(newNode);
            }

            parentNode.IsDiffer = HasDifference;
            PropStub.IsDiffer   = HasDifference;

            return(PropStub);
        }
예제 #2
0
 public PropertiesReportSingle(IMDPropertyProvider PropertyProvider, IPropertiesReportFormatter formatter)
 {
     _provider = PropertyProvider;
     Formatter = formatter;
 }
예제 #3
0
 public PropertiesReportCompare(IMDPropertyProvider left, IMDPropertyProvider right)
 {
     _left  = left;
     _right = right;
 }
예제 #4
0
 public PropertiesReportSingle(IMDPropertyProvider PropertyProvider) : this(PropertyProvider, null)
 {
 }