コード例 #1
0
        } // end ResetState()

        internal static string FormatSingleLineDirect(object obj)
        {
            if (null == obj)
            {
                return(String.Empty);
            }

            PSObject pso = obj as PSObject;

            if (null == pso)
            {
                pso = new PSObject(obj);
            }

            var view = AltFormattingManager.ChooseFormatInfoForPSObject <AltSingleLineViewDefinition>(pso);

            ScriptBlock script;

            if (null != view)
            {
                script = view.Script;
            }
            else
            {
                script = sm_DefaultScript;
            }

            return(FormatSingleLineDirect(pso, script));
        }
コード例 #2
0
        // TODO: -All parameter?

        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            IFormatInfo fi = AltFormattingManager.ChooseFormatInfoForPSObject(ForObject,
                                                                              FormatInfoType);

            if (null != fi)
            {
                WriteObject(fi);
            }
        } // end ProcessRecord()