Merge pull request #2394 from Mailaender/patch-1
[mono.git] / mcs / class / System.Messaging / System.Messaging / MessagePropertyFilter.cs
1 //
2 // System.Messaging
3 //
4 // Authors:
5 //      Peter Van Isacker (sclytrack@planetinternet.be)
6 //
7 // (C) 2003 Peter Van Isacker
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.ComponentModel;
33
34 namespace System.Messaging
35 {
36         [TypeConverter (typeof(ExpandableObjectConverter))]
37         public class MessagePropertyFilter
38         {
39                 private bool acknowledgeType = false;
40                 private bool acknowledgment = false;
41                 private bool administrationQueue = false;
42                 private bool appSpecific = false;
43                 private bool arrivedTime = false;
44                 private bool attachSenderId = false;
45                 private bool authenticated = false;
46                 private bool authenticationProviderName = false;
47                 private bool authenticationProviderType = false;
48                 private bool body = false;
49                 private bool connectorType = false;
50                 private bool correlationId = false;
51                 private int defaultBodySize = 1024;
52                 private int defaultExtensionSize = 255;
53                 private int defaultLabelSize = 255;
54                 private bool destinationQueue = false;
55                 private bool destinationSymmetricKey = false;
56                 private bool digitalSignature = false;
57                 private bool encryptionAlgorithm = false;
58                 private bool extension = false;
59                 private bool hashAlgorithm = false;
60                 private bool id = false;
61                 private bool isFirstInTransaction = false;
62                 private bool isLastInTransaction = false;
63                 private bool label = false;
64                 private bool messageType = false;
65                 private bool priority = false;
66                 private bool recoverable = false;
67                 private bool responseQueue = false;
68                 private bool senderCertificate = false;
69                 private bool senderId = false;
70                 private bool senderVersion = false;
71                 private bool sentTime = false;
72                 private bool sourceMachine = false;
73                 private bool timeToBeReceived = false;
74                 private bool timeToReachQueue = false;
75                 private bool transactionId = false;
76                 private bool transactionStatusQueue = false;
77                 private bool useAuthentication = false;
78                 private bool useDeadLetterQueue = false;
79                 private bool useEncryption = false;
80                 private bool useJournalQueue = false;
81                 private bool useTracing = false;
82
83                 [MonoTODO]
84                 public MessagePropertyFilter ()
85                 {
86
87                 }
88
89                 [DefaultValue (true)]
90                 [MessagingDescription ("MsgAcknowledgeType")]
91                 public bool AcknowledgeType
92                 {
93                         get { return acknowledgeType; }
94                         set { acknowledgeType = value; }
95                 }
96
97                 [DefaultValue (true)]
98                 [MessagingDescription ("MsgAcknowledgement")]
99                 public bool Acknowledgment
100                 {
101                         get { return acknowledgment; }
102                         set { acknowledgment = value; }
103                 }
104
105                 [DefaultValue (true)]
106                 [MessagingDescription ("MsgAdministrationQueue")]
107                 public bool AdministrationQueue
108                 {
109                         get { return administrationQueue; }
110                         set { administrationQueue = value; }
111                 }
112
113                 [DefaultValue (false)]
114                 [MessagingDescription ("MsgAppSpecific")]
115                 public bool AppSpecific
116                 {
117                         get { return appSpecific; }
118                         set { appSpecific = value; }
119                 }
120
121                 [DefaultValue (false)]
122                 [MessagingDescription ("MsgArrivedTime")]
123                 public bool ArrivedTime
124                 {
125                         get { return arrivedTime; }
126                         set { arrivedTime = value; }
127                 }
128
129                 [DefaultValue (false)]
130                 [MessagingDescription ("MsgAttachSenderId")]
131                 public bool AttachSenderId
132                 {
133                         get { return attachSenderId; }
134                         set { attachSenderId = value; }
135                 }
136
137                 [DefaultValue (false)]
138                 [MessagingDescription ("MsgAuthenticated")]
139                 public bool Authenticated
140                 {
141                         get { return authenticated; }
142                         set { authenticated = value; }
143                 }
144
145                 [DefaultValue (false)]
146                 [MessagingDescription ("MsgAuthenticationProviderName")]
147                 public bool AuthenticationProviderName
148                 {
149                         get { return authenticationProviderName; }
150                         set { authenticationProviderName = value; }
151                 }
152
153                 [DefaultValue (false)]
154                 [MessagingDescription ("MsgAuthenticationProviderType")]
155                 public bool AuthenticationProviderType
156                 {
157                         get { return authenticationProviderType; }
158                         set { authenticationProviderType = value; }
159                 }
160
161                 [DefaultValue (true)]
162                 [MessagingDescription ("MsgBody")]
163                 public bool Body
164                 {
165                         get { return body; }
166                         set { body = value; }
167                 }
168
169                 [DefaultValue (false)]
170                 [MessagingDescription ("MsgConnectorType")]
171                 public bool ConnectorType
172                 {
173                         get { return connectorType; }
174                         set { connectorType = value; }
175                 }
176
177                 [DefaultValue (false)]
178                 [MessagingDescription ("MsgCorrelationId")]
179                 public bool CorrelationId
180                 {
181                         get { return correlationId; }
182                         set { correlationId = value; }
183                 }
184
185                 [DefaultValue (1024)]
186                 [MessagingDescription ("MsgDefaultBodySize")]
187                 public int DefaultBodySize
188                 {
189                         get { return defaultBodySize; }
190                         set
191                         {
192                                 if (value < 0) 
193                                         throw new ArgumentException ("DefaultBodySize");
194                                 defaultBodySize = value;
195                         }
196                 }
197
198                 [DefaultValue (255)]
199                 [MessagingDescription ("MsgDefaultExtensionSize")]
200                 public int DefaultExtensionSize
201                 {
202                         get { return defaultExtensionSize; }
203                         set
204                         {
205                                 if (value < 0) 
206                                         throw new ArgumentException ("DefaultExtensionSize");
207                                 defaultExtensionSize = value;
208                         }
209                 }
210
211                 [DefaultValue (255)]
212                 [MessagingDescription ("MsgDefaultLabelSize")]
213                 public int DefaultLabelSize
214                 {
215                         get { return defaultLabelSize; }
216                         set
217                         {
218                                 if (value < 0) throw new ArgumentException ("DefaultLabelSize");
219                                 defaultLabelSize = value;
220                         }
221                 }
222
223                 [DefaultValue (false)]
224                 [MessagingDescription ("MsgDestinationQueue")]
225                 public bool DestinationQueue
226                 {
227                         get { return destinationQueue; }
228                         set { destinationQueue = value; }
229                 }
230
231                 [DefaultValue (false)]
232                 [MessagingDescription ("MsgDestinationSymmetricKey")]
233                 public bool DestinationSymmetricKey
234                 {
235                         get { return destinationSymmetricKey; }
236                         set { destinationSymmetricKey = value; }
237                 }
238
239                 [DefaultValue (false)]
240                 [MessagingDescription ("MsgDigitalSignature")]
241                 public bool DigitalSignature
242                 {
243                         get { return digitalSignature; }
244                         set { digitalSignature = value; }
245                 }
246
247                 [DefaultValue (false)]
248                 [MessagingDescription ("MsgEncryptionAlgorithm")]
249                 public bool EncryptionAlgorithm
250                 {
251                         get { return encryptionAlgorithm; }
252                         set { encryptionAlgorithm = value; }
253                 }
254
255                 [DefaultValue (false)]
256                 [MessagingDescription ("MsgExtension")]
257                 public bool Extension
258                 {
259                         get { return extension; }
260                         set { extension = value; }
261                 }
262
263                 [DefaultValue (false)]
264                 [MessagingDescription ("MsgHashAlgorithm")]
265                 public bool HashAlgorithm
266                 {
267                         get { return hashAlgorithm; }
268                         set { hashAlgorithm = value; }
269                 }
270
271                 [DefaultValue (false)]
272                 [MessagingDescription ("MsgId")]
273                 public bool Id
274                 {
275                         get { return id; }
276                         set { id = value; }
277                 }
278
279                 [DefaultValue (false)]
280                 [MessagingDescription ("MsgIsFirstInTransaction")]
281                 public bool IsFirstInTransaction
282                 {
283                         get { return isFirstInTransaction; }
284                         set { isFirstInTransaction = value; }
285                 }
286
287                 [DefaultValue (false)]
288                 [MessagingDescription ("MsgIsLastInTransaction")]
289                 public bool IsLastInTransaction
290                 {
291                         get { return isLastInTransaction; }
292                         set { isLastInTransaction = value; }
293                 }
294
295                 [DefaultValue (true)]
296                 [MessagingDescription ("MsgLabel")]
297                 public bool Label
298                 {
299                         get { return label; }
300                         set { label = value; }
301                 }
302
303                 [DefaultValue (true)]
304                 [MessagingDescription ("MsgMessageType")]
305                 public bool MessageType
306                 {
307                         get { return messageType; }
308                         set { messageType = value; }
309                 }
310
311                 [DefaultValue (false)]
312                 [MessagingDescription ("MsgPriority")]
313                 public bool Priority
314                 {
315                         get { return priority; }
316                         set { priority = value; }
317                 }
318
319                 [DefaultValue (false)]
320                 [MessagingDescription ("MsgRecoverable")]
321                 public bool Recoverable
322                 {
323                         get { return recoverable; }
324                         set { recoverable = value; }
325                 }
326
327                 [DefaultValue (true)]
328                 [MessagingDescription ("MsgResponseQueue")]
329                 public bool ResponseQueue
330                 {
331                         get { return responseQueue; }
332                         set { responseQueue = value; }
333                 }
334
335                 [DefaultValue (false)]
336                 [MessagingDescription ("MsgSenderCertificate")]
337                 public bool SenderCertificate
338                 {
339                         get { return senderCertificate; }
340                         set { senderCertificate = value; }
341                 }
342
343                 [DefaultValue (false)]
344                 [MessagingDescription ("MsgSenderId")]
345                 public bool SenderId
346                 {
347                         get { return senderId; }
348                         set { senderId = value; }
349                 }
350
351                 [DefaultValue (false)]
352                 [MessagingDescription ("MsgSenderVersion")]
353                 public bool SenderVersion
354                 {
355                         get { return senderVersion; }
356                         set { senderVersion = value; }
357                 }
358
359                 [DefaultValue (false)]
360                 [MessagingDescription ("MsgSentTime")]
361                 public bool SentTime
362                 {
363                         get { return sentTime; }
364                         set { sentTime = value; }
365                 }
366
367                 [DefaultValue (false)]
368                 [MessagingDescription ("MsgSourceMachine")]
369                 public bool SourceMachine
370                 {
371                         get { return sourceMachine; }
372                         set { sourceMachine = value; }
373                 }
374
375                 [DefaultValue (false)]
376                 [MessagingDescription ("MsgTimeToBeReceived")]
377                 public bool TimeToBeReceived
378                 {
379                         get { return timeToBeReceived; }
380                         set { timeToBeReceived = value; }
381                 }
382
383                 [DefaultValue (false)]
384                 [MessagingDescription ("MsgTimeToReachQueue")]
385                 public bool TimeToReachQueue
386                 {
387                         get { return timeToReachQueue; }
388                         set { timeToReachQueue = value; }
389                 }
390
391                 [DefaultValue (false)]
392                 [MessagingDescription ("MsgTransactionId")]
393                 public bool TransactionId
394                 {
395                         get { return transactionId; }
396                         set { transactionId = value; }
397                 }
398
399                 [DefaultValue (false)]
400                 [MessagingDescription ("MsgTransactionStatusQueue")]
401                 public bool TransactionStatusQueue
402                 {
403                         get { return transactionStatusQueue; }
404                         set { transactionStatusQueue = value; }
405                 }
406
407                 [DefaultValue (false)]
408                 [MessagingDescription ("MsgUseAuthentication")]
409                 public bool UseAuthentication
410                 {
411                         get { return useAuthentication; }
412                         set { useAuthentication = value; }
413                 }
414
415                 [DefaultValue (true)]
416                 [MessagingDescription ("MsgUseDeadLetterQueue")]
417                 public bool UseDeadLetterQueue
418                 {
419                         get { return useDeadLetterQueue; }
420                         set { useDeadLetterQueue = value; }
421                 }
422
423                 [DefaultValue (false)]
424                 [MessagingDescription ("MsgUseEncryption")]
425                 public bool UseEncryption
426                 {
427                         get { return useEncryption; }
428                         set { useEncryption = value; }
429                 }
430
431                 [DefaultValue (true)]
432                 [MessagingDescription ("MsgUseJournalQueue")]
433                 public bool UseJournalQueue
434                 {
435                         get { return useJournalQueue; }
436                         set { useJournalQueue = value; }
437                 }
438
439                 [DefaultValue (false)]
440                 [MessagingDescription ("MsgUseTracing")]
441                 public bool UseTracing
442                 {
443                         get { return useTracing; }
444                         set { useTracing = value; }
445                 }
446
447                 public void ClearAll ()
448                 {
449                         acknowledgeType = false;
450                         acknowledgment = false;
451                         administrationQueue = false;
452                         appSpecific = false;
453                         arrivedTime = false;
454                         attachSenderId = false;
455                         authenticated = false;
456                         authenticationProviderName = false;
457                         authenticationProviderType = false;
458                         body = false;
459                         connectorType = false;
460                         correlationId = false;
461                         destinationQueue = false;
462                         destinationSymmetricKey = false;
463                         digitalSignature = false;
464                         encryptionAlgorithm = false;
465                         extension = false;
466                         hashAlgorithm = false;
467                         id = false;
468                         isFirstInTransaction = false;
469                         isLastInTransaction = false;
470                         label = false;
471                         messageType = false;
472                         priority = false;
473                         recoverable = false;
474                         responseQueue = false;
475                         senderCertificate = false;
476                         senderId = false;
477                         senderVersion = false;
478                         sentTime = false;
479                         sourceMachine = false;
480                         timeToBeReceived = false;
481                         timeToReachQueue = false;
482                         transactionId = false;
483                         transactionStatusQueue = false;
484                         useAuthentication = false;
485                         useDeadLetterQueue = false;
486                         useEncryption = false;
487                         useJournalQueue = false;
488                         useTracing = false;
489                 }
490
491                 public void SetAll ()
492                 {
493                         acknowledgeType = true;
494                         acknowledgment = true;
495                         administrationQueue = true;
496                         appSpecific = true;
497                         arrivedTime = true;
498                         attachSenderId = true;
499                         authenticated = true;
500                         authenticationProviderName = true;
501                         authenticationProviderType = true;
502                         body = true;
503                         connectorType = true;
504                         correlationId = true;
505                         destinationQueue = true;
506                         destinationSymmetricKey = true;
507                         digitalSignature = true;
508                         encryptionAlgorithm = true;
509                         extension = true;
510                         hashAlgorithm = true;
511                         id = true;
512                         isFirstInTransaction = true;
513                         isLastInTransaction = true;
514                         label = true;
515                         messageType = true;
516                         priority = true;
517                         recoverable = true;
518                         responseQueue = true;
519                         senderCertificate = true;
520                         senderId = true;
521                         senderVersion = true;
522                         sentTime = true;
523                         sourceMachine = true;
524                         timeToBeReceived = true;
525                         timeToReachQueue = true;
526                         transactionId = true;
527                         transactionStatusQueue = true;
528                         useAuthentication = true;
529                         useDeadLetterQueue = true;
530                         useEncryption = true;
531                         useJournalQueue = true;
532                         useTracing = true;
533                 }
534
535                 [MonoTODO]
536                 public void SetDefaults ()
537                 {
538                         acknowledgeType = false;
539                         acknowledgment = false;
540                         administrationQueue = true;                     //
541                         appSpecific = false;
542                         arrivedTime = true;                             //
543                         attachSenderId = false;
544                         authenticated = false;
545                         authenticationProviderName = false;
546                         authenticationProviderType = false;
547                         body = true;                                            //
548                         connectorType = false;
549                         correlationId = true;                           //
550                         defaultBodySize = 1024;
551                         defaultExtensionSize = 255;
552                         defaultLabelSize = 255;
553                         destinationQueue = false;
554                         destinationSymmetricKey = false;
555                         digitalSignature = false;
556                         encryptionAlgorithm = false;
557                         extension = false;
558                         hashAlgorithm = false;
559                         id = true;                                                      //
560                         isFirstInTransaction = false;
561                         isLastInTransaction = false;
562                         label = true;                                           //
563                         messageType = false;
564                         priority = false;
565                         recoverable = false;
566                         responseQueue = true;                           //
567                         senderCertificate = false;
568                         senderId = false;
569                         senderVersion = false;
570                         sentTime = true;                                        //
571                         sourceMachine = false;
572                         timeToBeReceived = false;
573                         timeToReachQueue = false;
574                         transactionId = false;
575                         transactionStatusQueue = false;
576                         useAuthentication = false;
577                         useDeadLetterQueue = false;
578                         useEncryption = false;
579                         useJournalQueue = false;
580                         useTracing = false;
581                 }
582         }
583 }