Ejemplo n.º 1
0
        public void Process(string assemblyPath, IEnumerable <string> tagsPresent, IEnumerable <string> tagsMissing, MemberFilterFlags filter)
        {
            ResultsList.Items.Clear();
            string xmlPath = Path.ChangeExtension(assemblyPath, "xml");

            XmlDocument docs = new XmlDocument();

            docs.Load(xmlPath);

            XmlNodeList nodes = docs.SelectNodes("/doc/members/member");

            foreach (XmlNode node in nodes)
            {
                string name = node.Attributes["name"].Value;
                if (!CheckNameAgainstFilter(name, filter))
                {
                    continue;
                }

                bool addItem = true;

                //check if it contains any tags that are supposed to be missing
                foreach (string tag in tagsMissing)
                {
                    XmlNode tagNode = node.SelectSingleNode(tag);
                    if (tagNode != null && tagNode.InnerText != string.Empty)
                    {
                        addItem = false;
                        break;
                    }
                }

                //If we've already decided not to add this, don't keep checking the node
                if (!addItem)
                {
                    continue;
                }

                //check if it's missing any tags that are supposed to be present
                foreach (string tag in tagsPresent)
                {
                    XmlNode tagNode = node.SelectSingleNode(tag);
                    if (tagNode == null || tagNode.InnerText == string.Empty)
                    {
                        addItem = false;
                        break;
                    }
                }

                //it checks out, add it to the list
                if (addItem)
                {
                    ResultsList.Items.Add(name);
                }
            }

            m_Symbols = new SymbolEngine(assemblyPath);
        }
Ejemplo n.º 2
0
		public void Process(string assemblyPath, IEnumerable<string> tagsPresent, IEnumerable<string> tagsMissing, MemberFilterFlags filter)
		{
			ResultsList.Items.Clear();
			string xmlPath = Path.ChangeExtension(assemblyPath, "xml");

			XmlDocument docs = new XmlDocument();
			docs.Load(xmlPath);

			XmlNodeList nodes = docs.SelectNodes("/doc/members/member");
			foreach(XmlNode node in nodes)
			{
				string name = node.Attributes["name"].Value;
				if(!CheckNameAgainstFilter(name, filter))
					continue;

				bool addItem = true;

				//check if it contains any tags that are supposed to be missing
				foreach(string tag in tagsMissing)
				{
					XmlNode tagNode = node.SelectSingleNode(tag);
					if(tagNode != null && tagNode.InnerText != string.Empty)
					{
						addItem = false;
						break;
					}
				}

				//If we've already decided not to add this, don't keep checking the node
				if(!addItem)
					continue;

				//check if it's missing any tags that are supposed to be present
				foreach(string tag in tagsPresent)
				{
					XmlNode tagNode = node.SelectSingleNode(tag);
					if(tagNode == null || tagNode.InnerText == string.Empty)
					{
						addItem = false;
						break;
					}
				}

				//it checks out, add it to the list
				if(addItem)
					ResultsList.Items.Add(name);
			}

			m_Symbols = new SymbolEngine(assemblyPath);
		}