Catrobat.IDE.Core.Formulas.Editor.FormulaEditor.PopState C# (CSharp) Method

PopState() private method

private PopState ( Stack stack ) : void
stack Stack
return void
        private void PopState(Stack<EditorState> stack)
        {
            EditorState state;
            try
            {
                state = stack.Pop();
            }
            catch (Exception)
            { return; }
            Tokens = state.Tokens == null ? null : new ObservableCollection<IFormulaToken>(state.Tokens);
            CaretIndex = state.CaretIndex;
            SelectionStart = state.SelectionStart;
            SelectionLength = state.SelectionLength;
        }