Exemple #1
0
        private void SourcePathChanged()
        {
            string validationResult;

            if (!PathUtils.IsFolderPathValid(SourcePath, out validationResult))
            {
                PathErrorText = validationResult;
                return;
            }

            PathErrorText = null;
            FoldersList.Clear();
            foreach (var folderPath in Directory.GetDirectories(SourcePath))
            {
                FoldersList.Add(new ClickOnceFolderInfo(folderPath));
            }
        }
Exemple #2
0
        private void OnScanFolderCommand()
        {
            try
            {
                FoldersList.Clear();

                if (string.IsNullOrEmpty(WorkingFolder))
                {
                    Logger.Log.Warn("Working folder was not selected - nothing to scan");
                    return;
                }

                if (!Directory.Exists(WorkingFolder))
                {
                    Logger.Log.Warn("Selected Working folder is invalid - unable to scan");
                    return;
                }

                // get folders in root folder
                var rootSubFolders = Directory.GetDirectories(WorkingFolder, "*.", SearchOption.TopDirectoryOnly);

                // create hierarchical folders list
                foreach (var subFolder in rootSubFolders)
                {
                    var sub = new SoftwareDirectoryViewModel(subFolder);
                    if (sub.Init(ShowAllFolders))
                    {
                        FoldersList.Add(sub);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex);
            }
        }