Beispiel #1
0
        public ObjectInfo(Object @object)
        {
            if (@object == null)
            {
                throw new ArgumentNullException("object");
            }

            var  properties = @object.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
            var  table      = new Table((uint)properties.Length, 2, false);
            uint row        = 0;

            foreach (var property in properties)
            {
                table.Attach(new Label(property.Name), 0, 1, row, row + 1);
                var value = property.GetValue(@object, null);
                if (value == null)
                {
                    value = "";
                }
                table.Attach(new Label(value.ToString()), 1, 2, row, row + 1);
                row++;
            }

            Add(table);
            ShowAll();
        }
Beispiel #2
0
        public ObjectInfo (Object @object, string path)
        {
            if (@object == null) {
                throw new ArgumentNullException ("object");
            }

            this.@object = @object;
            this.path = path;
        }
Beispiel #3
0
        public ObjectInfo(Object @object, string path)
        {
            if (@object == null)
            {
                throw new ArgumentNullException("object");
            }

            this.@object = @object;
            this.path    = path;
        }
Beispiel #4
0
        public ObjectInfo (Object @object)
        {
            if (@object == null) {
                throw new ArgumentNullException ("object");
            }

            var properties = @object.GetType ().GetProperties (BindingFlags.Instance | BindingFlags.Public);
            var table = new Table ((uint)properties.Length, 2, false);
            uint row = 0;
            foreach (var property in properties) {
                table.Attach (new Label (property.Name), 0, 1, row, row + 1);
                var value = property.GetValue (@object, null);
                if (value == null) {
                    value = "";
                }
                table.Attach (new Label (value.ToString ()), 1, 2, row, row + 1);
                row++;
            }

            Add (table);
            ShowAll ();
        }
Beispiel #5
0
 public ObjectInfo(Object @object)
     : this(@object, null)
 {
 }
Beispiel #6
0
 public ObjectInfo (Object @object)
     : this (@object, null)
 {
 }