private void btn_UpLoadPicture_Click(object sender, EventArgs e) { try { OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = false; ofd.InitialDirectory = "C:\\"; if (ofd.ShowDialog(this) == DialogResult.OK) { foreach (string str in ofd.FileNames) { PictureHelp ph = new PictureHelp(); ph.FileFullName = str; ph.FileName = str.Substring(str.LastIndexOf("\\") + 1); FileInfo fi = new FileInfo(str); ph.FileSize = fi.Length.ToString(); this.pictureEdit1.Image = Image.FromFile(ph.FileFullName); this.PicturePath = ph.FileFullName; } } } catch { MessageBox.Show("Please select pictu!"); return; } }
/// <summary> /// 停止放映 /// </summary> /// <returns></returns> public bool StopPlayPPT() { bool successful = false; stopPlayPPT = true; isPPTPlaying = false; BorderImage.Opacity = borderOpacity; prePPTImage.Opacity = 0; prePPTImage.Visibility = System.Windows.Visibility.Collapsed; nowPPTImage.Visibility = System.Windows.Visibility.Collapsed; nowPPTImage.Opacity = 0; successful = true; AppPropertys.mainWindow.BorderImage.ImageSource = PictureHelp.GetBitmapImage("Img_Background.jpg"); return(successful); }
private void GetHasUpLoadFiles() { this.pictureList.Clear(); if (Directory.Exists(this.ServerSavePath + "\\" + this._productMouldSize.ProductMouldSizeId)) { string[] hasUpLoad = Directory.GetFiles(this.ServerSavePath + "\\" + this._productMouldSize.ProductMouldSizeId); foreach (string str in hasUpLoad) { PictureHelp mould = new PictureHelp(); mould.FileFullName = str; mould.FileName = str.Substring(str.LastIndexOf("\\") + 1); FileInfo fi = new FileInfo(str); mould.FileSize = fi.Length.ToString(); this.pictureList.Add(mould); } } this.bindingSource1.DataSource = this.pictureList; this.gridControl1.RefreshDataSource(); }
private void btn_UploadAccessory_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = true; ofd.InitialDirectory = "C:\\"; if (ofd.ShowDialog(this) == DialogResult.OK) { foreach (string str in ofd.FileNames) { PictureHelp mould = new PictureHelp(); mould.FileFullName = str; mould.FileName = str.Substring(str.LastIndexOf("\\") + 1); FileInfo fi = new FileInfo(str); mould.FileSize = fi.Length.ToString(); this.pictureList.Add(mould); } } this.bindingSource1.DataSource = this.pictureList; this.gridControl1.RefreshDataSource(); }
private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e) { PictureHelp mould = this.bindingSource1.Current as PictureHelp; System.Diagnostics.Process.Start(mould.FileFullName); }