protobuf 自动生成c# .cs文件 -protogen用法
来源:互联网 发布:苹果mac官方壁纸 编辑:程序博客网 时间:2024/06/06 10:49
usage: protogen -i:{infile2} [-i:{infile2}] [-o:{outfile}] [-t:{template}] [-p:{prop}[=value]] [-q] [-d]
-i: Input file(s); proto definitions, either as text or pre-compiled binary (via protoc)
-o: Output file; if none specified, writes to stdout
-t: Template to use; defaults to csharp
-p: Property for the template; value defaults to true; use -p:help to view available options
-q: Quiet; suppresses header
-d: Include all dependencies of the input files in the set so the set is self-contained.
-ns: Default namespace; used in code generation when no package is specified
C:\protobuf-net\ProtoGen>protogen -p:help
protobuf-net:protogen - code generator for .proto
CSharp template for protobuf-net.
Options:
General:
"help" - this page
Additional serializer support:
"xml" - enable explicit xml support (XmlSerializer)
"datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0)
"binary" - enable binary support (BinaryFormatter; not supported on Silverlight)
Other:
"protoRpc" - enable proto-rpc client
"observable" - change notification (observer pattern) support
"preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
"partialMethods" - provide partial methods for changes (requires C# 3.0)
"detectMissing" - provide *Specified properties to indicate whether fields are present
"lightFramework" - omit additional attributes not included in CF/Silverlight
"asynchronous" - emit asynchronous methods for use with WCF
"clientProxy" - emit asynchronous client proxy class
"import" - additional namespaces to import (semicolon delimited)
"fixCase" - change type/member names (types/properties become PascalCase; fields become camelCase)
Options:
General:
"help" - this page
Additional serializer support:
"xml" - enable explicit xml support (XmlSerializer)
"datacontract" - enable data-contract support (DataContractSerializer; requires .NET 3.0)
"binary" - enable binary support (BinaryFormatter; not supported on Silverlight)
Other:
"protoRpc" - enable proto-rpc client
"observable" - change notification (observer pattern) support
"preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
"partialMethods" - provide partial methods for changes (requires C# 3.0)
"detectMissing" - provide *Specified properties to indicate whether fields are present
"lightFramework" - omit additional attributes not included in CF/Silverlight
"asynchronous" - emit asynchronous methods for use with WCF
"clientProxy" - emit asynchronous client proxy class
"import" - additional namespaces to import (semicolon delimited)
"fixCase" - change type/member names (types/properties become PascalCase; fields become camelCase)
"observable" - change notification (observer pattern) support
属性成员会继承 global::System.ComponentModel.INotifyPropertyChanged接口,并在set 方法中实现 set { OnPropertyChanged(@"***"); _*** = value; }
"preObservable" - pre-change notification (observer pattern) support (requires .NET 3.5)
属性成员会继承 global::System.ComponentModel.INotifyPropertyChanging,并在set方法中实现 OnProerthChanged
"detectMissing" - provide *Specified properties to indicate whether fields are present
对于option成员,添加 *Specified() 接口,判断该成员函数是否被赋值
注:使用detectMissing选项 和 不使用,如果有option成员为空,序列化时,字节长度会不一样
0 0
- protobuf 自动生成c# .cs文件 -protogen用法
- 关于protogen工具生成的.cs文件,如何检测optional类型的数据是否存在
- xsd自动生成cs文件
- Protobuf-net ProtoGen的使用
- 如何使用protobuf-net生成.cs(c#)文件
- 关于ashx文件的.cs自动生成
- c# 调用 .cs 生成的 dll 文件
- 【protobuf进阶】通过.proto文件导出C#支持的.cs类文件
- .CS文件编译生成.DLL文件(C#网络搜集)
- c# cs 生成dll
- protobuf 生成C++文件
- Protobuf 简介及转换为.cs文件
- xml生成cs文件
- wsdl文件生成cs文件
- wsdl文件生成cs文件
- 如何在unity中使用protobuf工具生成cs类
- protobuf 生成对应的文件
- 【C#】 Xml文件序列化和反序列化,自动生成DataModel的.cs文件。
- 打造扛得住的MYSQL数据库架构
- Android M动态申请获取权限android.permission.READ_PHONE_STATE
- Jquery获取标签及对标签的相关操作
- 高仿Demo获取该App图片
- mysql启动失败Starting MySQL.The server quit without updating PID file ([失败]ysqllnmp.pid)
- protobuf 自动生成c# .cs文件 -protogen用法
- QT4.7开发环境搭建主要步骤,全志A33 + win7桌面版
- http协议里的chunked编码与测试
- 网宿开发环境总结
- PDO对象详解
- 第十三周项目5-拓扑排序算法验证
- SpringJunit4的使用
- Android开发艺术探索笔记(8)- View的基础
- 多线程经典案例:模仿储户取钱