mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-04-09 19:15:41 +02:00
Add project input method with a folder dialog
This commit is contained in:
parent
05acb7ff66
commit
4ab46b1d41
CodeStatistics
@ -52,7 +52,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConsoleUtil\ConsoleWrapper.cs" />
|
||||
<Compile Include="Input\FileDialog.cs" />
|
||||
<Compile Include="Input\MultiFolderDialog.cs" />
|
||||
<Compile Include="Input\IProjectInputMethod.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
7
CodeStatistics/Input/IProjectInputMethod.cs
Normal file
7
CodeStatistics/Input/IProjectInputMethod.cs
Normal file
@ -0,0 +1,7 @@
|
||||
using CodeStatistics.ConsoleUtil;
|
||||
|
||||
namespace CodeStatistics.Input{
|
||||
interface IProjectInputMethod{
|
||||
string[] Run(string[] args);
|
||||
}
|
||||
}
|
18
CodeStatistics/Input/MultiFolderDialog.cs
Normal file
18
CodeStatistics/Input/MultiFolderDialog.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CodeStatistics.Input{
|
||||
class MultiFolderDialog : IProjectInputMethod{
|
||||
public string[] Run(string[] args){
|
||||
OpenFileDialog dialog = new OpenFileDialog();
|
||||
dialog.Filter = "Folders|\n";
|
||||
dialog.CheckFileExists = false;
|
||||
dialog.CheckPathExists = true;
|
||||
dialog.DereferenceLinks = true;
|
||||
dialog.AddExtension = false;
|
||||
dialog.Multiselect = true;
|
||||
dialog.AutoUpgradeEnabled = true;
|
||||
dialog.ShowDialog();
|
||||
return dialog.FileNames;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user