コード例 #1
0
        private PlatformHeuristics LoadHeuristics(PlatformHeuristics_v1 heuristics)
        {
            if (heuristics == null)
            {
                return(new PlatformHeuristics
                {
                    ProcedurePrologs = new BytePattern[0],
                });
            }
            BytePattern[] prologs;
            if (heuristics.ProcedurePrologs == null)
            {
                prologs = new BytePattern[0];
            }
            else
            {
                prologs = heuristics.ProcedurePrologs
                          .Select(p => LoadBytePattern(p))
                          .Where(p => p.Bytes != null)
                          .ToArray();
            }

            return(new PlatformHeuristics
            {
                ProcedurePrologs = prologs
            });
        }
コード例 #2
0
        private PlatformHeuristics LoadHeuristics(PlatformHeuristics_v1 heuristics)
        {
            if (heuristics == null)
            {
                return new PlatformHeuristics
                {
                    ProcedurePrologs = new BytePattern[0],
                };
            }
            BytePattern[] prologs;
            if (heuristics.ProcedurePrologs == null)
            {
                prologs = new BytePattern[0];
            }
            else
            {
                prologs = heuristics.ProcedurePrologs
                    .Select(p => LoadBytePattern(p))
                    .Where(p => p.Bytes != null)
                    .ToArray();
            }

            return new PlatformHeuristics
            {
                ProcedurePrologs = prologs
            };
        }