选择视频dialog函数提取到DialogUtils类中

croire 3 years ago
parent 0e9f12d3c6
commit 3699afe0fb

@ -22,5 +22,24 @@ namespace DownKyi.Utils
? string.IsNullOrEmpty(dialog.SelectedPath) ? "" : dialog.SelectedPath : ""; ? string.IsNullOrEmpty(dialog.SelectedPath) ? "" : dialog.SelectedPath : "";
} }
/// <summary>
/// 选择视频dialog
/// </summary>
/// <returns></returns>
public static string SelectVideoFile()
{
// 选择文件
var dialog = new Microsoft.Win32.OpenFileDialog
{
Filter = "mp4 (*.mp4)|*.mp4"
};
var showDialog = dialog.ShowDialog();
if (showDialog == true)
{
return dialog.FileName;
}
else { return ""; }
}
} }
} }

@ -93,7 +93,7 @@ namespace DownKyi.ViewModels.Toolbox
return; return;
} }
VideoPath = SelectVideoFile(); VideoPath = DialogUtils.SelectVideoFile();
} }
// 去水印事件 // 去水印事件
@ -172,24 +172,5 @@ namespace DownKyi.ViewModels.Toolbox
#endregion #endregion
/// <summary>
/// 选择视频dialog
/// </summary>
/// <returns></returns>
private string SelectVideoFile()
{
// 选择文件
var dialog = new Microsoft.Win32.OpenFileDialog
{
Filter = "mp4 (*.mp4)|*.mp4"
};
var showDialog = dialog.ShowDialog();
if (showDialog == true)
{
return dialog.FileName;
}
else { return ""; }
}
} }
} }

@ -60,7 +60,7 @@ namespace DownKyi.ViewModels.Toolbox
return; return;
} }
VideoPath = SelectVideoFile(); VideoPath = DialogUtils.SelectVideoFile();
} }
// 提取音频事件 // 提取音频事件
@ -155,24 +155,5 @@ namespace DownKyi.ViewModels.Toolbox
#endregion #endregion
/// <summary>
/// 选择视频dialog
/// </summary>
/// <returns></returns>
private string SelectVideoFile()
{
// 选择文件
var dialog = new Microsoft.Win32.OpenFileDialog
{
Filter = "mp4 (*.mp4)|*.mp4"
};
var showDialog = dialog.ShowDialog();
if (showDialog == true)
{
return dialog.FileName;
}
else { return ""; }
}
} }
} }

Loading…
Cancel
Save