public SettingsPage()
        {
            InitializeComponent();

            defaultFolderClassification = DefaultFolderClassification.GetDefaults();

            ClassificationNames = new ObservableCollection <string>(defaultFolderClassification.Select(x => x.ClassificationName));
            DataContext         = this;
        }
Пример #2
0
        public ValueTask ExecuteAsync(IConsole console)
        {
            var classifications = DefaultFolderClassification.GetDefaults();

            try
            {
                var organizer = new Core.FolderOrganizer(FolderToOrganize, classifications);
                organizer.LogOutput += (object sender, LogEventArgs e) =>
                {
                    console.Output.Write($"{e.Message} \n");
                };

                organizer.Organize();
            }
            catch (Exception e)
            {
                if (e is FolderNotFoundException)
                {
                    console.Error.Write("Given folder is not found. Please specify the valid folder.");
                }
            }

            return(default);
Пример #3
0
        private void organizeFolder_Click(object sender, RoutedEventArgs e)
        {
            //            System.Windows.MessageBox.Show(this, "Organizing Folder.. Please Wait...");
            statusMessage.Content = "Organizing Folder.. Please Wait...";
            _folderOrganizer      = new FolderOrganizer.Core.FolderOrganizer(selectedFolderPath.Text, DefaultFolderClassification.GetDefaults());

            _folderOrganizer.Organize();
            statusMessage.Content = "Awesome! Your folder is now organized.";
            //            System.Windows.MessageBox.Show(this, "Folder Organized");

            Process.Start(selectedFolderPath.Text);
        }