Пример #1
0
        public FileTag(Hashtable options)
        {
            StatusEvent.FireStatusError(this, statusEvent, Globalisation.GetString(""));
            if (options.ContainsKey("Db"))
            {
                this.Db = (MyDatabase)options["Db"];
            }

            if (options.ContainsKey("Form"))
            {
                this.Form = (Form1)options["Form"];
            }

            if (options.ContainsKey("listview"))
            {
                this.ListView = (ListView)options["listview"];
                this.ListView.MouseDown += new MouseEventHandler(mouseDown_ListView);

                this.ListView.OwnerDraw = true;
                this.ListView.DrawItem += new DrawListViewItemEventHandler(ListView_DrawItem);
            }

            if (options.ContainsKey("infopanel"))
            {
                this.Infopanel = (RichTextBox)options["infopanel"];
            }

            if (options.ContainsKey("GridFile"))
            {
                this.GridFile = (GridFile)options["GridFile"];
                this.GridFileListView = this.GridFile.GetListView();
                //this.GridFileListView.MouseDown += new MouseEventHandler(mouseDown_LoadTag);
                this.GridFileListView.SelectedIndexChanged += new System.EventHandler(this.center_listview_SelectedIndexChanged);
            }
        }
        public DirectorySelection(MyDatabase db)
        {
            this.Db = db;

            InitializeComponent();

            // Load Combo repertoire
            this.ReloadComboDirectory();
        }
Пример #3
0
        public ToolsOptions(MyDatabase db)
        {
            this.Db = db;

            InitializeComponent();

            this.gridFile_ListSize.Maximum = int.MaxValue;

            this.LoadPanelConfig(this.tabPage1);

            // etiquettes grid
            this.etiquette_GridView.ColumnCount = 2;
            this.etiquette_GridView.Columns[0].Name = "Tag";
            this.etiquette_GridView.Columns[1].Name = "Nombre de fichiers";
            List<Hashtable> aExt = this.Db.getTagCount();
            int i = 0;
            foreach (Hashtable ext in aExt)
            {
                this.etiquette_GridView.Rows.Add();
                this.etiquette_GridView.Rows[i].Cells[0].Value = ext["name"].ToString();
                this.etiquette_GridView.Rows[i].Cells[1].Value = ext["ct"].ToString().ToInt();
                i++;
            }

            this.label_nombrefichier.Text = this.Db.getFileCount().ToString();
            this.label_taillefichier.Text = this.Db.getFileSize().ToFileSize();

            // Combo chart
            //stat_comboCHart
            var dataSource = new List<ComboItem>();
            dataSource.Add(new ComboItem() { Value = "1", Name = "Taille fichier par extension" });
            dataSource.Add(new ComboItem() { Value = "2", Name = "Taille fichier par type" });

            dataSource.Add(new ComboItem() { Value = "3", Name = "Nombre fichier par extension" });
            dataSource.Add(new ComboItem() { Value = "4", Name = "Nombre fichier par type" });

            dataSource.Add(new ComboItem() { Value = "5", Name = "Nombre fichier par taille" });

            this.stat_comboCHart.DataSource = dataSource;
            this.stat_comboCHart.DisplayMember = "Name";
            this.stat_comboCHart.ValueMember = "Value";
            this.stat_comboCHart.SelectedIndex = 0;
        }
Пример #4
0
        public TreeGroup(Hashtable options)
        {
            if (options.ContainsKey("Db"))
            {
                this.Db = (MyDatabase)options["Db"];
            }

            if (options.ContainsKey("tree"))
            {
                this.Tree = (TreeView)options["tree"];
                this.Tree.HideSelection = false;
                this.Tree.CheckBoxes = false;
                this.Tree.AllowDrop = true;
                this.Tree.ShowNodeToolTips = true;
                //this.Tree.ShowRootLines = false;
                this.Tree.ShowLines = false;
                this.Tree.ShowPlusMinus = true;
                //Enable custom drawing
                //this.Tree.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll;
                //this.Tree.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.treeView_DrawNode);

                // event
                this.Tree.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.left_treeview_AfterLabelEdit);
                this.Tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.left_treeview_AfterSelect);
                this.Tree.MouseDown += new System.Windows.Forms.MouseEventHandler(this.left_treeview_MouseDown);

                // Drag & drop
                this.Tree.DragEnter += new DragEventHandler(dragEnter);
                this.Tree.DragDrop += new DragEventHandler(dragDrop);
                this.Tree.DragOver += new DragEventHandler(treeView_DragOver);

                this.Tree.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeView_ItemDrag);
            }

            if(options.ContainsKey("contextmenu"))
                this.setContextMenu((ContextMenuStrip) options["contextmenu"]);

            if (options.ContainsKey("autoLoad") && (bool)options["autoLoad"])
            {
                this.Load();
            }
        }
Пример #5
0
        public TagContainer(Hashtable options)
        {
            StatusEvent.FireStatusError(this, statusEvent, Globalisation.GetString(""));
            if (options.ContainsKey("Db"))
            {
                this.Db = (MyDatabase)options["Db"];
            }

            if (options.ContainsKey("listview"))
            {
                this.ListView = (ListView)options["listview"];
                this.ListView.View = System.Windows.Forms.View.LargeIcon;
                this.ListView.MouseDown += new MouseEventHandler(mouseDown);
            }

            if (options.ContainsKey("GridFile"))
            {
                this.GridFile = (GridFile)options["GridFile"];
            }
        }
Пример #6
0
        public Form1()
        {
            InitializeComponent();

            this.StartPosition = FormStartPosition.CenterScreen;

            this.statusEvent += h_statusInfo;

            #region mulilanguage

            /*
             * Set multilanguage
             */
            // left menu
            this.ApplyMultiLangueToToolbar(this.left_toolStrip1);
            // Top menu
            this.ApplyMultiLangueToToolbar(this.top_toolstrip);
            // center menu
            this.ApplyMultiLangueToToolbar(this.center_toolstrip);
            // left tree contextmenu
            this.ApplyMultiLangueToDDMenu(this.left_treectxmenu);
            // center grid contextmenu
            this.ApplyMultiLangueToDDMenu(this.center_grid_contextmenu);
            // center bottom menu (selected tag liste)
            this.ApplyMultiLangueToToolbar(this.center_bottom_TagtoolStrip1);

            #endregion

            this.Db = new MyDatabase();

            // Init tree group
            Hashtable treeOption = new Hashtable();
            treeOption["Db"] = this.Db;
            treeOption["tree"] = this.left_treeview;
            treeOption["contextmenu"] = this.left_treectxmenu;
            treeOption["autoLoad"] = true;
            this.TreeGroup = new TreeGroup(treeOption);
            this.TreeGroup.statusEvent += h_statusInfo;

            // Init center listview
            Hashtable listviewOption = new Hashtable();
            listviewOption["Db"] = this.Db;
            listviewOption["Form"] = this;
            listviewOption["listview"] = this.center_listview;
            listviewOption["contextmenu"] = this.center_grid_contextmenu;
            this.GridFile = new GridFile(listviewOption);
            this.GridFile.statusEvent += h_statusInfo;

            // Init center bottom Tag Container
            Hashtable tagContainerOption = new Hashtable();
            tagContainerOption["Db"] = this.Db;
            tagContainerOption["listview"] = this.center_bottomLIstView;
            tagContainerOption["GridFile"] = this.GridFile;
            this.TagContainer = new TagContainer(tagContainerOption);
            this.TagContainer.statusEvent += h_statusInfo;

            // Init right File Info
            Hashtable fileTagOption = new Hashtable();
            fileTagOption["Db"] = this.Db;
            fileTagOption["Form"] = this;
            fileTagOption["listview"] = this.right_listviewTag;
            fileTagOption["infopanel"] = this.right_bottom_FileInfoContainer;
            fileTagOption["GridFile"] = this.GridFile;
            this.FileTag = new FileTag(fileTagOption);
            this.FileTag.statusEvent += h_statusInfo;
            DelegateFileTag = new FileTagLoadList(LoadTagWithList);

            // load lisy type fichier (center toolbar)
            this.ReloadComboTypeFile();
        }
Пример #7
0
        public GridFile(Hashtable options)
        {
            if (options.ContainsKey("Db"))
            {
                this.Db = (MyDatabase)options["Db"];
            }

            if (options.ContainsKey("Form"))
            {
                this.Form = (Form1)options["Form"];
            }

            if (options.ContainsKey("listview"))
            {
                this.ListView = (ListView) options["listview"];
                this.ListView.AllowColumnReorder = false;

                this.SetView(System.Windows.Forms.View.Details);

                this.ListView.FullRowSelect = true;
                this.ListView.GridLines = true;
                this.ListView.AllowDrop = false;
                this.ListView.HideSelection = false;
                //this.ListView.ShowItemToolTips = true;

                // D&D
                this.ListView.MouseDown += new MouseEventHandler(mouseDown);
                this.ListView.DragOver += new DragEventHandler(dragOver);

                // event
                this.ListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.center_listview_ColumnClick);
                this.ListView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.center_listview_MouseClick);
                this.ListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.center_listview_KeyDown);

                ColumnHeader column1 = new ColumnHeader();
                column1.Text = Globalisation.GetString("File_name");
                column1.TextAlign = HorizontalAlignment.Left;
                column1.Width = 300;

                ColumnHeader column2 = new ColumnHeader();
                column2.Text = Globalisation.GetString("Extension");
                column2.TextAlign = HorizontalAlignment.Left;
                column2.Width = 50;

                /*
                ColumnHeader column3 = new ColumnHeader();
                column3.Text = Globalisation.GetString("File_size")+ " (o)";
                column3.TextAlign = HorizontalAlignment.Right;
                column3.Width = 90;
                */

                ColumnHeader column4 = new ColumnHeader();
                column4.Text = Globalisation.GetString("File_size");
                column4.TextAlign = HorizontalAlignment.Right;
                column4.Width = 40;

                ColumnHeader column5 = new ColumnHeader();
                column5.Text = Globalisation.GetString("Date");
                column5.TextAlign = HorizontalAlignment.Left;
                column5.Width = 80;

                this.ListView.Columns.AddRange(new ColumnHeader[] {
                    column1, column2, column4, column5
                });

                // Add sorter
                //lvwColumnSorter = new ListViewColumnSorter();
                //this.ListView.ListViewItemSorter = lvwColumnSorter;
            }
            if (options.ContainsKey("contextmenu"))
            {
                this.setContextMenu((ContextMenuStrip)options["contextmenu"]);
            }

            if (options.ContainsKey("autoLoad") && (bool)options["autoLoad"])
            {
                this.Load();
            }
        }