Exemple #1
0
        internal static void initFTPServerList(ListView settingList, string serverKey)
        {
            SettingListItem listViewItem = new SettingListItem();

            listViewItem.ImageIndex = 4;
            listViewItem.Text       = "Add FTP Server";
            listViewItem.Name       = "addFTPServer";
            listViewItem.FullPath   = serverKey;
            settingList.Items.Clear();

            iniFTPServerListHeader(settingList);
            settingList.Items.Add(listViewItem);

            /*
             * If new items are added to the ListView,
             * the columns will not resize unless AutoResizeColumns is called again.
             */
            settingList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
Exemple #2
0
        internal static void initAdminServerList(ListView settingList, SortedDictionary <string, AdminServer> adminServerList, string rootNodePath)
        {
            AdminServer     adminServer;
            SettingListItem listViewItem;

            initNormalSettingListHeader(settingList);
            settingList.Items.Clear();
            if (adminServerList.Count == 0)
            {
                listViewItem            = new SettingListItem();
                listViewItem.ImageIndex = 4;
                listViewItem.Text       = "Add Admin. Server";
                listViewItem.Name       = "addAdminServer";

                initNormalSettingListHeader(settingList);
                settingList.Items.Add(listViewItem);
            }
            else
            {
                foreach (string key in adminServerList.Keys)
                {
                    adminServer             = adminServerList[key];
                    listViewItem            = new SettingListItem();
                    listViewItem.FullPath   = rootNodePath + "\\" + key;
                    listViewItem.Text       = key;
                    listViewItem.Name       = "adminServer";
                    listViewItem.ImageIndex = 2;
                    settingList.Items.Add(listViewItem);
                }
            }

            /*
             * If new items are added to the ListView,
             * the columns will not resize unless AutoResizeColumns is called again.
             */
            settingList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
Exemple #3
0
        internal static void updateList(ListView settingList, TreeNode node)
        {
            SettingListItem listViewItem;

            initNormalSettingListHeader(settingList);
            settingList.Items.Clear();
            foreach (ItemNode childNode in node.Nodes)
            {
                listViewItem = new SettingListItem();
                //listViewItem.serverKey = childNode.FullPath.Split('\\')[1];
                listViewItem.Text     = childNode.Text;
                listViewItem.Name     = childNode.Name;
                listViewItem.FullPath = childNode.FullPath;
                listViewItem.SubItems.Add(childNode.Description);
                listViewItem.ImageIndex = childNode.ImageIndex;
                settingList.Items.Add(listViewItem);
            }

            /*
             * If new items are added to the ListView,
             * the columns will not resize unless AutoResizeColumns is called again.
             */
            settingList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }