2 // Microsoft.Web.Services.Dime.DimeAttachment.cs
4 // Name: Duncan Mak (duncan@ximian.com)
6 // Copyright (C) Ximian, Inc. 2003
12 namespace Microsoft
.Web
.Services
.Dime
{
14 public class DimeAttachment
16 int chunk_size
= Int32
.MaxValue
; // docs list this as default
20 TypeFormatEnum type_format
;
22 public DimeAttachment ()
27 type_format
= TypeFormatEnum
.Unchanged
;
30 public DimeAttachment (string type
, TypeFormatEnum typeFormat
, string path
)
33 this.type_format
= typeFormat
;
35 if (File
.Exists (path
) == false)
36 throw new FileNotFoundException (
37 Locale
.GetText ("The path is not valid."));
40 public DimeAttachment (string type
, TypeFormatEnum typeFormat
, Stream stream
)
43 this.type_format
= typeFormat
;
47 public DimeAttachment (string id
, string type
, TypeFormatEnum typeFormat
, string path
)
48 : this (type
, typeFormat
, path
)
53 public DimeAttachment (string id
, string type
, TypeFormatEnum typeFormat
, Stream stream
)
54 : this (type
, typeFormat
, stream
)
59 public int ChunkSize
{
61 get { return chunk_size; }
63 set { chunk_size = value; }
73 public Stream Stream
{
75 get { return stream; }
79 throw new ArgumentNullException (
80 Locale
.GetText ("Argument is null."));
92 public TypeFormatEnum TypeFormat
{
94 get { return type_format; }
96 set { type_format = value; }