Пример #1
0
        /// <summary>
        /// Selects the specified item in the content view.
        /// </summary>
        /// <param name="item">The item to select.</param>
        public void Select(ContentItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException();
            }

            if (!_navigationUnlocked)
            {
                return;
            }
            var parent = item.ParentFolder;

            if (parent == null || !parent.Visible)
            {
                return;
            }

            // Ensure that window is visible
            FocusOrShow();

            // Navigate to the parent directory
            Navigate(parent.Node);

            // Select and scroll to cover in view
            _view.Select(item);
            _split.Panel2.ScrollViewTo(item);

            // Focus
            _view.Focus();
        }