Beispiel #1
0
        protected BuildVerifier()
        {
            string         uri       = Path.Combine(Path.Combine(EditorApplication.applicationContentsPath, "Resources"), "BuildVerification.xml");
            XPathNavigator navigator = new XPathDocument(uri).CreateNavigator();

            navigator.MoveToFirstChild();
            XPathNodeIterator iterator = navigator.SelectChildren("assembly", string.Empty);

            while (iterator.MoveNext())
            {
                string attribute = iterator.Current.GetAttribute("name", string.Empty);
                if ((attribute == null) || (attribute.Length < 1))
                {
                    throw new ApplicationException(string.Format("Failed to load {0}, <assembly> name attribute is empty", uri));
                }
                string key = iterator.Current.GetAttribute("platform", string.Empty);
                if ((key == null) || (key.Length < 1))
                {
                    key = "*";
                }
                if (!this.m_UnsupportedAssemblies.ContainsKey(key))
                {
                    this.m_UnsupportedAssemblies.Add(key, new HashSet <string>());
                }
                this.m_UnsupportedAssemblies[key].Add(attribute);
            }
        }
Beispiel #2
0
        /// <summary />
        public static void SelectChildrenSpeed(int it)
        {
            int            iterations = (int)it;
            long           start;
            long           end;
            XPathNavigator context = new XPathDocument(@"..\data.xml").CreateNavigator();

            context.MoveToFirstChild();
            XPathExpression     expr = context.Compile("child::sch:assert");
            XmlNamespaceManager mgr  = new XmlNamespaceManager(context.NameTable);

            mgr.AddNamespace("dv", "deverest:schemas");
            mgr.AddNamespace("sch", Schema.Namespace);
            expr.SetContext(mgr);

            start = DateTime.Now.Ticks;
            for (int i = 0; i < iterations; i++)
            {
                context.Select(expr);
            }
            end = DateTime.Now.Ticks;
            //Console.WriteLine("Elapsed time for compiled expression select: {0}", TimeSpan.FromTicks(end - start).TotalMilliseconds);

            string ns = Schema.Namespace;

            start = DateTime.Now.Ticks;
            for (int i = 0; i < iterations; i++)
            {
                context.SelectChildren("assert", ns);
            }
            end = DateTime.Now.Ticks;
            //Console.WriteLine("Elapsed time for children select: {0}", TimeSpan.FromTicks(end - start).TotalMilliseconds);
        }
        public LinkXmlReader()
        {
            IEnumerator <string> enumerator = AssemblyStripper.GetUserBlacklistFiles().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    string         current   = enumerator.Current;
                    XPathNavigator navigator = new XPathDocument(current).CreateNavigator();
                    navigator.MoveToFirstChild();
                    XPathNodeIterator iterator = navigator.SelectChildren("assembly", string.Empty);
                    while (iterator.MoveNext())
                    {
                        this._assembliesInALinkXmlFile.Add(iterator.Current.GetAttribute("fullname", string.Empty));
                    }
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
        }
Beispiel #4
0
        public override void PopulateTree(Tree tree)
        {
            XPathNavigator n = new XPathDocument(Path.Combine(basedir, "toc.xml")).CreateNavigator();

            n.MoveToRoot();
            n.MoveToFirstChild();
            PopulateNode(n.SelectChildren("node", ""), tree);
        }
 public LinkXmlReader()
 {
     foreach (string userBlacklistFile in AssemblyStripper.GetUserBlacklistFiles())
     {
         XPathNavigator navigator = new XPathDocument(userBlacklistFile).CreateNavigator();
         navigator.MoveToFirstChild();
         XPathNodeIterator xpathNodeIterator = navigator.SelectChildren("assembly", string.Empty);
         while (xpathNodeIterator.MoveNext())
         {
             this._assembliesInALinkXmlFile.Add(xpathNodeIterator.Current.GetAttribute("fullname", string.Empty));
         }
     }
 }