public override Task <FindSectionResponse> FindSection(FindSectionRequest request,
                                                               ServerCallContext context)
        {
            var module   = moduleStore.GetObject(request.Module.Id);
            var section  = module.FindSection(request.Name);
            var response = new FindSectionResponse();

            if (section != null)
            {
                response.Section = new GrpcSbSection {
                    Id = sectionStore.AddObject(section)
                };
            }
            return(Task.FromResult(response));
        }
Esempio n. 2
0
        public SbSection FindSection(string name)
        {
            FindSectionResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.FindSection(
                    new FindSectionRequest
                {
                    Module = grpcSbModule,
                    Name = name,
                });
            }))
            {
                if (response.Section != null && response.Section.Id != 0)
                {
                    return(sectionFactory.Create(connection, response.Section));
                }
            }
            return(null);
        }