~ubuntu-branches/ubuntu/lucid/tomboy/lucid-proposed

« back to all changes in this revision

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

Tags: upstream-0.9.7
ImportĀ upstreamĀ versionĀ 0.9.7

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
 
using System.IO;
7
 
using Mono.Unix;
8
 
 
9
 
namespace NDesk.DBus.Transports
10
 
{
11
 
        abstract class UnixTransport : Transport
12
 
        {
13
 
                public override void Open (AddressEntry entry)
14
 
                {
15
 
                        string path;
16
 
                        bool abstr;
17
 
 
18
 
                        if (entry.Properties.TryGetValue ("path", out path))
19
 
                                abstr = false;
20
 
                        else if (entry.Properties.TryGetValue ("abstract", out path))
21
 
                                abstr = true;
22
 
                        else
23
 
                                throw new Exception ("No path specified for UNIX transport");
24
 
 
25
 
                        Open (path, abstr);
26
 
                }
27
 
        
28
 
                public override string AuthString ()
29
 
                {
30
 
                        long uid = UnixUserInfo.GetRealUserId ();
31
 
 
32
 
                        return uid.ToString ();
33
 
                }
34
 
 
35
 
                public abstract void Open (string path, bool @abstract);
36
 
        }
37
 
}