Exemple #1
0
        public override void OnFileAdded(FilePath file)
        {
            base.OnFileAdded(file);

            if (!extensions.IsMatch(file))
            {
                return;
            }

            using (var dlg = new TargetPickerDialog("Pick a target", fileFormat)) {
                if (MessageService.ShowCustomDialog(dlg) != (int)ResponseType.Ok)
                {
                    return;
                }

                foreach (var target in dlg.SelectedTargets)
                {
                    target.AddFile(file.CanonicalPath.ToRelative(fileFormat.File.ParentDirectory));
                }
            }

            fileFormat.SaveAll();
        }
Exemple #2
0
        public override void OnFilesAdded(List <FilePath> files)
        {
            base.OnFilesAdded(files);

            var filesToAdd = new List <FilePath> ();

            foreach (var file in files)
            {
                if (extensions.IsMatch(file))
                {
                    filesToAdd.Add(file);
                }
            }

            if (filesToAdd.Count == 0)
            {
                return;
            }

            using (var dlg = new TargetPickerDialog("Pick a target", fileFormat)) {
                if (MessageService.ShowCustomDialog(dlg) != (int)ResponseType.Ok)
                {
                    return;
                }

                foreach (var target in dlg.SelectedTargets)
                {
                    foreach (var file in filesToAdd)
                    {
                        target.AddFile(file.CanonicalPath.ToRelative(fileFormat.File.ParentDirectory));
                    }
                }
            }

            fileFormat.SaveAll();
        }