~ubuntu-branches/ubuntu/gutsy/tomboy/gutsy-updates

« back to all changes in this revision

Viewing changes to Tomboy/dbus-sharp/dbus-sharp/src/MessageFilter.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-11-22 19:22:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061122192217-odnb17d1ib22okof
Tags: 0.5.1-0ubuntu1
* New upstream release:
  + New Managed D-Bus/DBusSharp (Sebastian Dröge)
  + Additional search interface improvements
  + More secure wrapper script to launch Tomboy.exe
  + Fix panel and TrayIcon resizing
  + Fix 1x1 pixel TrayIcon
  + Removed old tintin image
* debian/control:
  + Update build dependencies
* debian/patches/01-dbus0.9.patch,
  debian/patches/50_tintin.patch,
  debian/patches/51_tomboy-dllmap.patch,
  debian/patches/52_external-dbus-sharp.patch,
  debian/patches/53_tomboy-tray-icon.patch:
  + Dropped, merged upstream
* debian/rules,
  debian/tomboy.desktop:
  + Use upstream's desktop file again after it was fixed now
* debian/rules:
  + DBus service file path workaround removed, it's fixed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2006 Alp Toker <alp@atoker.com>
 
2
// This software is made available under the MIT License
 
3
// See COPYING for details
 
4
 
 
5
using System;
 
6
 
 
7
namespace NDesk.DBus
 
8
{
 
9
        public class MessageFilter
 
10
        {
 
11
                //this should probably be made to use HeaderField or similar
 
12
                //this class is not generalized yet
 
13
 
 
14
                public static string MessageTypeToString (MessageType mtype)
 
15
                {
 
16
                        switch (mtype)
 
17
                        {
 
18
                                case MessageType.MethodCall:
 
19
                                        return "method_call";
 
20
                                case MessageType.MethodReturn:
 
21
                                        return "method_return";
 
22
                                case MessageType.Error:
 
23
                                        return "error";
 
24
                                case MessageType.Signal:
 
25
                                        return "signal";
 
26
                                case MessageType.Invalid:
 
27
                                        return "invalid";
 
28
                                default:
 
29
                                        throw new Exception ("Bad MessageType: " + mtype);
 
30
                        }
 
31
                }
 
32
 
 
33
                public static string CreateMatchRule (MessageType mtype)
 
34
                {
 
35
                        return "type='" + MessageTypeToString (mtype) + "'";
 
36
                }
 
37
 
 
38
                public static string CreateMatchRule (MessageType type, ObjectPath path, string @interface, string member)
 
39
                {
 
40
                        return "type='" + MessageTypeToString (type) + "',path='" + path.Value + "',interface='" + @interface + "',member='" + member + "'";
 
41
                }
 
42
 
 
43
                //TODO
 
44
                //this is useful as a Predicate<Message> delegate
 
45
                public bool Match (Message message)
 
46
                {
 
47
                        return false;
 
48
                }
 
49
        }
 
50
}