Ejemplo n.º 1
0
        public GtkFileChooserDialog(string title, Window parent, FileChooserAction action) :
            base(title, parent, action)
        {
            LocalOnly = Banshee.IO.Provider.LocalOnly;
            string fallback = SafeUri.FilenameToUri(Environment.GetFolderPath(Environment.SpecialFolder.Personal));

            SetCurrentFolderUri(LastFileChooserUri.Get(fallback));
            WindowPosition = WindowPosition.Center;
        }
Ejemplo n.º 2
0
        private IEnumerable <string> GetDirectories(GLib.File dir, bool followSymlinks)
        {
            var enumerator = dir.EnumerateChildren("standard::type,standard::name", followSymlinks ? FileQueryInfoFlags.None : FileQueryInfoFlags.NofollowSymlinks, null);

            foreach (FileInfo file in enumerator)
            {
                if ((file.FileType & FileType.Directory) != 0)
                {
                    var ret = SafeUri.FilenameToUri(System.IO.Path.Combine(dir.Path, file.Name));
                    file.Dispose();
                    yield return(ret);
                }
                else
                {
                    file.Dispose();
                }
            }
            if (!enumerator.IsClosed)
            {
                enumerator.Close(null);
                enumerator.Dispose();
            }
        }