WCF minOccures = "0" 实现
2009-08-07 16:43
211 查看
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.648")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/Microsoft.Office.Server.Search.Internal.A" +
"dministration")]
public partial class CrawlRuleInternal
{
private System.DateTime accountLastModifiedField;
private bool accountLastModifiedFieldSpecified;
......
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public System.DateTime accountLastModified
{
get
{
return this.accountLastModifiedField;
}
set
{
this.accountLastModifiedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool accountLastModifiedSpecified
{
get
{
return this.accountLastModifiedFieldSpecified;
}
set
{
this.accountLastModifiedFieldSpecified = value;
}
}
}
CrawlRuleInternal object = new CrawlRuleInternal ();
object.accountLastModifiedSpecified = true; // 执行序列化 有这个元素.
默认 this element is not serialization. minOccures = "0" 实现
0:Xsd.exe 生成一个公共字段。未应用 XML 相关属性,因此将使用默认的 XmlElementAttribute。另外,Xsd.exe 还生成 bool 类型的公共字段,其名称为追加了 Specified 的元素字段名称。例如,如果元素字段的名称为 startDate,则 bool 字段的名称将为 startDateSpecified。将某个对象序列化为 XML 时, XmlSerializer 类检查 bool 字段的值,以确定是否写入该元素。出现的 bool 字段具有 System.Xml.Serialization.XmlIgnoreAttribute,可防止它被 XmlSerializer 序列化。
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] // delete this sentense we can not serialization
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/Microsoft.Office.Server.Search.Internal.A" +
"dministration")]
public partial class CrawlRuleInternal
{
private System.DateTime accountLastModifiedField;
private bool accountLastModifiedFieldSpecified;
......
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public System.DateTime accountLastModified
{
get
{
return this.accountLastModifiedField;
}
set
{
this.accountLastModifiedField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool accountLastModifiedSpecified
{
get
{
return this.accountLastModifiedFieldSpecified;
}
set
{
this.accountLastModifiedFieldSpecified = value;
}
}
}
CrawlRuleInternal object = new CrawlRuleInternal ();
object.accountLastModifiedSpecified = true; // 执行序列化 有这个元素.
默认 this element is not serialization. minOccures = "0" 实现
0:Xsd.exe 生成一个公共字段。未应用 XML 相关属性,因此将使用默认的 XmlElementAttribute。另外,Xsd.exe 还生成 bool 类型的公共字段,其名称为追加了 Specified 的元素字段名称。例如,如果元素字段的名称为 startDate,则 bool 字段的名称将为 startDateSpecified。将某个对象序列化为 XML 时, XmlSerializer 类检查 bool 字段的值,以确定是否写入该元素。出现的 bool 字段具有 System.Xml.Serialization.XmlIgnoreAttribute,可防止它被 XmlSerializer 序列化。
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] // delete this sentense we can not serialization
相关文章推荐
- LINQ to Entities 实现sql 关键字"In"方式总结
- Android实习02:"摇一摇"功能的实现
- 通过javascript直接实现jQuery的$(".class1")方法
- META http-equiv="refresh" 实现网页自动跳转
- c语言:模拟实现printf,要求功能:print(&quot;ccc\ts!&quot;,&#39;b&#39;,&#39;i&#39;,&#39;t&#39;,&quot;welcome to you&quot;);
- Asp.net"页面加载中"效果实现
- 如何实现"设为首页","加入收藏"的功能
- ExpandableListView实例(三)_实现QQ中"未分组"效果和"未分组"不可编辑删除功能
- .net中实现 "选择文件夹"对话框
- 数据结构之应用"栈(Stack)"实现: 解析算术表达式及计算
- SQLServer varbinary 存储16进制末尾的"0"丢失
- 重装mysql后出现"cannot create windows service for mysql.error:0"错误
- javascript中"return obj === void 0"这种写法的原因和好处
- IO&&Serize 利用线程Thread.Sleep实现"自动输出"
- 主菜单中"窗口"子菜单的简单实现办法
- VB.NET中实现"关机/休眠/重启/注销"的类
- C语言关于"0" '0' '\0'之间的区别。
- 3 种方法实现参数的"动态"变化
- 孙鑫VC++深入详解:Lesson8 Part1---"逃跑"按钮的实现
- 【OpenCV】"(_Ptr_user&(_BIG_ALLOCATION_ALIGNMENT - 1)) ==0" && 0