Ejemplo n.º 1
0
        public IOutputInfo OnWrite()
        {
            List <IOutputBody> bodies = new List <IOutputBody>();
            OutputBody         body;

            body = new OutputBody(new List <string>(2)
            {
                "Command", $": {Command}"
            });
            bodies.Add(body);

            body = new OutputBody(new List <string>(2)
            {
                "Description", $": {Description}"
            });
            bodies.Add(body);

            if (Parameters.Count > 0)
            {
                body = new OutputBody(new List <string>(2)
                {
                    "Parameters", ":"
                });
                bodies.Add(body);
                bodies.Add(OutputInfo.CreateFormatEnd());
                List <IOutputBody> outputParameters = OutputInfo.RetriveProperties <CommandParameterInfo>(Parameters, COMMAND_PARAMETER_PROPERTIES, true);
                bodies.AddRange(outputParameters);
            }
            return(OutputInfo.Create(null, bodies, ""));
        }
Ejemplo n.º 2
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > contents = new List <IEnumerable <string> >();

            contents.Add(new string[] { "Name", $": {Name}" });
            contents.Add(new string[] { "Value", $": {Value}" });
            return(OutputInfo.Create(null, contents, ""));
        }
Ejemplo n.º 3
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > bodyContents = new List <IEnumerable <string> >();

            bodyContents.Add(new string[] { "Name", $": {Type.Name}" });
            bodyContents.Add(new string[] { "Namespace", $": {Type.Namespace}" });
            bodyContents.Add(new string[] { "Assembly", $": {Type.Assembly.FullName}" });
            return(OutputInfo.Create(null, bodyContents, ""));
        }
Ejemplo n.º 4
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > contents = new List <IEnumerable <string> >();

            foreach (PropertyInfo prop in Properties)
            {
                contents.Add(new string[] { $"{prop.Name}", $": {prop.Value}" });
            }
            return(OutputInfo.Create(null, contents, ""));
        }
Ejemplo n.º 5
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > result = new List <IEnumerable <string> >();

            result.Add(new string[] { nameof(Count), nameof(Sum), nameof(Max), nameof(Min) });
            result.Add(new string[] { Count.ToString(), Sum?.ToString(), Max?.ToString(), Min?.ToString() });
            List <IOutputBody> body = OutputInfo.CreateBodies(result);

            body.Insert(1, OutputInfo.CreateColumnLineSeperator());
            return(OutputInfo.Create(null, body, ""));
        }
Ejemplo n.º 6
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > bodyContents = new List <IEnumerable <string> >();

            bodyContents.Add(new string[] { "Name", "Type", "Length", "Last Modified" });
            if (Item is DirectoryInfo dirInfo)
            {
                bodyContents.Add(new string[] { dirInfo.Name, "Directory", "", dirInfo.LastWriteTime.ToString("yyyy/MM/dd hh:mm:ss") });
            }
            else if (Item is FileInfo fileInfo)
            {
                bodyContents.Add(new string[] { fileInfo.Name, "File", fileInfo.Length.ToString(), fileInfo.LastWriteTime.ToString("yyyy/MM/dd hh:mm:ss") });
            }
            List <IOutputBody> bodies = OutputInfo.CreateBodies(bodyContents);

            bodies.Insert(1, OutputInfo.CreateColumnLineSeperator());
            return(OutputInfo.Create(null, bodies, ""));
        }
Ejemplo n.º 7
0
        public IOutputInfo OnWrite()
        {
            List <IEnumerable <string> > contents = new List <IEnumerable <string> >();

            if (Objects.Count > 0)
            {
                string[] properties = Objects[0].Properties.Select(p => p.Name).ToArray();
                contents.Add(properties);
                string[] values;
                foreach (ObjectPropertySet obj in Objects)
                {
                    values = obj.Properties.Select(p => p.Value?.ToString()).ToArray();
                    contents.Add(values);
                }
            }
            List <IOutputBody> bodies = OutputInfo.CreateBodies(contents);

            if (bodies.Count > 0)
            {
                bodies.Insert(1, OutputInfo.CreateColumnLineSeperator());
            }
            return(OutputInfo.Create(null, bodies, ""));
        }