1 // Npgsql.NpgsqlNotificationEventArgs.cs
6 // Copyright (C) 2002 The Npgsql Development Team
7 // npgsql-general@gborg.postgresql.org
8 // http://gborg.postgresql.org/project/npgsql/projdisplay.php
11 // Permission to use, copy, modify, and distribute this software and its
12 // documentation for any purpose, without fee, and without a written
13 // agreement is hereby granted, provided that the above copyright notice
14 // and this paragraph and the following two paragraphs appear in all copies.
16 // IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY
17 // FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
18 // INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
19 // DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF
20 // THE POSSIBILITY OF SUCH DAMAGE.
22 // THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 // AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
25 // ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS
26 // TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
35 /// EventArgs class to send Notification parameters.
37 public class NpgsqlNotificationEventArgs : EventArgs
40 /// Process ID of the PostgreSQL backend that sent this notification.
42 public readonly int PID;
45 /// Condition that triggered that notification.
47 public readonly string Condition;
50 /// Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string)
52 public readonly string AdditionalInformation;
54 internal NpgsqlNotificationEventArgs(Stream stream, bool readAdditional)
56 PID = PGUtil.ReadInt32(stream);
57 Condition = PGUtil.ReadString(stream);
58 AdditionalInformation = readAdditional ? PGUtil.ReadString(stream) : string.Empty;