コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 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]));
     }
 }
コード例 #3
0
        public void AddTree(TreeNodeCollection nodes, DfmInfomation dfmInfo)
        {
            var nowNode = nodes.Add(dfmInfo.ObjectClass + ":" + dfmInfo.ObjectName);

            dfmInfo.ChildObjects.ForEach(info => this.AddTree(nowNode.Nodes, info));
        }
コード例 #4
0
 public void Analyze(string filePath)
 {
     this.DfmObject = new DfmInfomation(File.ReadAllText(filePath, Encoding.GetEncoding("Shift_JIS")));
 }