通过使用在C#中引用的项目引用类型 [英] Use types referenced by a referenced project in C#

查看:106
本文介绍了通过使用在C#中引用的项目引用类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来分裂我的应用程序划分为多个解决方案(换句话说,我刚刚到现实世界),我有一个情况我完全分隔条件从UI逻辑到一个单独的项目。在那里我跌倒是我的胶水code。

I'm new to splitting up my applications into multiple solutions (in other words I just got into the real world), I have a situation where I'm fully seperating the logic from the UI into a seperate project. Where I'm falling down is my glue code.

作为一个简单的例子。

内藏门轿车项目的项目引用,广播等

Project car references projects containing door,radio etc

项目库引用项目的车,但需要使用无线电。

Project garage references project car, but needs to use radio.

我是否需要添加一个引用在车库项目的电台项目?

Do I need to add a reference to the radio project in the garage project?

推荐答案

是的,你需要添加一个引用两个库。一般情况下,你需要一个参考直接添加到你声明的类型的所有库的使用;通过声明这些类型的变量,从他们那里继承,使用具有类型作为参数或返回类型等方法。

Yes, you'll need to add a reference to both libraries. In general, you need to add a reference to all libraries declaring types you directly use; by declaring variables of those types, inheriting from them, using methods that has the type as parameters or return type, etc.

这篇关于通过使用在C#中引用的项目引用类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆