예제 #1
0
        private void CreateHooks(string parentId, IEnumerable <VirtualElementConfigurationElement> elements, List <EntityTokenHook> foundHooks)
        {
            var entityToken     = new VirtualElementProviderEntityToken(_context.ProviderName, parentId);
            var entityTokenHook = new EntityTokenHook(entityToken);

            foreach (var attachProviderElement in elements.OfType <AttachProviderVirtualElement>())
            {
                lock (_notLoadedVirtualElements)
                {
                    if (_notLoadedVirtualElements.Contains(attachProviderElement.Name))
                    {
                        continue;
                    }
                }


                string providerName  = attachProviderElement.ProviderName;
                var    childElements = ElementFacade.GetRootsWithNoSecurity(new ElementProviderHandle(providerName), null).ToList();

                foreach (Element childElement in childElements)
                {
                    entityTokenHook.AddHookie(childElement.ElementHandle.EntityToken);
                }
            }

            foundHooks.Add(entityTokenHook);

            foreach (var simpleElement in elements.OfType <SimpleVirtualElement>())
            {
                CreateHooks(simpleElement.Name, simpleElement.Elements, foundHooks);
            }
        }
        private List <EntityTokenHook> CreateHooks()
        {
            EntityTokenHook entityTokenHook = new EntityTokenHook(new PackageCreatorElementProviderEntityToken());

            return(new List <EntityTokenHook> {
                entityTokenHook
            });
        }
예제 #3
0
        private List <EntityTokenHook> CreateHooks()
        {
            IEnumerable <EntityToken> userGroupsEntityTokens =
                from ug in DataFacade.GetData <IUserGroup>()
                select(EntityToken) ug.GetDataEntityToken();

            EntityTokenHook hook = new EntityTokenHook(new UserGroupElementProviderRootEntityToken());

            hook.AddHookies(userGroupsEntityTokens);

            return(new List <EntityTokenHook> {
                hook
            });
        }