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); }
public PropertiesReportSingle(IMDPropertyProvider PropertyProvider, IPropertiesReportFormatter formatter) { _provider = PropertyProvider; Formatter = formatter; }
public PropertiesReportCompare(IMDPropertyProvider left, IMDPropertyProvider right) { _left = left; _right = right; }
public PropertiesReportSingle(IMDPropertyProvider PropertyProvider) : this(PropertyProvider, null) { }