Beispiel #1
0
        List <FrameInfoPair> ToFrameInfoPairList(GetFramesWithInfoResponse response)
        {
            var frames = RemoteObjectUtils.CreateRemoteObjects(
                p => frameFactory.Create(connection, p),
                p => frameFactory.Delete(connection, p),
                response.FramesWithInfo.Select(p => p.Frame));

            return(response.FramesWithInfo.Zip(frames,
                                               (p, f) => new FrameInfoPair(f, FrameInfoUtils.CreateFrameInfo(
                                                                               p.Info, moduleFactory, connection))).ToList());
        }
Beispiel #2
0
        public override Task <GetFramesWithInfoResponse> GetFramesWithInfo(
            GetFramesWithInfoRequest request, ServerCallContext context)
        {
            var thread         = threadStore.GetObject(request.Thread.Id);
            var framesWithInfo = thread.GetFramesWithInfo((FrameInfoFlags)request.Fields,
                                                          request.StartIndex, request.MaxCount);
            var response = new GetFramesWithInfoResponse();

            foreach (var frameWithInfo in framesWithInfo)
            {
                var grpcFrameWithInfo = new GrpcFrameWithInfo();
                grpcFrameWithInfo.Frame = CreateGrpcSbFrame(frameWithInfo.Frame);
                FrameInfo <SbModule> info = frameWithInfo.Info;
                long?moduleId             = info.Module != null?
                                            moduleStore.AddObject(info.Module) : (long?)null;

                grpcFrameWithInfo.Info = GrpcFactoryUtils.CreateFrameInfo(info, moduleId);
                response.FramesWithInfo.Add(grpcFrameWithInfo);
            }
            return(Task.FromResult(response));
        }
Beispiel #3
0
        public async Task <List <FrameInfoPair> > GetFramesWithInfoAsync(
            FrameInfoFlags fields, uint startIndex, uint maxCount)
        {
            var request = new GetFramesWithInfoRequest()
            {
                Thread     = grpcSbThread,
                Fields     = (uint)fields,
                StartIndex = startIndex,
                MaxCount   = maxCount
            };
            GetFramesWithInfoResponse response = null;

            if (await connection.InvokeRpcAsync(async delegate
            {
                response = await client.GetFramesWithInfoAsync(request);
            }))
            {
                return(ToFrameInfoPairList(response));
            }
            return(null);
        }
Beispiel #4
0
        public List <FrameInfoPair> GetFramesWithInfo(
            FrameInfoFlags fields, uint startIndex, uint maxCount)
        {
            var request = new GetFramesWithInfoRequest()
            {
                Thread     = grpcSbThread,
                Fields     = (uint)fields,
                StartIndex = startIndex,
                MaxCount   = maxCount
            };
            GetFramesWithInfoResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetFramesWithInfo(request);
            }))
            {
                return(ToFrameInfoPairList(response));
            }
            return(null);
        }