コード例 #1
0
        /*public OcadDiff GetDiff()
         * {
         *  var diff = new OcadDiff();
         *  var compareLogic = new CompareLogic();
         *  compareLogic.Config.MaxDifferences = Int32.MaxValue;
         *  compareLogic.Config.IgnoreCollectionOrder = true;
         *  compareLogic.Config.CollectionMatchingSpec[typeof(CourseSettingObject)] = new [] { "Code" };
         *  diff.Report = compareLogic.Compare(GetProject(SourceFile), GetProject(TargetFile));
         *  return diff;
         * }*/

        private OcadCourseSettingProject GetProject(string sourceFile)
        {
            OcadCourseSettingProject project = new OcadCourseSettingProject();

            using (var stream = new FileStream(sourceFile, FileMode.Open))
            {
                var reader = new OcadStreamReader(stream);
                var parser = new BinaryParser <OcadFile>();

                var file = parser.Read(reader);
                project.Load(file);
            }
            return(project);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: yannisgu/OcadParser
        static void Main(string[] args)
        {
            OcadCourseSettingProject project = new OcadCourseSettingProject();
            using (var stream = new FileStream(@"D:\temp\testmap.ocd", FileMode.Open))
            {
                var reader = new OcadStreamReader(stream);
                var parser = new BinaryParser<OcadFile>();

                var file = parser.Read(reader);
                project.Load(file);
            }

            foreach (var symbol in project.Symbols)
            {
                Console.WriteLine(symbol.Description);
            }
        }