Пример #1
0
        //a dictionary entry
        public InspectorInfo(IList <object> masterList, InspectorInfo parentItem, object obj, object key) //obj = null
        {
            this.whitespace = "|";
            if (parentItem != null)
            {
                this.whitespace += parentItem.whitespace;
            }
            this.parentItem = parentItem;
            this.obj        = obj;
            this.masterList = masterList;
            this.fpinfo     = null;
            this.children   = new List <InspectorInfo>();
            //this.inspectorArea = parentItem.inspectorArea;
            this.showValueToString = parentItem.showValueToString;
            Type t = parentItem.obj.GetType();

            if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary <,>))
            {
                membertype = member_type.dictentry;
                this.key   = key;
                CheckItemType();
                prefix = "" + ((char)164);
                //System.Console.WriteLine(this);
                //children = GenerateList(obj, whitespace, this);
            }
            else
            {
                System.Console.WriteLine("Unexpected: InspectorInfo with no obj reference was not a dictionary entry");
                membertype = member_type.unimplemented;
            }
        }
Пример #2
0
        //a IEnumberable entry
        public InspectorInfo(IList <object> masterList, InspectorInfo parentItem, object obj) //obj = null
        {
            this.whitespace = "|";
            if (parentItem != null)
            {
                this.whitespace += parentItem.whitespace;
            }
            this.parentItem = parentItem;
            this.obj        = obj;
            this.masterList = masterList;
            this.fpinfo     = null;
            this.children   = new List <InspectorInfo>();
            //this.inspectorArea = parentItem.inspectorArea;
            this.showValueToString = parentItem.showValueToString;
            Type t = parentItem.obj.GetType();

            if (t.GetInterfaces()
                .Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IEnumerable <>)))
            {
                //Console.WriteLine("IEnumerable : {0}", obj.GetType());
                membertype = member_type.collectionentry;
                CheckItemType();
                prefix = "" + ((char)164);
            }
            else
            {
                System.Console.WriteLine("Unexpected: InspectorInfo with no obj reference was not a collection entry");
                membertype = member_type.unimplemented;
            }
        }
Пример #3
0
        public async Task <ActionResult <member_type> > Postmember_type(member_type member_type)
        {
            _context.member_types.Add(member_type);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getmember_type", new { id = member_type.id }, member_type));
        }
Пример #4
0
        public async Task <IActionResult> Putmember_type(int id, member_type member_type)
        {
            if (id != member_type.id)
            {
                return(BadRequest());
            }

            _context.Entry(member_type).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!member_typeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #5
0
 //root item
 public InspectorInfo(IList <object> masterList, object obj, bool showValueToString = false)
 {
     this.showValueToString = showValueToString;
     this.whitespace        = "|";
     this.obj        = obj;
     this.masterList = masterList;
     //this.fpinfo = new FPInfo(propertyInfo);
     this.membertype = member_type.none;
     this.children   = new List <InspectorInfo>();
     //this.inspectorArea = insArea;
     CheckItemType();
     prefix = "" + ((char)164);
     //System.Console.WriteLine(obj);
     //children = GenerateList(obj, whitespace, this);
 }
Пример #6
0
 //method
 public InspectorInfo(IList <object> masterList, InspectorInfo parentItem, MethodInfo methodInfo)
 {
     this.membertype = member_type.method;
     this.methodInfo = methodInfo;
     this.whitespace = "|";
     if (parentItem != null)
     {
         this.whitespace += parentItem.whitespace;
     }
     this.obj               = null;
     this.parentItem        = parentItem;
     this.masterList        = masterList;
     this.children          = new List <InspectorInfo>();
     this.showValueToString = parentItem.showValueToString;
     CheckItemType();
     prefix = "" + ((char)164);
     //this.inspectorArea = parentItem.inspectorArea;
 }
Пример #7
0
 //a field
 public InspectorInfo(IList <object> masterList, InspectorInfo parentItem, object obj, FieldInfo fieldInfo)
 {
     this.membertype = member_type.field;
     this.fpinfo     = new FPInfo(fieldInfo);
     FieldOrPropertyInitilize(masterList, parentItem, obj);
 }
 //method
 public InspectorInfo(IList<object> masterList, InspectorInfo parentItem, MethodInfo methodInfo)
 {
     this.membertype = member_type.method;
     this.methodInfo = methodInfo;
     this.whitespace = "|";
     if (parentItem != null) this.whitespace += parentItem.whitespace;
     this.obj = null;
     this.parentItem = parentItem;
     this.masterList = masterList;
     this.children = new List<InspectorInfo>();
     this.showValueToString = parentItem.showValueToString;
     CheckItemType();
     prefix = "" + ((char)164);
     //this.inspectorArea = parentItem.inspectorArea;
     this.sidebar = parentItem.sidebar;
 }
        //obj = null
        //a IEnumberable entry
        public InspectorInfo(IList<object> masterList, InspectorInfo parentItem, object obj)
        {
            this.whitespace = "|";
            if (parentItem != null) this.whitespace += parentItem.whitespace;
            this.parentItem = parentItem;
            this.obj = obj;
            this.masterList = masterList;
            this.fpinfo = null;
            this.children = new List<InspectorInfo>();
            //this.inspectorArea = parentItem.inspectorArea;
            this.sidebar = parentItem.sidebar;
            this.showValueToString = parentItem.showValueToString;
            Type t = parentItem.obj.GetType();

            if (t.GetInterfaces()
                .Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IEnumerable<>)))
            {
                //Console.WriteLine("IEnumerable : {0}", obj.GetType());
                membertype = member_type.collectionentry;
                CheckItemType();
                prefix = "" + ((char)164);
            }
            else
            {
                System.Console.WriteLine("Unexpected: InspectorInfo with no obj reference was not a collection entry");
                membertype = member_type.unimplemented;
            }
        }
 //obj = null
 //a dictionary entry
 public InspectorInfo(IList<object> masterList, InspectorInfo parentItem, object obj, object key)
 {
     this.whitespace = "|";
     if (parentItem != null) this.whitespace += parentItem.whitespace;
     this.parentItem = parentItem;
     this.obj = obj;
     this.masterList = masterList;
     this.fpinfo = null;
     this.children = new List<InspectorInfo>();
     //this.inspectorArea = parentItem.inspectorArea;
     this.sidebar = parentItem.sidebar;
     this.showValueToString = parentItem.showValueToString;
     Type t = parentItem.obj.GetType();
     if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary<,>))
     {
         membertype = member_type.dictentry;
         this.key = key;
         CheckItemType();
         prefix = "" + ((char)164);
         //System.Console.WriteLine(this);
         //children = GenerateList(obj, whitespace, this);
     }
     else
     {
         System.Console.WriteLine("Unexpected: InspectorInfo with no obj reference was not a dictionary entry");
         membertype = member_type.unimplemented;
     }
 }
 //a field
 public InspectorInfo(IList<object> masterList, InspectorInfo parentItem, object obj, FieldInfo fieldInfo)
 {
     this.membertype = member_type.field;
     this.fpinfo = new FPInfo(fieldInfo);
     FieldOrPropertyInitilize(masterList, parentItem, obj);
 }
 //root item
 public InspectorInfo(IList<object> masterList, object obj, Sidebar sidebar, bool showValueToString = false)
 {
     this.showValueToString = showValueToString;
     this.whitespace = "|";
     this.obj = obj;
     this.masterList = masterList;
     //this.fpinfo = new FPInfo(propertyInfo);
     this.membertype = member_type.none;
     this.children = new List<InspectorInfo>();
     //this.inspectorArea = insArea;
     this.sidebar = sidebar;
     CheckItemType();
     prefix = "" + ((char)164);
     //System.Console.WriteLine(obj);
     //children = GenerateList(obj, whitespace, this);
 }