本文整理汇总了C#中IStream.WriteZero方法的典型用法代码示例。如果您正苦于以下问题:C# IStream.WriteZero方法的具体用法?C# IStream.WriteZero怎么用?C# IStream.WriteZero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStream
的用法示例。
在下文中一共展示了IStream.WriteZero方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildHeader
protected override void BuildHeader(IStream propertyStream)
{
// 1.1.1 Set 8 bytes reserve.
propertyStream.WriteZero(8);
// 1.1.2 Set Next Recipient Id
Int32 recipientCount = RecipientProperties.Count;
propertyStream.Write(recipientCount);
// 1.1.3 Set Next Attachment Id
propertyStream.Write(AttachmentProperties.Count);
// 1.1.4 Set Recipient Count
propertyStream.Write(recipientCount);
// 1.1.5 Set Attachment Count
propertyStream.Write(AttachmentProperties.Count);
// 1.1.6 Set 8 bytes Reserve;
propertyStream.WriteZero(8);
}
示例2: BuildHeader
protected override void BuildHeader(IStream propertyStream)
{
// 1.1.1 Set 8 bytes reserve.
propertyStream.WriteZero(8);
}
示例3: WritePropertyInfoToPropertyStream
protected virtual void WritePropertyInfoToPropertyStream(IStream propertyStream, IPropValue property)
{
if ((property is FixPropValue && !PropertyTag.IsGuidType(property.PropTag)) || (property is SpecialFixProperty))
{
// 1.2.1 Set fixed data
// 1.2.1.1 Set Tag
propertyStream.Write(property.PropTag.Bytes);
// 1.2.1.2 Set Flag
propertyStream.Write((Int32)0x06);
// 1.2.1.3 Set Value
var value = ModifyPropertyValue(property);
propertyStream.Write(value);
propertyStream.WriteZero(8 - value.Length);
}
else if((property is SpecialFixProperty) && property.PropTag.PropertyType == (short)PropertyType.PT_OBJECT)
{
// 1.2.1 Set fixed data
// 1.2.1.1 Set Tag
propertyStream.Write(property.PropTag.Bytes);
// 1.2.1.2 Set Flag
propertyStream.Write((Int32)0x06);
// 1.2.1.3 Set Value
var value = ModifyPropertyValue(property);
propertyStream.Write(value);
propertyStream.WriteZero(8 - value.Length);
}
else if (property is VarPropValue || PropertyTag.IsGuidType(property.PropTag) || property is SpecialVarBaseProperty)
{
// 1.2.2 Set variable data
// 1.2.2.1 Set Tag
var tag = GetPropertyTag(property.PropTag);
propertyStream.Write(tag);
// 1.2.2.2 Set Flag
propertyStream.Write((Int32)0x06);
// 1.2.2.3 Set Size
var valueSize = ModifyPropertyLength(property);
//var valueSize = property.PropValue.BytesCountForMsg;
//if (property.PropValue is VarStringValue)
//{
// if (valueSize == 0)
// propertyStream.Write((Int32)2);
// else
// propertyStream.Write(valueSize);
//}
//else
//{
propertyStream.Write(valueSize);
//}
// 1.2.2.4 Set Reserve , todo if contain embed message, it must set 0x01, if OLE, set 0x04;
propertyStream.WriteZero(4);
}
else if (property is MvPropValue)
{
// 1.2.3 Set variable data
// 1.2.3.1 Set Tag
var tag = GetPropertyTag(property.PropTag);
propertyStream.Write(tag);
// 1.2.3.2 Set Flag
propertyStream.Write((Int32)0x06);
// 1.2.3.3 Set Size, todo must check the length is all value's bytes total length;
if (PropertyTag.IsMultiVarType((ushort)property.PropTag.PropertyType))
{
propertyStream.Write((Int32)(((ISizeValue)property.PropValue).ItemCount) * 4);
}
else
{
propertyStream.Write((Int32)(((ISizeValue)property.PropValue).ItemCount) * PropertyTag.GetFixPropertyTypeLength((ushort)property.PropTag.PropertyType));
}
// 1.2.3.4 Set Reserve , todo if contain embed message, it must set 0x01, if OLE, set 0x04;
propertyStream.WriteZero(4);
}
}