private void addPropertyCompareData(string propertyName, DfmInfomation dfmInfoA, DfmInfomation dfmInfoB, List <PropertyCompareData> list) { var compData = this.getPropertyCompareData(propertyName, dfmInfoA, dfmInfoB); if (!list.Exists(match => match.GetHashCode().Equals(compData.GetHashCode()))) { list.Add(compData); } if (null != dfmInfoA) { foreach (DfmInfomation dfmInfo in dfmInfoA.ChildObjects) { var infoB = (dfmInfoB != null) ? dfmInfoB.ChildObjects.Find(match => dfmInfo.ObjectName.Equals(match.ObjectName)) : null; this.addPropertyCompareData(propertyName, dfmInfo, infoB, list); } } if (null != dfmInfoB) { foreach (DfmInfomation dfmInfo in dfmInfoB.ChildObjects) { var infoA = (dfmInfoA != null) ? dfmInfoA.ChildObjects.Find(match => dfmInfo.ObjectName.Equals(match.ObjectName)) : null; this.addPropertyCompareData(propertyName, infoA, dfmInfo, list); } } }
private PropertyCompareData getPropertyCompareData(string propertyName, DfmInfomation dfmInfoA, DfmInfomation dfmInfoB) { if (null == dfmInfoA) { return(new PropertyCompareData(dfmInfoB.ObjectName, null, dfmInfoB[propertyName])); } else if (null == dfmInfoB) { return(new PropertyCompareData(dfmInfoA.ObjectName, dfmInfoA[propertyName], null)); } else { return(new PropertyCompareData(dfmInfoA.ObjectName, dfmInfoA[propertyName], dfmInfoB[propertyName])); } }
public void AddTree(TreeNodeCollection nodes, DfmInfomation dfmInfo) { var nowNode = nodes.Add(dfmInfo.ObjectClass + ":" + dfmInfo.ObjectName); dfmInfo.ChildObjects.ForEach(info => this.AddTree(nowNode.Nodes, info)); }
public void Analyze(string filePath) { this.DfmObject = new DfmInfomation(File.ReadAllText(filePath, Encoding.GetEncoding("Shift_JIS"))); }