Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:44:33+00:00 2026-05-22T21:44:33+00:00

In my project I have two libraries that would currently result in a circular

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:44:33+00:00Added an answer on May 22, 2026 at 9:44 pm

    I think that this is a sign of a flawed design. Do you want the class library containing Foo to be unknowning of the editing GUI? In that case it shouldn’t contain the EditorAttribute.

    One solution could be to regard the Foo class as your model in a MVVM architecture. Then you can create a wrapping ViewModel in the GUI class library where the EditorAttribute is applied. If you extract an interface IFoo which i placed in your model class library you can use the decorator pattern.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution that contains two projects. One project is an ASP.NET Web
I have two projects, the DLL project which has all my logic and data
I have a project where I have to interact with two different devices that
I have a C# project in VS2008 which I wish to build for two
I currently have a project there are a number of forms that are processed
I have a project that uses 3 other projects as libraries and has quite
Suppose I have two branches of a project IMClient-MacOS and IMClient-Windows, and their code
I'm looking to have two versions of BOOST compiled into a project at the
I am using git for windows to manage a local project. I have two
I have a project with two silverlight apps (foo1 and foo2) and an ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.