コード例 #1
0
 FileChooser(IFileChooserModel model, Action closeAction, bool allowMultipleSelection)
 {
     _closeAction           = closeAction;
     Attachments            = new List <string>();
     Drives                 = model.FetchDrives().Select(a => new FileListingModel(model, a, () => OnPropertyChanged("DriveName"), !allowMultipleSelection)).ToList();
     CancelCommand          = new DelegateCommand(o => Cancel());
     SaveCommand            = new DelegateCommand(o => Save());
     AllowMultipleSelection = allowMultipleSelection;
     FilesTooltip           = Resources.Languages.Tooltips.ManagePluginSourceFilesConfigTooltip;
     SelectTooltip          = Resources.Languages.Tooltips.ManagePluginSourceSelectConfigFileTooltip;
     if (AllowMultipleSelection)
     {
         FilesTooltip  = Resources.Languages.Tooltips.ManageEmailAttachmentDriveNameTooltip;
         SelectTooltip = Resources.Languages.Tooltips.ManageEmailAttachmentAttachTooltip;
     }
 }
コード例 #2
0
 public FileListingModel(IFileChooserModel model, IFileListing file, Action selected, bool useIsSelected)
 {
     _model          = model;
     _selectedAction = selected;
     UseIsSelected   = useIsSelected;
     if (file != null)
     {
         Name     = file.Name;
         FullName = file.FullName;
         if (file.Children != null && file.Children.Count > 0)
         {
             Children = new AsyncObservableCollection <IFileListingModel>(
                 file.Children.Select(input => new FileListingModel(_model, input, selected, useIsSelected)));
         }
         IsDirectory       = file.IsDirectory;
         IsExpanderVisible = IsDirectory;
         IsVisible         = true;
         _file             = file;
     }
 }
コード例 #3
0
 public FileListingModel(IFileChooserModel model, IFileListing file, Action selected)
     : this(model, file, selected, false)
 {
 }
コード例 #4
0
 public FileChooser(IList <string> attachments, IFileChooserModel model, Action closeAction, bool allowMultipleSelection)
     : this(model, closeAction, allowMultipleSelection)
 {
     Attachments = attachments;
     Expand(attachments);
 }