Пример #1
0
        Explorer Explore(string location)
        {
            //! propagate the provider, or performance sucks
            var newExplorer = new ItemExplorer(location);

            newExplorer.Provider = Provider;
            newExplorer.Columns  = Columns;
            return(newExplorer);
        }
Пример #2
0
        private void DoExplored(ItemExplorer explorer)
        {
            var info1 = explorer == null ? null : explorer.Info();
            var info2 = Explorer.Info();

            // fixed drive?
            if (Drive.Length > 0 && !Kit.Equals(Drive, info2.DriveName))
            {
                return;
            }

            // customise if not yet
            if (Drive.Length == 0 && (explorer == null || info1.Provider.ImplementingType != info2.Provider.ImplementingType))
            {
                if (string.IsNullOrEmpty(Drive))
                {
                    Columns = null;
                    ExcludeMemberPattern = null;

                    System.Collections.IDictionary options = A.Psf.Providers[info2.Provider.Name] as System.Collections.IDictionary;
                    if (options != null)
                    {
                        try
                        {
                            Converter.SetProperties(this, options, true);
                        }
                        catch (ArgumentException ex)
                        {
                            throw new InvalidDataException("Invalid settings for '" + info2.Provider.Name + "' provider: " + ex.Message);
                        }
                    }
                }
            }

            // Set-Location, the core remembers it for the drive, this is handy
            A.Psf.Engine.SessionState.Path.SetLocation(Kit.EscapeWildcard(Explorer.Location));

            //! path is used for Set-Location on Invoking()
            Title           = "Items: " + Explorer.Location;
            CurrentLocation = Explorer.Location;             //????

            if (info2.Provider.ImplementingType == typeof(FileSystemProvider))
            {
                UseSortGroups = true;
                Highlighting  = PanelHighlighting.Full;

                // _090929_061740 Before Far 2.0.1145 we used to sync the current directory to
                // the PS location. Now it is not needed because Far does not do that any more.
            }
            else
            {
                UseSortGroups = false;
                Highlighting  = PanelHighlighting.Default;
            }
        }
Пример #3
0
 internal ItemPanel(ItemExplorer explorer)
     : base(explorer)
 {
     // setup
     DoExplored(null);
 }
Пример #4
0
        private void DoExplored(ItemExplorer explorer)
        {
            var info1 = explorer == null ? null : explorer.Info();
            var info2 = Explorer.Info();

            // fixed drive?
            if (Drive.Length > 0 && !Kit.Equals(Drive, info2.DriveName))
                return;

            // customise if not yet
            if (Drive.Length == 0 && (explorer == null || info1.Provider.ImplementingType != info2.Provider.ImplementingType))
            {
                if (string.IsNullOrEmpty(Drive))
                {
                    Columns = null;
                    ExcludeMemberPattern = null;

                    System.Collections.IDictionary options = A.Psf.Providers[info2.Provider.Name] as System.Collections.IDictionary;
                    if (options != null)
                    {
                        try
                        {
                            Converter.SetProperties(this, options, true);
                        }
                        catch (ArgumentException ex)
                        {
                            throw new InvalidDataException("Invalid settings for '" + info2.Provider.Name + "' provider: " + ex.Message);
                        }
                    }
                }
            }

            // Set-Location, the core remembers it for the drive, this is handy
            A.Psf.Engine.SessionState.Path.SetLocation(Kit.EscapeWildcard(Explorer.Location));

            //! path is used for Set-Location on Invoking()
            Title = "Items: " + Explorer.Location;
            CurrentLocation = Explorer.Location; //????

            if (info2.Provider.ImplementingType == typeof(FileSystemProvider))
            {
                UseSortGroups = true;
                Highlighting = PanelHighlighting.Full;

                // _090929_061740 Before Far 2.0.1145 we used to sync the current directory to
                // the PS location. Now it is not needed because Far does not do that any more.
            }
            else
            {
                UseSortGroups = false;
                Highlighting = PanelHighlighting.Default;
            }
        }
Пример #5
0
 internal ItemPanel(ItemExplorer explorer)
     : base(explorer)
 {
     // setup
     DoExplored(null);
 }
Пример #6
0
 Explorer Explore(string location)
 {
     //! propagate the provider, or performance sucks
     var newExplorer = new ItemExplorer(location);
     newExplorer.Provider = Provider;
     newExplorer.Columns = Columns;
     return newExplorer;
 }