Beispiel #1
0
            public TypeSelectorDropdown(AdvancedDropdownState state, IEnumerable <Type> types, Action <Type> typeSelected) : base(state)
            {
                this.typeLevel    = new NamespaceLevel(types);
                this.typeSelected = typeSelected;

                base.minimumSize = minimumSize;
            }
Beispiel #2
0
        public void Setup()
        {
            namespace_list = new List <string>()
            {
                "AssemblyBrowserLib.Levels", "AssemblyBrowserLib.HelpClasses"
            };
            class_list = new List <string>()
            {
                "public AssemblyLevel", "public ClassLevel", "public FieldLevel", "public MethodLevel", "public NamespaceLevel", "public PropertyLevel"
            };
            method_list = new List <string>()
            {
                "private String GetSignature(MethodLevel method)", "public String GetFullName()"
            };
            property_list = new List <string>()
            {
                "String Name { public get; private set; }", "String Type { public get; private set; }", "MethodInfo methodInfo { public get; private set; }"
            };
            field_list = new List <string>()
            {
                "private ParameterInfo[] Parameters"
            };

            _assembly  = new AssemblyLevel("AssemblyBrowserLib.dll");
            _namespace = _assembly.Namespaces.Find(ns => ns.GetFullName() == namespace_list[0]);
            _class     = _namespace.Classes.Find(cl => cl.GetFullName() == class_list[3]);
        }
Beispiel #3
0
        /// <summary>
        /// Adds a using directive for the current context.
        /// </summary>
        public void AddUsingDirective(UsingDirectiveNode node)
        {
            NamespaceLevel currentLevel = levels.Peek() as NamespaceLevel;

            if (currentLevel == null)
            {
                throw new InvalidOperationException("Can not add a using directive in a type.");
            }

            currentLevel.UsingDirectives.Add(node);
            if (node.IsAlias)
            {
                couldBeAlias[node.AliasName.Identifier] = null;
            }
        }
 public NamespaceView(NamespaceLevel namespaceNode)
 {
     Name    = namespaceNode.Name;
     Classes = namespaceNode.Classes.ConvertAll(_class => new ClassView(_class));
 }