~ubuntu-branches/ubuntu/raring/openmcdf/raring

« back to all changes in this revision

Viewing changes to src/OLECompoundFileStorage/CFException.cs

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2012-05-04 10:00:39 UTC
  • Revision ID: package-import@ubuntu.com-20120504100039-6opexlhz3d4cdj3y
Tags: upstream-1.5.2
Import upstream version 1.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Collections.Generic;
 
3
using System.Text;
 
4
using System.Runtime.Serialization;
 
5
 
 
6
/*
 
7
     The contents of this file are subject to the Mozilla Public License
 
8
     Version 1.1 (the "License"); you may not use this file except in
 
9
     compliance with the License. You may obtain a copy of the License at
 
10
     http://www.mozilla.org/MPL/
 
11
 
 
12
     Software distributed under the License is distributed on an "AS IS"
 
13
     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 
14
     License for the specific language governing rights and limitations
 
15
     under the License.
 
16
 
 
17
     The Original Code is OpenMCDF - Compound Document Format library.
 
18
 
 
19
     The Initial Developer of the Original Code is Federico Blaseotto.
 
20
*/
 
21
 
 
22
namespace OpenMcdf
 
23
{
 
24
    /// <summary>
 
25
    /// OpenMCDF base exception.
 
26
    /// </summary>
 
27
    [Serializable]
 
28
    public class CFException : Exception
 
29
    {
 
30
        public CFException()
 
31
            : base()
 
32
        {
 
33
        }
 
34
 
 
35
        protected CFException(SerializationInfo info, StreamingContext context)
 
36
            : base(info, context)
 
37
        {
 
38
        }
 
39
 
 
40
        public CFException(string message)
 
41
            : base(message, null)
 
42
        {
 
43
 
 
44
        }
 
45
 
 
46
        public CFException(string message, Exception innerException)
 
47
            : base(message, innerException)
 
48
        {
 
49
 
 
50
        }
 
51
 
 
52
    }
 
53
 
 
54
    /// <summary>
 
55
    /// Raised when a data setter/getter method is invoked
 
56
    /// on a stream or storage object after the disposal of the owner
 
57
    /// compound file object.
 
58
    /// </summary>
 
59
    [Serializable]
 
60
    public class CFDisposedException : CFException
 
61
    {
 
62
        public CFDisposedException()
 
63
            : base()
 
64
        {
 
65
        }
 
66
 
 
67
        protected CFDisposedException(SerializationInfo info, StreamingContext context)
 
68
            : base(info, context)
 
69
        {
 
70
        }
 
71
 
 
72
        public CFDisposedException(string message)
 
73
            : base(message, null)
 
74
        {
 
75
 
 
76
        }
 
77
 
 
78
        public CFDisposedException(string message, Exception innerException)
 
79
            : base(message, innerException)
 
80
        {
 
81
 
 
82
        }
 
83
 
 
84
    }
 
85
 
 
86
    /// <summary>
 
87
    /// Raised when opening a file with invalid header
 
88
    /// or not supported COM/OLE Structured storage version.
 
89
    /// </summary>
 
90
    [Serializable]
 
91
    public class CFFileFormatException : CFException
 
92
    {
 
93
        public CFFileFormatException()
 
94
            : base()
 
95
        {
 
96
        }
 
97
 
 
98
        protected CFFileFormatException(SerializationInfo info, StreamingContext context)
 
99
            : base(info, context)
 
100
        {
 
101
        }
 
102
 
 
103
        public CFFileFormatException(string message)
 
104
            : base(message, null)
 
105
        {
 
106
 
 
107
        }
 
108
 
 
109
        public CFFileFormatException(string message, Exception innerException)
 
110
            : base(message, innerException)
 
111
        {
 
112
 
 
113
        }
 
114
 
 
115
    }
 
116
 
 
117
    /// <summary>
 
118
    /// Raised when a named stream or a storage object
 
119
    /// are not found in a parent storage.
 
120
    /// </summary>
 
121
    [Serializable]
 
122
    public class CFItemNotFound : CFException
 
123
    {
 
124
        protected CFItemNotFound(SerializationInfo info, StreamingContext context)
 
125
            : base(info, context)
 
126
        {
 
127
        }
 
128
 
 
129
        public CFItemNotFound()
 
130
            : base("Entry not found")
 
131
        {
 
132
        }
 
133
 
 
134
        public CFItemNotFound(string message)
 
135
            : base(message, null)
 
136
        {
 
137
 
 
138
        }
 
139
 
 
140
        public CFItemNotFound(string message, Exception innerException)
 
141
            : base(message, innerException)
 
142
        {
 
143
 
 
144
        }
 
145
 
 
146
    }
 
147
 
 
148
    /// <summary>
 
149
    /// Raised when a method call is invalid for the current object state
 
150
    /// </summary>
 
151
    [Serializable]
 
152
    public class CFInvalidOperation : CFException
 
153
    {
 
154
         public CFInvalidOperation()
 
155
            : base()
 
156
        {
 
157
        }
 
158
 
 
159
        protected CFInvalidOperation(SerializationInfo info, StreamingContext context)
 
160
            : base(info, context)
 
161
        {
 
162
        }
 
163
 
 
164
        public CFInvalidOperation(string message)
 
165
            : base(message, null)
 
166
        {
 
167
 
 
168
        }
 
169
 
 
170
        public CFInvalidOperation(string message, Exception innerException)
 
171
            : base(message, innerException)
 
172
        {
 
173
 
 
174
        }
 
175
 
 
176
    }
 
177
 
 
178
    /// <summary>
 
179
    /// Raised when trying to add a duplicated CFItem
 
180
    /// </summary>
 
181
    /// <remarks>
 
182
    /// Items are compared by name as indicated by specs.
 
183
    /// Two items with the same name CANNOT be added within 
 
184
    /// the same storage or sub-storage. 
 
185
    /// </remarks>
 
186
    [Serializable]
 
187
    public class CFDuplicatedItemException : CFException
 
188
    {
 
189
        public CFDuplicatedItemException()
 
190
            : base()
 
191
        {
 
192
        }
 
193
 
 
194
        protected CFDuplicatedItemException(SerializationInfo info, StreamingContext context)
 
195
            : base(info, context)
 
196
        {
 
197
        }
 
198
 
 
199
        public CFDuplicatedItemException(string message)
 
200
            : base(message, null)
 
201
        {
 
202
 
 
203
        }
 
204
 
 
205
        public CFDuplicatedItemException(string message, Exception innerException)
 
206
            : base(message, innerException)
 
207
        {
 
208
 
 
209
        }
 
210
 
 
211
    }
 
212
 
 
213
 
 
214
 
 
215
}