예제 #1
0
        private void PopulatePublisherNodes(string publisherFilter, bool showIncluded, bool showIgnored, UltraTreeNode rootNode, bool showAliasedPublishers)
        {
            rootNode.Override.NodeStyle = NodeStyle.Standard;

            PublisherAliasDAO lPublisherAliasDao       = new PublisherAliasDAO();
            List <string>     existingTargetPublishers = lPublisherAliasDao.SelectAliasedToPublishers();

            // Add the publishers to the tree
            try
            {
                UltraTreeNode publisherNode;

                //DataTable dt = new ApplicationsDAO().GetAllPublisherNamesAsDataTable(publisherFilter);
                DataTable dt = new ApplicationsDAO().GetAllPublisherNamesAsDataTable(publisherFilter, _showIncluded, _showIgnored);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string lPublisher = dt.Rows[i][0].ToString();

                    publisherNode = new UltraTreeNode(rootNode.Key + @"|" + lPublisher, lPublisher);
                    publisherNode.Override.NodeStyle = _selectionType == eSelectionType.all ? NodeStyle.CheckBox : NodeStyle.Standard;
                    publisherNode.Tag = rootNode.Tag;

                    if (!showAliasedPublishers)
                    {
                        if (!existingTargetPublishers.Contains(publisherNode.Text))
                        {
                            rootNode.Nodes.Add(publisherNode);
                        }
                    }
                    else
                    {
                        rootNode.Nodes.Add(publisherNode);
                    }
                }

                rootNode.Expanded = true;
            }

            catch (Exception)
            {
                // JML TODO log this error
            }

            // Expand the root node to show the publishers
            rootNode.Expanded = true;
        }