internal static uint ParseAttachmentMethod(AttachmentMethod method) { if (method == AttachmentMethod.NoAttachment) { return(0); } else if (method == AttachmentMethod.AttachByValue) { return(1); } else if (method == AttachmentMethod.AttachByReference) { return(2); } else if (method == AttachmentMethod.AttachByReferenceResolve) { return(3); } else if (method == AttachmentMethod.AttachByReferenceOnly) { return(4); } else if (method == AttachmentMethod.EmbeddedMessage) { return(5); } else if (method == AttachmentMethod.Ole) { return(6); } else { return(0); } }
internal static AttachmentMethod GetAttachmentMethod(TnefPropertyBag properties) { AttachmentMethod result = AttachmentMethod.AttachByValue; object obj = properties[TnefPropertyId.AttachMethod]; if (obj is int) { result = (AttachmentMethod)((int)obj); } return(result); }
internal static string GetRawFileName(TnefPropertyBag properties, bool stnef) { AttachmentMethod attachmentMethod = Utility.GetAttachmentMethod(properties); if (attachmentMethod == AttachmentMethod.EmbeddedMessage) { return(properties.GetProperty(TnefPropertyTag.DisplayNameA, stnef) as string); } string text = properties.GetProperty(TnefPropertyTag.AttachLongFilenameA, stnef) as string; if (string.IsNullOrEmpty(text)) { text = (properties.GetProperty(TnefPropertyTag.AttachFilenameA, stnef) as string); } return(text); }
public Attachment(TCRowMatrixData row) { foreach (var exProp in row) { switch (exProp.ID) { case 0x0e20: this.Size = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3704: if (exProp.Data != null) { this.Filename = Encoding.Unicode.GetString(exProp.Data); } break; case 0x3705: this.Method = (AttachmentMethod)BitConverter.ToUInt32(exProp.Data, 0); break; case 0x370b: this.RenderingPosition = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3714: var flags = BitConverter.ToUInt32(exProp.Data, 0); this.InvisibleInHTML = (flags & 0x1) != 0; this.InvisibleInRTF = (flags & 0x02) != 0; this.RenderedInBody = (flags & 0x04) != 0; break; case 0x67F2: this.LTPRowID = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x67F3: this.LTPRowVer = BitConverter.ToUInt32(exProp.Data, 0); break; default: break; } } }
public Attachment(TCRowMatrixData row) { foreach (var exProp in row) { switch (exProp.ID) { case 0x0e20: this.Size = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3704: if (exProp.Data != null) this.Filename = Encoding.Unicode.GetString(exProp.Data); break; case 0x3705: this.Method = (AttachmentMethod) BitConverter.ToUInt32(exProp.Data, 0); break; case 0x370b: this.RenderingPosition = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x3714: var flags = BitConverter.ToUInt32(exProp.Data, 0); this.InvisibleInHTML = (flags & 0x1) != 0; this.InvisibleInRTF = (flags & 0x02) != 0; this.RenderedInBody = (flags & 0x04) != 0; break; case 0x67F2: this.LTPRowID = BitConverter.ToUInt32(exProp.Data, 0); break; case 0x67F3: this.LTPRowVer = BitConverter.ToUInt32(exProp.Data, 0); break; default: break; } } }