Example #1
0
        /// <summary>
        /// New property explorer with a provider item path.
        /// </summary>
        /// <param name="itemPath">Item path.</param>
        public PropertyExplorer(string itemPath)
            : base(new Guid(TypeIdString))
        {
            if (itemPath == null) throw new ArgumentNullException("itemPath");

            // the path
            _ThePath = new PathInfoEx(itemPath);

            Functions =
                ExplorerFunctions.GetContent |
                ExplorerFunctions.SetText;

            if (My.ProviderInfoEx.HasDynamicProperty(Provider))
                Functions |= (
                    ExplorerFunctions.AcceptFiles |
                    ExplorerFunctions.DeleteFiles |
                    ExplorerFunctions.CloneFile |
                    ExplorerFunctions.CreateFile |
                    ExplorerFunctions.RenameFile);
        }
Example #2
0
 internal ItemExplorer(PathInfoEx info)
     : this(info.Path)
 {
     _Info_ = info;
 }
Example #3
0
        void Reset(string path)
        {
            // set location
            if (!string.IsNullOrEmpty(path) && path != ".")
                A.Psf.Engine.SessionState.Path.SetLocation(path);

            // get location
            PathInfoEx location = new PathInfoEx(A.Psf.Engine.SessionState.Path.CurrentLocation);
            if (!My.ProviderInfoEx.IsNavigation(location.Provider))
                throw new RuntimeException("Provider '" + location.Provider + "' does not support navigation.");

            // get root item
            Collection<PSObject> items = A.Psf.Engine.SessionState.InvokeProvider.Item.Get(new string[] { "." }, true, true);
            PSObject data = items[0];

            // reset roots
            RootFiles.Clear();
            TreeFile ti = new TreeFile();
            ti.Name = location.Path; // special case name for the root
            ti.Fill = TheFill;
            ti.Data = data;
            RootFiles.Add(ti);
            ti.Expand();

            // panel info
            Location = ti.Path;
        }
Example #4
0
 //! Very slow operation, that is why we propagate the provider on exploring.
 internal PathInfoEx Info()
 {
     return _Info_ ?? (_Info_ = new PathInfoEx(Location));
 }