Show confirmation msg box before running file if file type is not image, text or video

This commit is contained in:
Jaex 2019-05-22 11:19:19 +03:00
parent 8a80f56653
commit 74c5172778

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.Properties;
using System;
using System.Drawing;
using System.IO;
@ -257,7 +258,8 @@ private void PbThumbnail_MouseClick(object sender, MouseEventArgs e)
pbThumbnail.Enabled = true;
}
}
else
else if (Helpers.IsTextFile(filePath) || Helpers.IsVideoFile(filePath) || MessageBox.Show("Would you like to run this file?" + "\r\n\r\n" + filePath,
Resources.ShareXConfirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Helpers.OpenFile(filePath);
}