Esempio n. 1
0
        public bool ProcessTrees()
        {
            if (isLoaded && !isTreeProcessed)
            {
                // Make the Member Tree, the result needs to be saved for lookups.
                memberDictionary = TreeMaker.Make(members, TreeMaker.MakeMode.Flat);

                // Make the MemberType Tree, the result doesn't need saved since the
                // MemberTypeTemplate Tree is indexed by hash value;
                TreeMaker.Make(memberTypeTemplates, TreeMaker.MakeMode.Flat);

                isTreeProcessed = true;

                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        private static void compileTask(object type)
        {
            if (type == null)
            {
                return;
            }

            if (type == typeof(DojoMemberTypeTemplateCollection) |
                type == typeof(DojoMemberTypeTemplate))
            {
                DojoMemberTypeTemplateCollection templates =
                    new DojoMemberTypeTemplateManager().GetCollection(
                        string.Empty,
                        string.Empty,
                        null);

                lock (lockObject)
                {
                    itemCount = templates.Count;
                }

                TreeMaker.Make(templates, TreeMaker.MakeMode.Flat);
                Build(templates);

                for (int i = 0; i < templates.Count; i++)
                {
                    lock (lockObject)
                    {
                        itemNumber = i;
                    }

                    if (abortRequest)
                    {
                        break;
                    }

                    templates[i].MemberTypeTreeHash = templates[i].treeHash;
                    templates[i].Root = templates[i].treeRoot;
                    templates[i].Save();
                }
            }
            else if (type == typeof(DojoMemberCollection) |
                     type == typeof(DojoMember))
            {
                DojoMemberCollection members =
                    new DojoMemberManager().GetCollection(
                        string.Empty,
                        "PrivateContact.LastName, PrivateContact.FirstName, PrivateContact.MiddleName",
                        DojoMemberFlags.PrivateContact);

                lock (lockObject)
                {
                    itemCount = members.Count;
                }

                TreeMaker.Make(members, TreeMaker.MakeMode.Flat);
                Build(members);

                for (int i = 0; i < members.Count; i++)
                {
                    lock (lockObject)
                    {
                        itemNumber = i;
                    }
                    if (abortRequest)
                    {
                        break;
                    }

                    members[i].MemberTypeTreeHash = members[i].treeHash;
                    members[i].Root = members[i].treeRoot;
                    members[i].Save();
                }
            }

            lock (lockObject)
            {
                isCompiling = false;
            }
        }