关于多个命名空间的问 [英] Question about multiple namespace

查看:105
本文介绍了关于多个命名空间的问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在访问不同的

命名空间中的某些信息时遇到了一些问题,

希望有人可以指出我做错了什么。


我有一个dll文件,我不想在我的程序中使用,我只想在我的程序中使用

函数

。但是在将课程放入我的课程后,我似乎无法获得

funcs来编译。


// ------------------------------------------------ ------------------------------

namespace TextBox_Editor

{

公共部分类frmMain:表格

{

公共frmMain()

{

InitializeComponent();

}


//我想从下面的主要访问''设置''

//范围,但错误表明它不知道它是什么。

private void frmMain_Load(object sender,EventArgs e)

{

TextBox1.Settings.Keywords.Add(" function");

}


命名空间荧光笔

{

公共类MyTextBox:System.Windows.Forms.TextBox

{

private mySettings m_settings = new mySettings();

private string strtrLine ="" ;;


public SyntaxSet设置

{

get {return m_settings; }

}

}

}

}

}


我需要做些什么才能让它发挥作用?

TIA

解决方案

Rob Stevens< ro ********** @ sundry.comwrote:


我在访问某些信息时遇到了一些问题不同的

命名空间,希望有人可以指出我做错了什么。



好​​吧,你还没有显示TextBox1的声明位置和方式。它是声明为MyTextBox的
吗?这部分是否有效,除非获得

设置?


-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet

英国的世界级.NET培训: http:// iterativetraining .co.uk




+


-

Ignacio Machin
http://www.laceupsolutions.com

手机&仓库解决方案。

" Rob Stevens" < ro ********** @ sundry.com写了留言

新闻:uP ************** @ TK2MSFTNGP02.phx.gbl ...


>我在访问其他
命名空间中的某些信息时遇到了一些问题,

希望如此有人可以指出我做错了什么。


我有一个dll文件,我不想在我的程序中使用,我只想

使用功能

在我的程序中。



我不明白上面的内容,如果你使用的是DLL的方法,那你
正在使用DLL
< blockquote class =post_quotes>
>

我需要做些什么才能让它发挥作用?



你得到了什么错误?


如果你使用的方法我不明白您的


正在使用DLL



我不是在尝试使用DLL,我只想使用

dll中的函数,但我想在我的程序中使用

函数而不是外部dll文件。


I am having a bit of a problem accessing some information in a different
namespace,
hopefully someone can point out what I am doing wrong.

I have a dll file that I dont want to use in my program, I just want to use
the functions
in my program. But after placing the class into my program, I can''t seem to
get the
funcs to compile.

//------------------------------------------------------------------------------
namespace TextBox_Editor
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}

// I want to access ''Settings'' from below here in the main
// scope but the error states it does not kow what it is.
private void frmMain_Load(object sender, EventArgs e)
{
TextBox1.Settings.Keywords.Add("function");
}

namespace Highlighter
{
public class MyTextBox : System.Windows.Forms.TextBox
{
private mySettings m_settings = new mySettings();
private string strtrLine = "";

public SyntaxSettings Settings
{
get { return m_settings; }
}
}
}
}
}

What do I need to do here to get this to work?
TIA

解决方案

Rob Stevens <ro**********@sundry.comwrote:

I am having a bit of a problem accessing some information in a different
namespace, hopefully someone can point out what I am doing wrong.

Well, you haven''t shown where or how TextBox1 is declared. Is it
declared to be a MyTextBox? Does that part work, barring access to
Settings?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk


Hi,
+

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Rob Stevens" <ro**********@sundry.comwrote in message
news:uP**************@TK2MSFTNGP02.phx.gbl...

>I am having a bit of a problem accessing some information in a different
namespace,
hopefully someone can point out what I am doing wrong.

I have a dll file that I dont want to use in my program, I just want to
use the functions
in my program.

I do not understand the above, if you are using the methods of the DLL you
are using the DLL

>
What do I need to do here to get this to work?

What errors are you getting?


I do not understand the above, if you are using the methods of the DLL you

are using the DLL

I am not trying to use the DLL, I just want to use the functions from the
dll, but I want the
functions in my program and not an external dll file.


这篇关于关于多个命名空间的问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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