private void listBox1_doubleClick(object sender, EventArgs e) { if (listBox1.SelectedItem.ToString() == null) { return; } UniValue file = (UniValue)listBox1.SelectedItem; if (file["path"] == "..") { if (this.CurrentPath != "/") { this.CurrentPath = Path.GetDirectoryName(this.CurrentPath).Replace("\\", "/"); } } else if (Regex.IsMatch(file["path"].ToString(), "jpg", RegexOptions.IgnoreCase) || Regex.IsMatch(file["path"].ToString(), "png", RegexOptions.IgnoreCase)) { //MessageBox.Show(file["path"].ToString() + "\n" + Path.GetDirectoryName(file["path"].ToString()).Replace("\\", "/")); //MessageBox.Show("C:\\Users\\" + Environment.UserName + "\\Dropbox"); Edit_Image edit_image = new Edit_Image("C:\\Users\\" + Environment.UserName + "\\Dropbox" + Path.GetDirectoryName(file["path"].ToString()) , "C:\\Users\\" + Environment.UserName + "\\Dropbox\\" + file["path"].ToString()); edit_image.Show(); } else { if (file["is_dir"] == 1) { this.CurrentPath = file["path"].ToString(); } else { saveFileDialog1.FileName = Path.GetFileName(file["path"].ToString()); //MessageBox.Show(file["path"].ToString()); if (saveFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } var web = new WebClient(); web.DownloadProgressChanged += DownloadProgressChanged; web.DownloadFileAsync(new Uri(String.Format("https://content.dropboxapi.com/1/files/auto{0}?access_token={1}", file["path"], Properties.Settings.Default.AccessToken)), saveFileDialog1.FileName); } } this.GetFiles(); }
private void imageListView1_itemDoubleClick(object sender, ItemClickEventArgs e) { ImageListViewItem item = imageListView_EditProject.SelectedItems[0]; //string mPath = @"C:\Users\" + Environment.UserName + "\\Dropbox\\IMAGE\\" + item.FolderName + "\\"; Edit_Image editImage = new Edit_Image(myPath, item.FileName, pData, sData, user_id, total_data); editImage.TopLevel = false; editImage.AutoScroll = true; this.panel_content_right.Controls.Add(editImage); editImage.FormBorderStyle = FormBorderStyle.None; editImage.Location = new Point(0, 0); editImage.Dock = DockStyle.Fill; editImage.Show(); editImage.BringToFront(); btn_editImage_back.Visible = true; btn_editImage_save.Visible = true; btnAddImages.Visible = false; //panel_editImage_forms.BringToFront(); }
/*private void eachButton_Click(object sender, EventArgs e) { // 영민이형이 한거 불러오기 Button temp_btn = sender as Button; string mPath = myPath + "\\" + temp_btn.Name; Edit_Image editProject = new Edit_Image(myPath, mPath); editProject.Show(); }*/ private void eachButton_Click(object sender, MouseEventArgs e) { //MouseEventArgs me = (MouseEventArgs)e; switch (e.Button) { case MouseButtons.Left: Button temp_btn = sender as Button; string mPath = myPath + "\\" + temp_btn.Name; Edit_Image editProject = new Edit_Image(myPath, mPath); editProject.Show(); break; case MouseButtons.Right: //MessageBox.Show("Right click", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information); Button temp_btn_right = sender as Button; ContextMenu cm = new ContextMenu(); cm.MenuItems.Add("Delete", new System.EventHandler(this.menuItem_delete_click)); cm.MenuItems.Add("Item 2"); temp_btn_right.ContextMenu = cm; TempDeleteButton = temp_btn_right; break; } }
private void eachButton_Click(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: Button temp_btn = sender as Button; string mPath = myPath + "\\" + temp_btn.Name; Edit_Image editImage = new Edit_Image(myPath, mPath, pData, sData, user_id, total_data); editImage.TopLevel = false; editImage.AutoScroll = true; this.panel_content_right.Controls.Add(editImage); editImage.FormBorderStyle = FormBorderStyle.None; editImage.Location = new Point(0, 0); editImage.Dock = DockStyle.Fill; editImage.Show(); editImage.BringToFront(); break; case MouseButtons.Right: Button temp_btn_right = sender as Button; ContextMenu cm = new ContextMenu(); cm.MenuItems.Add("Delete", new System.EventHandler(this.menuItem_delete_click)); cm.MenuItems.Add("Item 2"); temp_btn_right.ContextMenu = cm; TempDeleteButton = temp_btn_right; break; } }