99 lines
2.7 KiB
C#
99 lines
2.7 KiB
C#
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using file_finder__test;
|
|
using ShadowStream;
|
|
using ShadowStream.LogHelper;
|
|
using ShadowStream.Obejeckte;
|
|
using System.Threading;
|
|
|
|
namespace ModuleManager;
|
|
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
//Quinn and Reda and Yazan
|
|
public partial class MainWindow : Window
|
|
{
|
|
private static LogHelper loghelper = new LogHelper();
|
|
LogWindow log = new LogWindow(loghelper.GetEntries());
|
|
|
|
private Catagory Muvie = new Catagory("Muvie");
|
|
private Catagory Serie = new Catagory("Serie");
|
|
private Catagory Music = new Catagory("Music");
|
|
private Catagory Photo = new Catagory("Photos");
|
|
|
|
List<string> suportedVidioFiles = new List<string>();
|
|
List<string> suportedMusicFiles = new List<string>();
|
|
List<string> suportedPhotoFiles = new List<string>();
|
|
|
|
List<string> dirs = new List<string>();
|
|
FileScanner fileScanner;
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
//Initialise but Hide
|
|
log.Hide();
|
|
this.Hide();
|
|
//Begin Login Process
|
|
var login = new LogIn();
|
|
login.Show();
|
|
//adding all extensions... example values added
|
|
suportedVidioFiles.Add("mp4");
|
|
suportedVidioFiles.Add("mkv");
|
|
suportedMusicFiles.Add("wav");
|
|
suportedMusicFiles.Add("mp3");
|
|
suportedPhotoFiles.Add("jpg");
|
|
Createscan();
|
|
dirs.Add("C:/");
|
|
|
|
//execute and wait for task completion
|
|
var tmp = fileScanner.ScanAllDrivesAsync();
|
|
|
|
//load json parallel to finding drives
|
|
//add code laiter
|
|
|
|
tmp.Wait();
|
|
foreach (var VARIABLE in tmp.Result)
|
|
{
|
|
dirs.Add(VARIABLE);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
void LoadFromJson(string path, object obj)
|
|
{
|
|
|
|
}
|
|
void Createscan()
|
|
{
|
|
int count = 0;
|
|
string[] tmp = new string[suportedMusicFiles.Count + suportedVidioFiles.Count + suportedPhotoFiles.Count];
|
|
foreach (var suportedVidioFile in suportedVidioFiles)
|
|
{
|
|
tmp[count] = suportedVidioFile;
|
|
count++;
|
|
}
|
|
|
|
foreach (var suportedMusicFile in suportedMusicFiles)
|
|
{
|
|
tmp[count] = suportedMusicFile;
|
|
count++;
|
|
}
|
|
|
|
foreach (var suportedPhotoFile in suportedPhotoFiles)
|
|
{
|
|
tmp[count] = suportedPhotoFile;
|
|
count++;
|
|
}
|
|
fileScanner = new FileScanner(tmp);
|
|
}
|
|
} |