AnalyzeRawProtobuf.Program.MethodDescriptorProto C# (CSharp) Method

MethodDescriptorProto() private method

The method descriptor proto.
private MethodDescriptorProto ( uint totalLength, MethodDescriptor md ) : void
totalLength uint /// The total length. ///
md MethodDescriptor The method descriptor.
return void
        private void MethodDescriptorProto(uint totalLength, MethodDescriptor md)
        {
            intend++;

            while (totalLength != 0)
            {
                int type, no;
                var l = GetTypeAndFieldNo(out type, out no);
                ix += l;
                totalLength -= (uint)l;

                switch (no)
                {
                    case 1: // string name
                        {
                            uint length;
                            var ixl = GetVarint(out length);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            md.Name = GetString(length);
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, name = {3}", type, no, length, md.Name));
                            ix += (int)length;
                            totalLength -= length;
                            break;
                        }

                    case 2: // string input_type
                        {
                            uint length;
                            var ixl = GetVarint(out length);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            md.InputType = GetString(length);
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, input_type = {3}", type, no, length, md.InputType));
                            ix += (int)length;
                            totalLength -= length;
                            break;
                        }

                    case 3: // string output_type
                        {
                            uint length;
                            var ixl = GetVarint(out length);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            md.OutputType = GetString(length);
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2}, output_type = {3}", type, no, length, md.OutputType));
                            ix += (int)length;
                            totalLength -= length;
                            break;
                        }

                    case 4: // MethodOptions options
                        {
                            uint length;
                            var ixl = GetVarint(out length);
                            ix += ixl;
                            totalLength -= (uint)ixl;
                            Write(string.Format("Type = {0}, F#= {1}, Length = {2} - MethodOptions", type, no, length));
                            if (md.Options == null)
                            {
                                md.Options = new MethodOptions();
                            }

                            MethodOptions(length, md.Options);
                            totalLength -= length;
                            break;
                        }
                }
            }

            intend--;
        }