コード例 #1
0
        /// <summary>
        /// Sets the selected documents.
        /// </summary>
        /// <param name="selectedDocuments">The selected documents.</param>
        /// <exception cref="ArgumentNullException"><paramref name="selectedDocuments"/> is null.</exception>
        internal void SetSelectedDocuments(DocumentIdCollection selectedDocuments)
        {
            if (selectedDocuments == null)
            {
                throw new ArgumentNullException(nameof(selectedDocuments));
            }

            _suppressSelectionChanged = true;

            // No other way to clear CheckedNodes.
            foreach (RadTreeNode checkedNode in documentTreeView.CheckedNodes.ToList())
            {
                checkedNode.Checked = false;
            }

            foreach (Guid id in selectedDocuments)
            {
                if (_docTreeNodes.TryGetValue(id, out RadTreeNode node))
                {
                    node.Checked = true;
                }
            }

            _suppressSelectionChanged = false;
        }
コード例 #2
0
 /// <summary>
 /// Initializes this control by loading documents with the specified extensions from the document library
 /// with the specified documents selected.
 /// </summary>
 /// <param name="selectedDocuments">The selected documents.</param>
 /// <param name="extensions">The extensions of the documents to load.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="selectedDocuments" /> is null.
 /// <para>or</para>
 /// <paramref name="extensions" /> is null.
 /// </exception>
 public void Initialize(DocumentIdCollection selectedDocuments, IEnumerable <DocumentExtension> extensions)
 {
     Initialize(extensions);
     SetSelectedDocuments(selectedDocuments);
 }
コード例 #3
0
 /// <summary>
 /// Initializes this control by loading documents matching the specified filter from the document library
 /// with the specified documents selected.
 /// </summary>
 /// <param name="selectedDocuments">The selected documents.</param>
 /// <param name="filterCriteria">The criteria for the documents to load.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="selectedDocuments" /> is null.
 /// <para>or</para>
 /// <paramref name="filterCriteria" /> is null.
 /// </exception>
 public void Initialize(DocumentIdCollection selectedDocuments, DocumentQuery filterCriteria)
 {
     Initialize(filterCriteria);
     SetSelectedDocuments(selectedDocuments);
 }
コード例 #4
0
 /// <summary>
 /// Initializes this control by loading all documents from the document library
 /// with the specified documents selected.
 /// </summary>
 /// <param name="selectedDocuments">The selected documents.</param>
 /// <exception cref="ArgumentNullException"><paramref name="selectedDocuments" /> is null.</exception>
 public void Initialize(DocumentIdCollection selectedDocuments)
 {
     Initialize();
     SetSelectedDocuments(selectedDocuments);
 }