Beispiel #1
0
        protected void AddConstructors(Type type, LookupListItem item)
        {
            BindingFlags bindingAttr =
                BindingFlags.Public |
                BindingFlags.FlattenHierarchy |
                BindingFlags.Instance;

            ConstructorInfo[] cia = type.GetConstructors(bindingAttr);

            foreach (ConstructorInfo ci in cia)
            {
                LookupMenuItem lmi = new LookupMenuItem();
                lmi.DisplayText = CSharpFormattingTools.
                                  GetConstructorSignature(ci, type);
                lmi.InsertText = CSharpFormattingTools.
                                 GetMinimalConstructorSignature(ci, type);

                item.MenuItems.Add(lmi);
            }
        }