using System; using Google.ProtocolBuffers.DescriptorProtos; using System.Collections.Generic; namespace Google.ProtocolBuffers.Descriptors { public class FileDescriptor : DescriptorBase { private readonly IList messageTypes; private readonly IList enumTypes; private readonly IList services; private readonly IList extensions; private readonly IList dependencies; private readonly DescriptorPool pool; public FileDescriptor(FileDescriptorProto proto, FileDescriptor file) : base(proto, file) { } /// /// The package as declared in the .proto file. This may or may not /// be equivalent to the .NET namespace of the generated classes. /// public string Package { get { return Proto.Package; } } /// /// Unmodifiable list of top-level message types declared in this file. /// public IList MessageTypes { get { return messageTypes; } } /// /// Unmodifiable list of top-level enum types declared in this file. /// public IList EnumTypes { get { return enumTypes; } } /// /// Unmodifiable list of top-level services declared in this file. /// public IList Services { get { return services; } } /// /// Unmodifiable list of top-level extensions declared in this file. /// public IList Extensions { get { return extensions; } } /// /// Unmodifiable list of this file's dependencies (imports). /// public IList Dependencies { get { return dependencies; } } public static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) { throw new NotImplementedException(); } /// /// This method is to be called by generated code only. It is equivalent /// to BuilderFrom except that the FileDescriptorProto is encoded in /// protocol buffer wire format. /// public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, FileDescriptor[] dependencies) { FileDescriptorProto proto = FileDescriptorProto.ParseFrom(descriptorData); return BuildFrom(proto, dependencies); } } }