In my project I have two libraries that would currently result in a circular dependency which I am unable to resolve.
One library provides common data structures for the whole solution. This library contains a construct similar to this:
namespace Common {
public class Foo {
//[Editor( typeof( UserEditor ), typeof( UITypeEditor ) )]
public UInt32 OwnerId { get; set; }
}
public class User {
public UInt32 Id { get; set; }
}
}
Now in one of the projects in our solution, we would like to edit Foo
instances through a PropertyGrid and the OwnerId
property should be edited with a custom editor; this one:
using Common;
namespace Common.Gui {
public class OwnerEditor : UITypeEditor {
public static List<User> Users { get; set; }
}
}
Now, I can't just add an EditorAttribute
to Foo.OwnerId
because that would create a circular dependency and I would like to keep references to Common.Gui
out of Common
anyway. I would also like to avoid pulling code out of Common
into a new assembly as a lot of other projects reference it.
I found a question regarding adding EditorAttribute
at runtime, which sounded like a perfect solution, but I was unable to adept that to my problem.