Esempio n. 1
0
        protected virtual void InitAllResolutions()
        {
            ResolutionsKey.Clear();
            Resolutions.Clear();
            foreach (var item in Screen.resolutions)
            {
                string customKey = string.Format($"{item.width}x{item.height}");
                if (!ResolutionsKey.Contains(customKey))
                {
                    ResolutionsKey.Add(customKey);
                    Resolutions.Add(item);
                }
            }

            Resolutions.Sort((x, y) =>
            {
                if (x.width > y.width)
                {
                    return(-1);
                }
                else
                {
                    return(1);
                }
            });
        }