Пример #1
0
 private void SerializeSessionWeb(EmberDataPayload payload, ISessionWeb web)
 {
     payload.services       = web.Services.Values.Select(s => new ServiceDto(s)).ToList();
     payload.pageTypes      = web.PageTypes.Values.Select(p => new PageTypeDto(p)).ToList();
     payload.componentTypes = web.ComponentTypes.Values.Select(c => new ComponentTypeDto(c)).ToList();
     SerializeComponents(payload, web);
 }
Пример #2
0
        public async Task <bool> UpdateSessionWebsAsync(ISessionWeb sessionWeb, DocumentId changedDocumentId)
        {
            try
            {
                var document = _workspace.CurrentSolution.GetDocument(changedDocumentId);

                SemanticModel semanticModel = await document.GetSemanticModelAsync().ConfigureAwait(false);

                var syntaxTree = await document.GetSyntaxTreeAsync().ConfigureAwait(false);

                var typeDeclarationsInDocument =
                    syntaxTree.GetRoot().DescendantNodes().OfType <ClassDeclarationSyntax>();
                var typesInDocument = typeDeclarationsInDocument.Select(td => semanticModel.GetDeclaredSymbol(td))
                                      .OfType <INamedTypeSymbol>();

                var pages      = GetPages(typesInDocument);
                var components = GetComppnents(typesInDocument);
                if (pages.Any() || components.Any())
                {
                    UpdateCachedSessionWebs(pages, components);
                    return(true);
                }

                return(false);
            }
            catch (Exception ex)
            {
                _log.Error(ex, "Unable to collect selenium contexts");
                throw;
            }
        }
Пример #3
0
 private void SerializeComponents(EmberDataPayload payload, ISessionWeb web)
 {
     payload.components = new List <ComponentDto>();
     SerializeComponents(payload, web.PageTypes.Values);
     SerializeComponents(payload, web.ComponentTypes.Values);
 }