1
// Copyright 2006 Alp Toker <alp@atoker.com>
2
// This software is made available under the MIT License
3
// See COPYING for details
9
public class MessageFilter
11
//this should probably be made to use HeaderField or similar
12
//this class is not generalized yet
14
public static string MessageTypeToString (MessageType mtype)
18
case MessageType.MethodCall:
20
case MessageType.MethodReturn:
21
return "method_return";
22
case MessageType.Error:
24
case MessageType.Signal:
26
case MessageType.Invalid:
29
throw new Exception ("Bad MessageType: " + mtype);
33
public static string CreateMatchRule (MessageType mtype)
35
return "type='" + MessageTypeToString (mtype) + "'";
38
public static string CreateMatchRule (MessageType type, ObjectPath path, string @interface, string member)
40
return "type='" + MessageTypeToString (type) + "',path='" + path.Value + "',interface='" + @interface + "',member='" + member + "'";
44
//this is useful as a Predicate<Message> delegate
45
public bool Match (Message message)