Esempio n. 1
0
        /// <summary>
        /// Return all trees that are in a given directory. Make sure that if we have multiple
        /// cycles in the directory we only process the first one we encounter.
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public IEnumerable<ROOTClassShell> ParseTDirectory(ROOTNET.Interface.NTDirectory dir)
        {
            var converter = new ParseTTree();
            converter.ProxyGenerationLocation = ProxyGenerationLocation;

            HashSet<string> seenTreeNames = new HashSet<string>();

            foreach (var key in dir.ListOfKeys.Cast<ROOTNET.Interface.NTKey>())
            {
                var c = ROOTNET.NTClass.GetClass(key.GetClassName());
                if (c != null)
                {
                    if (c.InheritsFrom("TTree"))
                    {
                        if (!seenTreeNames.Contains(key.Name))
                        {
                            seenTreeNames.Add(key.Name);
                            var t = key.ReadObj() as ROOTNET.Interface.NTTree;
                            if (t != null)
                            {
                                foreach (var cshell in converter.GenerateClasses(t))
                                {
                                    yield return cshell;
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Return all trees that are in a given directory. Make sure that if we have multiple
        /// cycles in the directory we only process the first one we encounter.
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public IEnumerable <ROOTClassShell> ParseTDirectory(ROOTNET.Interface.NTDirectory dir)
        {
            var converter = new ParseTTree();

            converter.ProxyGenerationLocation = ProxyGenerationLocation;

            HashSet <string> seenTreeNames = new HashSet <string>();

            foreach (var key in dir.ListOfKeys.Cast <ROOTNET.Interface.NTKey>())
            {
                var c = ROOTNET.NTClass.GetClass(key.GetClassName());
                if (c != null)
                {
                    if (c.InheritsFrom("TTree"))
                    {
                        if (!seenTreeNames.Contains(key.Name))
                        {
                            seenTreeNames.Add(key.Name);
                            var t = key.ReadObj() as ROOTNET.Interface.NTTree;
                            if (t != null)
                            {
                                foreach (var cshell in converter.GenerateClasses(t))
                                {
                                    yield return(cshell);
                                }
                            }
                        }
                    }
                }
            }
        }