示例#1
0
		public void RefreshNodes(bool forceRefresh = false)
		{
			if (Nodes.Count > 0 && !forceRefresh)
				return;
			
			Nodes.Clear();
			
			foreach (var type in types) {
				TypeNode node = null;
				string name = type.Name;
				
				if (type.IsValueType) {
					if (type.IsPublic) {
						node = new PublicStructNode(name, type);
					} else {
						node = new PrivateStructNode(name, type);
					}
				} else {
					if (type.IsEnum) {
						if (type.IsPublic) {
							node = new PublicEnumNode(name, type);
						} else {
							node = new PrivateEnumNode(name, type);
						}
					} else {
						
						if (type.BaseType != null && type.BaseType.FullName == "System.MulticastDelegate"){
							if (type.IsPublic) {
								node = new PublicDelegateNode(name, type);
							} else {
								node = new PrivateDelegateNode(name, type);
							}
						} else {
							if (type.IsClass) {
								if (type.IsPublic) {
									node = new PublicClassNode(name, type);
								} else {
									node = new PrivateClassNode(name, type);
								}
							}
							else {
								if (type.IsInterface) {
									if (type.IsPublic) {
										node = new PublicInterfaceNode(name, type);
									} else {
										node = new PrivateInterfaceNode(name, type);
									}
								}
							}
						}
					}
				}
				
				if (node != null)
					node.InsertSorted(this);
			}
		}
示例#2
0
        public void RefreshNodes(bool forceRefresh = false)
        {
            if (Nodes.Count > 0 && !forceRefresh)
            {
                return;
            }

            Nodes.Clear();

            foreach (var type in types)
            {
                TypeNode node = null;
                string   name = type.Name;

                if (type.IsValueType)
                {
                    if (type.IsPublic)
                    {
                        node = new PublicStructNode(name, type);
                    }
                    else
                    {
                        node = new PrivateStructNode(name, type);
                    }
                }
                else
                {
                    if (type.IsEnum)
                    {
                        if (type.IsPublic)
                        {
                            node = new PublicEnumNode(name, type);
                        }
                        else
                        {
                            node = new PrivateEnumNode(name, type);
                        }
                    }
                    else
                    {
                        if (type.BaseType != null && type.BaseType.FullName == "System.MulticastDelegate")
                        {
                            if (type.IsPublic)
                            {
                                node = new PublicDelegateNode(name, type);
                            }
                            else
                            {
                                node = new PrivateDelegateNode(name, type);
                            }
                        }
                        else
                        {
                            if (type.IsClass)
                            {
                                if (type.IsPublic)
                                {
                                    node = new PublicClassNode(name, type);
                                }
                                else
                                {
                                    node = new PrivateClassNode(name, type);
                                }
                            }
                            else
                            {
                                if (type.IsInterface)
                                {
                                    if (type.IsPublic)
                                    {
                                        node = new PublicInterfaceNode(name, type);
                                    }
                                    else
                                    {
                                        node = new PrivateInterfaceNode(name, type);
                                    }
                                }
                            }
                        }
                    }
                }

                if (node != null)
                {
                    node.InsertSorted(this);
                }
            }
        }