Esempio n. 1
0
 public SelectFileDialogFilter AddFilter(SelectFileDialogFilter filter)
 {
     if (useDefaultFilters)
     {
         throw new InvalidOperationException("Cannot mix default filters and custom filters");
     }
     data.Filters.Add(filter);
     return(filter);
 }
Esempio n. 2
0
 static IEnumerable <SelectFileDialogFilter> ParseFilters(System.Collections.IEnumerable filterStrings)
 {
     if (filterStrings == null)
     {
         yield break;
     }
     foreach (string filterStr in filterStrings)
     {
         var parts = filterStr.Split('|');
         var f     = new SelectFileDialogFilter(parts[0], parts[1].Split(';'));
         yield return(f);
     }
 }
        internal void GetDefaultProperties(FileSelector fdiag)
        {
            data.SelectedFiles = fdiag.Filenames.ToFilePathArray();
            var currentFilter = fdiag.Filter;

            if (currentFilter != null)
            {
                var name = fdiag.Filter.Name;
                var def  = data.Filters.Where(f => f.Name == name).FirstOrDefault();
                if (def != null)
                {
                    DefaultFilter = def;
                }
            }
        }
Esempio n. 4
0
 public SelectFileDialogFilter AddFilter(SelectFileDialogFilter filter)
 {
     return(data.FilterSet.AddFilter(filter));
 }
 public SelectFileDialogFilter AddFilter(SelectFileDialogFilter filter)
 {
     data.Filters.Add(filter);
     return(filter);
 }