private void btnMovePrev_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            #region #MovePrev
            bool   result = false;
            string s      = string.Empty;
            // Create a new iterator if the document has been changed and the layout is updated.
            if (!layoutIterator.IsLayoutValid)
            {
                CreateNewIterator();
            }

            switch (barEditItemRgLevel.EditValue.ToString())
            {
            case "Any":
                result = layoutIterator.MovePrevious();
                break;

            case "Level":
                result = layoutIterator.MovePrevious((LayoutLevel)cmbLayoutLevel.EditValue);
                break;

            case "LevelWithinParent":
                result = layoutIterator.MovePrevious((LayoutLevel)cmbLayoutLevel.EditValue, false);
                break;
            }

            if (!result)
            {
                s = "Cannot move.";
                if (layoutIterator.IsStart)
                {
                    s += "\nStart is reached.";
                }
                else if (layoutIterator.IsEnd)
                {
                    s += "\nEnd is reached.";
                }
                MessageBox.Show(s);
            }
            #endregion #MovePrev
            UpdateInfoAndSelection();
        }
示例#2
0
        private void btnMovePrev_ItemClick(object sender, ItemClickEventArgs e)
        {
            #region #MovePrev
            bool   result = false;
            string s      = string.Empty;
            // Create a new iterator if the document has been changed and the layout is updated.
            if (!layoutIterator.IsLayoutValid)
            {
                CreateNewIterator();
            }

            switch (rgLevel.EditValue.ToString())
            {
            case "Traverse Entire Tree":
                result = layoutIterator.MovePrevious();
                break;

            case "Limit Traversal Depth":
                result = layoutIterator.MovePrevious((LayoutLevel)cmbLayoutLevel.EditValue);
                break;

            case "Stay in Parent Node and Limit Traversal Depth":
                result = layoutIterator.MovePrevious((LayoutLevel)cmbLayoutLevel.EditValue, false);
                break;
            }

            if (!result)
            {
                s = "Cannot move.";
                if (layoutIterator.IsStart)
                {
                    s += "\nStart is reached.";
                }
                else if (layoutIterator.IsEnd)
                {
                    s += "\nEnd is reached.";
                }
                MessageBox.Show(s);
            }
            #endregion #MovePrev
            UpdateInfoAndSelection();
        }