예제 #1
0
        private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, IEnumerable <FileDescriptor> dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo)
        {
            SerializedData = descriptorData;
            DescriptorPool = pool;
            Proto          = proto;
            Dependencies   = new ReadOnlyCollection <FileDescriptor>(dependencies.ToList());

            PublicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies);

            pool.AddPackage(Package, this);

            MessageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType,
                                                                 (message, index) =>
                                                                 new MessageDescriptor(message, this, null, index, generatedCodeInfo?.NestedTypes[index]));

            EnumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType,
                                                              (enumType, index) =>
                                                              new EnumDescriptor(enumType, this, null, index, generatedCodeInfo?.NestedEnums[index]));

            Services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service,
                                                             (service, index) =>
                                                             new ServiceDescriptor(service, this, index));

            declarations = new Lazy <Dictionary <IDescriptor, DescriptorDeclaration> >(CreateDeclarationMap, LazyThreadSafetyMode.ExecutionAndPublication);
        }
예제 #2
0
        private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo)
        {
            FileDescriptor __4__this;

            while (true)
            {
IL_113:
                uint arg_E7_0 = 3109136426u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_E7_0 ^ 2557234891u)) % 8u)
                    {
                    case 0u:
                        pool.AddPackage(this.Package, this);
                        arg_E7_0 = (num * 1105332455u ^ 1354664894u);
                        continue;

                    case 1u:
                        __4__this = this;
                        arg_E7_0  = (num * 4125576103u ^ 2241118048u);
                        continue;

                    case 2u:
                        this.< Dependencies > k__BackingField       = new ReadOnlyCollection <FileDescriptor>((FileDescriptor[])FileDescriptor.smethod_0(dependencies));
                        this.< PublicDependencies > k__BackingField = FileDescriptor.DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies);
                        arg_E7_0 = (num * 2070285500u ^ 1583842795u);
                        continue;

                    case 3u:
                        goto IL_113;

                    case 4u:
                        this.< SerializedData > k__BackingField = descriptorData;
                        arg_E7_0 = (num * 559784837u ^ 3768172688u);
                        continue;

                    case 5u:
                        this.< MessageTypes > k__BackingField = DescriptorUtil.ConvertAndMakeReadOnly <DescriptorProto, MessageDescriptor>(proto.MessageType, (DescriptorProto message, int index) => new MessageDescriptor(message, __4__this, null, index, generatedCodeInfo.NestedTypes[index]));
                        arg_E7_0 = (num * 3261531694u ^ 3702070131u);
                        continue;

                    case 7u:
                        this.< DescriptorPool > k__BackingField = pool;
                        this.< Proto > k__BackingField          = proto;
                        arg_E7_0 = (num * 2550378934u ^ 3723757811u);
                        continue;
                    }
                    goto Block_1;
                }
            }
Block_1:
            this.< EnumTypes > k__BackingField = DescriptorUtil.ConvertAndMakeReadOnly <EnumDescriptorProto, EnumDescriptor>(proto.EnumType, (EnumDescriptorProto enumType, int index) => new EnumDescriptor(enumType, __4__this, null, index, generatedCodeInfo.NestedEnums[index]));
            this.< Services > k__BackingField  = DescriptorUtil.ConvertAndMakeReadOnly <ServiceDescriptorProto, ServiceDescriptor>(proto.Service, (ServiceDescriptorProto service, int index) => new ServiceDescriptor(service, this, index));
        }
예제 #3
0
        private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo)
        {
            this.descriptorData = descriptorData;
            this.pool           = pool;
            this.proto          = proto;
            this.dependencies   = new ReadOnlyCollection <FileDescriptor>((FileDescriptor[])dependencies.Clone());

            publicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies);

            pool.AddPackage(Package, this);

            messageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType,
                                                                 (message, index) =>
                                                                 new MessageDescriptor(message, this, null, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedTypes[index]));

            enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType,
                                                              (enumType, index) =>
                                                              new EnumDescriptor(enumType, this, null, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedEnums[index]));

            services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service,
                                                             (service, index) =>
                                                             new ServiceDescriptor(service, this, index));
        }