Esempio n. 1
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            SystemImageListHelper.SetListViewImageList(this, CommVar.sil_s, false);
            API.SendMessage(Handle, API.LVM_SETVIEW, API.LV_VIEW_SMALLICON, 0);
            this.ColumnClick += ListView_ColumnClick;
        }
Esempio n. 2
0
 /// <summary>
 ///   Extract the icon for the file type (Extension)
 /// </summary>
 protected virtual void SetIcon(TreeViewFolderBrowser treeView, TreeNodePath node)
 {
     // create on demand
     if (_systemImageList == null)
     {
         // Shell32 ImageList
         _systemImageList = new SystemImageList(SystemImageListSize.SmallIcons);
         SystemImageListHelper.SetTreeViewImageList(treeView, _systemImageList, false);
     }
     node.ImageIndex         = _systemImageList.IconIndex(node.Path, true);
     node.SelectedImageIndex = node.ImageIndex;
 }
Esempio n. 3
0
 protected virtual void AttachSystemImageList(TreeViewFolderBrowserHelper helper)
 {
     if (_checkboxMode != helper.TreeView.CheckboxBehaviorMode)
     {
         // checkboxes recreate the control internal
         if (_systemImageList != null)
         {
             SystemImageListHelper.SetTreeViewImageList(helper.TreeView, _systemImageList, false);
         }
     }
     _checkboxMode = helper.TreeView.CheckboxBehaviorMode;
 }
Esempio n. 4
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            SystemImageListHelper.SetTreeViewImageList(this, CommVar.sil_s, false);

            Nodes.Clear();

            foreach (DriveInfo di in DriveInfo.GetDrives())
            {
                if (di.DriveType == DriveType.Fixed && di.IsReady)
                {
                    Nodes.Add(di.Name, di.VolumeLabel + " (" + di.Name.Substring(0, 2) + ")",
                              CommVar.sil_s.IconIndex(di.Name),
                              CommVar.sil_s.IconIndex(di.Name));
                }
            }
        }
Esempio n. 5
0
        private void TabAddNew_Selected(object sender, TabControlEventArgs e)
        {
            switch (e.TabPageIndex)
            {
            case 0:
            {
                nft = CommVar.NewFolderType.CD;
                ListViewCD.Items.Clear();
                SystemImageListHelper.SetListViewImageList(ListViewCD, CommVar.sil_x, false);
                GetCD();
            }
            break;

            case 1:
            {
                nft = CommVar.NewFolderType.Removable;
                ListViewRemovable.Items.Clear();
                SystemImageListHelper.SetListViewImageList(ListViewRemovable, CommVar.sil_x, false);
                GetRemovable();
            }
            break;

            case 2:
            {
                nft = CommVar.NewFolderType.LocalFolder;

                label3.Text = "";

                comboBox1.Items.Clear();
                comboBox1.Items.Add(PublicVar.root.Collection[2].Name);
                for (int j = 3; j < PublicVar.root.Collection.Count; j++)
                {
                    comboBox1.Items.Add(PublicVar.root.Collection[j].Name);
                }
                comboBox1.SelectedIndex = 0;
            }
            break;
            }
        }
Esempio n. 6
0
        //public static void FillTreeView(CFolderCollection folders, TreeNodeCollection tnc)
        //{
        //    for (int i = 0; i<folders.Count;i++)
        //    {
        //        int selectfoldericonindex = folders[i].IconIndex == CommVar.CloseFolderIconIndex ? CommVar.OpenFolderIconIndex : folders[i].IconIndex;
        //        FillTreeView(folders[i].Folders, tnc.Add(folders[i].Name, folders[i].Name, folders[i].IconIndex, selectfoldericonindex).Nodes);
        //    }
        //}

        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            SystemImageListHelper.SetTreeViewImageList(this, CommVar.sil_s, false);
        }