Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Move InterfaceAttribute into the main namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Alp Toker committed Aug 30, 2006
1 parent b27eb3e commit 2e76c9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
13 changes: 1 addition & 12 deletions src/DBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See COPYING for details

using System;
using NDesk.DBus;

//namespace org.freedesktop.DBus
namespace org.freedesktop.DBus
Expand Down Expand Up @@ -83,16 +84,4 @@ public interface Bus : Introspectable
//undocumented in spec
void ReloadConfig ();
}

//Having this as an attribute is a bit silly, no?
[AttributeUsage (AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class InterfaceAttribute : Attribute
{
public string Name;

public InterfaceAttribute (string name)
{
this.Name = name;
}
}
}
15 changes: 13 additions & 2 deletions src/DProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public DProxy (Connection conn, ObjectPath opath, string dest, Type type) : base
//note that the foreach is useless since there can be only key
//probably does not deal with class inheritance etc.

foreach (org.freedesktop.DBus.InterfaceAttribute ia in type.GetCustomAttributes (typeof (org.freedesktop.DBus.InterfaceAttribute), false))
foreach (InterfaceAttribute ia in type.GetCustomAttributes (typeof (InterfaceAttribute), false))
conn.RegisteredTypes[type] = ia.Name;

foreach (Type t in type.GetInterfaces ())
foreach (org.freedesktop.DBus.InterfaceAttribute ia in t.GetCustomAttributes (typeof (org.freedesktop.DBus.InterfaceAttribute), false))
foreach (InterfaceAttribute ia in t.GetCustomAttributes (typeof (InterfaceAttribute), false))
conn.RegisteredTypes[t] = ia.Name;

/*
Expand Down Expand Up @@ -230,4 +230,15 @@ public static Signature GetSig (Type type)
return sig;
}
}

[AttributeUsage (AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class InterfaceAttribute : Attribute
{
public string Name;

public InterfaceAttribute (string name)
{
this.Name = name;
}
}
}

0 comments on commit 2e76c9d

Please sign in to comment.