@@ -301,47 +301,43 @@ public class Attachment : Storage
301301 {
302302 #region Properties
303303 /// <summary>
304- /// Gets the filename.
304+ /// Returns the filename of the attachment
305305 /// </summary>
306- /// <value> The filename. </value>
307- public string Filename
306+ public string FileName
308307 {
309308 get
310309 {
311- var filename = GetMapiPropertyString ( Consts . PrAttachLongFilename ) ;
310+ var fileName = GetMapiPropertyString ( Consts . PrAttachLongFilename ) ;
312311
313- if ( string . IsNullOrEmpty ( filename ) )
314- filename = GetMapiPropertyString ( Consts . PrAttachFilename ) ;
312+ if ( string . IsNullOrEmpty ( fileName ) )
313+ fileName = GetMapiPropertyString ( Consts . PrAttachFilename ) ;
315314
316- if ( string . IsNullOrEmpty ( filename ) )
317- filename = GetMapiPropertyString ( Consts . PrDisplayName ) ;
315+ if ( string . IsNullOrEmpty ( fileName ) )
316+ fileName = GetMapiPropertyString ( Consts . PrDisplayName ) ;
318317
319- return filename ;
318+ return FileManager . RemoveInvalidFileNameChars ( fileName ) ;
320319 }
321320 }
322321
323322 /// <summary>
324- /// Gets the data.
323+ /// Retuns the data
325324 /// </summary>
326- /// <value> The data. </value>
327325 public byte [ ] Data
328326 {
329327 get { return GetMapiPropertyBytes ( Consts . PrAttachData ) ; }
330328 }
331329
332330 /// <summary>
333- /// Gets the content id.
331+ /// Returns the content id
334332 /// </summary>
335- /// <value> The content id. </value>
336333 public string ContentId
337334 {
338335 get { return GetMapiPropertyString ( Consts . PrAttachContentId ) ; }
339336 }
340337
341338 /// <summary>
342- /// Gets the rendering posisiton.
339+ /// Returns the rendering posisiton
343340 /// </summary>
344- /// <value> The rendering posisiton. </value>
345341 public int RenderingPosisiton
346342 {
347343 get { return GetMapiPropertyInt32 ( Consts . PrRenderingPosition ) ; }
@@ -404,6 +400,24 @@ public string Type
404400 get { return GetMapiPropertyString ( Consts . PrMessageClass ) ; }
405401 }
406402
403+ /// <summary>
404+ /// Returns the filename of the message object. For MSG object Outlook uses the subject. It strips
405+ /// invalid filename characters. When there is no filename the name from <see cref=" LanguageConsts.NameLessFileName"/>
406+ /// will be used
407+ /// </summary>
408+ public string FileName
409+ {
410+ get
411+ {
412+ var fileName = GetMapiPropertyString ( Consts . PrSubject ) ;
413+
414+ if ( string . IsNullOrEmpty ( fileName ) )
415+ fileName = LanguageConsts . NameLessFileName ;
416+
417+ return FileManager . RemoveInvalidFileNameChars ( fileName ) ;
418+ }
419+ }
420+
407421 /// <summary>
408422 /// Gets the list of recipients in the outlook message.
409423 /// </summary>
@@ -1078,7 +1092,7 @@ public Task(Storage message) : base(message._storage)
10781092 }
10791093 #endregion
10801094
1081- #region Properties
1095+ #region Fields
10821096 /// <summary>
10831097 /// The statistics for all streams in the IStorage associated with this instance.
10841098 /// </summary>
@@ -1103,7 +1117,9 @@ public Task(Storage message) : base(message._storage)
11031117 /// The IStorage associated with this instance.
11041118 /// </summary>
11051119 private NativeMethods . IStorage _storage ;
1120+ #endregion
11061121
1122+ #region Properties
11071123 /// <summary>
11081124 /// Gets the top level outlook message from a sub message at any level.
11091125 /// </summary>
0 commit comments