예제 #1
0
        /// <summary>
        /// Opens the file member panel.
        /// </summary>
        /// <remarks>
        /// The base method propagates lookup openers.
        /// </remarks>
        internal virtual MemberPanel OpenFileMembers(FarFile file)
        {
            //??? _090610_071700, + $panel.SetOpen({ @ Test-Panel-Tree-.ps1
            object target = file.Data == null ? file : file.Data;

            MemberPanel panel = new MemberPanel(new MemberExplorer(target));

            panel._LookupOpeners = _LookupOpeners;

            var tablePanel = Far.Api.Panel as TablePanel;

            if (tablePanel != null)
            {
                if (!string.IsNullOrEmpty(tablePanel.ExcludeMemberPattern))
                {
                    panel.Explorer.ExcludeMemberPattern = tablePanel.ExcludeMemberPattern;
                }

                if (!string.IsNullOrEmpty(tablePanel.HideMemberPattern))
                {
                    panel.Explorer.HideMemberPattern = tablePanel.HideMemberPattern;
                }
            }

            //! use null as parent: this panel can be not open now
            panel.OpenChild(null);
            return(panel);
        }
예제 #2
0
        internal override MemberPanel OpenFileMembers(FarFile file)
        {
            if (!(file.Data is PSPropertyInfo pi))
            {
                return(null);
            }
            if (pi.Value == null)
            {
                return(null);
            }
            MemberPanel r = new MemberPanel(new MemberExplorer(pi.Value));

            r.OpenChild(this);
            return(r);
        }
예제 #3
0
        /// <summary>
        /// Opens <see cref="MemberPanel"/> for a file.
        /// File <c>Data</c> must not be null.
        /// </summary>
        internal override MemberPanel OpenFileMembers(FarFile file)
        {
            // get data
            TreeFile t = (TreeFile)file;

            if (t.Data == null)
            {
                return(null);
            }

            //! use null as parent: this panel can be not open now
            MemberPanel r = new MemberPanel(new MemberExplorer(t.Data));

            r.OpenChild(null);
            return(r);
        }
예제 #4
0
        internal override MemberPanel OpenFileMembers(FarFile file)
        {
            PSObject o          = PSObject.AsPSObject(file.Data);
            string   memberType = o.Properties["MemberType"].Value.ToString();

            if (!memberType.EndsWith("Property", StringComparison.Ordinal))             //??
            {
                return(null);
            }

            string name     = o.Properties[Word.Name].Value.ToString();
            object instance = Target.Properties[name].Value;

            if (instance == null)
            {
                return(null);
            }

            MemberPanel r = new MemberPanel(new MemberExplorer(instance));

            r.OpenChild(this);
            return(r);
        }
예제 #5
0
        internal override MemberPanel OpenFileMembers(FarFile file)
        {
            PSObject o = PSObject.AsPSObject(file.Data);
            string memberType = o.Properties["MemberType"].Value.ToString();
            if (!memberType.EndsWith("Property", StringComparison.Ordinal)) //??
                return null;

            string name = o.Properties[Word.Name].Value.ToString();
            object instance = Target.Properties[name].Value;
            if (instance == null)
                return null;

            MemberPanel r = new MemberPanel(new MemberExplorer(instance));
            r.OpenChild(this);
            return r;
        }
예제 #6
0
        /// <summary>
        /// Opens <see cref="MemberPanel"/> for a file.
        /// File <c>Data</c> must not be null.
        /// </summary>
        internal override MemberPanel OpenFileMembers(FarFile file)
        {
            // get data
            TreeFile t = (TreeFile)file;
            if (t.Data == null)
                return null;

            //! use null as parent: this panel can be not open now
            MemberPanel r = new MemberPanel(new MemberExplorer(t.Data));
            r.OpenChild(null);
            return r;
        }
예제 #7
0
파일: AnyPanel.cs 프로젝트: pezipink/FarNet
        /// <summary>
        /// Opens the file member panel.
        /// </summary>
        /// <remarks>
        /// The base method propagates lookup openers.
        /// </remarks>
        internal virtual MemberPanel OpenFileMembers(FarFile file)
        {
            //??? _090610_071700, + $panel.SetOpen({ @ Test-Panel-Tree-.ps1
            object target = file.Data == null ? file : file.Data;

            MemberPanel panel = new MemberPanel(new MemberExplorer(target));
            panel._LookupOpeners = _LookupOpeners;

            var tablePanel = Far.Api.Panel as TablePanel;
            if (tablePanel != null)
            {
                if (!string.IsNullOrEmpty(tablePanel.ExcludeMemberPattern))
                    panel.Explorer.ExcludeMemberPattern = tablePanel.ExcludeMemberPattern;

                if (!string.IsNullOrEmpty(tablePanel.HideMemberPattern))
                    panel.Explorer.HideMemberPattern = tablePanel.HideMemberPattern;
            }

            //! use null as parent: this panel can be not open now
            panel.OpenChild(null);
            return panel;
        }
예제 #8
0
 internal override MemberPanel OpenFileMembers(FarFile file)
 {
     PSPropertyInfo pi = file.Data as PSPropertyInfo;
     if (pi == null)
         return null;
     if (pi.Value == null)
         return null;
     MemberPanel r = new MemberPanel(new MemberExplorer(pi.Value));
     r.OpenChild(this);
     return r;
 }