示例#1
0
        private ImageComparer.ExclusionArea[] GetAllExclusionAreas()
        {
            var result = new ImageComparer.ExclusionArea[TestAppInfo.ExclusionAreas.Length + 1];

            // We always exclude the area the app name occupies in the title bar as these will always be different
            result[0] = new ImageComparer.ExclusionArea(new Rectangle(0, 0, 600, 40), scaleFactor: 1.25f);

            Array.Copy(TestAppInfo.ExclusionAreas, 0, result, 1, TestAppInfo.ExclusionAreas.Length);

            return(result);
        }
        private ImageComparer.ExclusionArea[] GetAllExclusionAreas(string pageSpecific = null)
        {
            var hasPageSpecific = !string.IsNullOrWhiteSpace(pageSpecific) && TestAppInfo.PageSpecificExclusions.ContainsKey(pageSpecific);
            // Extra on all pages + app bar title + page specific
            var finalCount = TestAppInfo.ExclusionAreas.Length + 1 + (hasPageSpecific ? 1 : 0);

            var result = new ImageComparer.ExclusionArea[finalCount];

            // We always exclude the area the app name occupies in the title bar as these will always be different
            result[0] = new ImageComparer.ExclusionArea(new Rectangle(0, 0, 600, 40), scaleFactor: 1.25f);

            Array.Copy(TestAppInfo.ExclusionAreas, 0, result, 1, TestAppInfo.ExclusionAreas.Length);

            if (hasPageSpecific)
            {
                result[finalCount - 1] = TestAppInfo.PageSpecificExclusions[pageSpecific];
            }

            return(result);
        }