UnityEditor.GameView.EnsureSelectedSizeAreValid C# (CSharp) Method

EnsureSelectedSizeAreValid() private method

private EnsureSelectedSizeAreValid ( ) : void
return void
        private void EnsureSelectedSizeAreValid()
        {
            Array values = Enum.GetValues(typeof(GameViewSizeGroupType));
            if (this.m_SelectedSizes.Length != values.Length)
            {
                Array.Resize<int>(ref this.m_SelectedSizes, values.Length);
            }
            IEnumerator enumerator = values.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    GameViewSizeGroupType current = (GameViewSizeGroupType) enumerator.Current;
                    GameViewSizeGroup group = ScriptableSingleton<GameViewSizes>.instance.GetGroup(current);
                    int index = (int) current;
                    this.m_SelectedSizes[index] = Mathf.Clamp(this.m_SelectedSizes[index], 0, group.GetTotalCount() - 1);
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            int length = this.m_LowResolutionForAspectRatios.Length;
            if (this.m_LowResolutionForAspectRatios.Length != values.Length)
            {
                Array.Resize<bool>(ref this.m_LowResolutionForAspectRatios, values.Length);
            }
            for (int i = length; i < values.Length; i++)
            {
                this.m_LowResolutionForAspectRatios[i] = GameViewSizes.DefaultLowResolutionSettingForSizeGroupType((GameViewSizeGroupType) values.GetValue(i));
            }
        }