注意:这似乎是MonoDevelop中相当常见的错误。MonoDevelop GTK#错误
我正在更新我写的C#Mono应用程序。我遇到了应用程序使用的一些对话框的问题。
例如,在下面的代码:
public partial class Generic : Gtk.Dialog
{
public Generic (string text, string title = "Error Notice", string label = "<b>Error Details</b>", int height = 150)
{
this.Build();
textview1.Buffer.Text = text;
this.Title = "Application - " + title;
label1.LabelProp = label;
this.DefaultHeight = height;
this.Resize(375, this.DefaultHeight);
}
protected void OnButtonOkClicked (object sender, System.EventArgs e)
{
this.Destroy();
}
}
我得到这些错误:
Error CS1061: Type `Namespace.Generic' does not contain a definition for `Build' and no extension method `Build' of type `Namespace.Generic' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Namespace)
Error CS0103: The name `textview1' does not exist in the current context (CS0103) (Namespace)
除了另一个用于LABEL1。问题是textview1 确实存在。那么为什么MonoDevelop告诉我它不是我不知道的。
我认为this.Build
是继承自Gtk.Dialog。正确?
这些工作较早,但现在,即使从头开始重新创建对话框并重新输入旧代码以实现功能,它仍然无法工作。
我的老编译仍然可以工作,所以虽然我不知道肯定做,这似乎表明,GTK#是工作的罚款...
任何帮助表示赞赏。谢谢。
由于这些是部分类,你不错过'其他'文件,可能是自动生成的? – skolima 2012-07-18 09:18:39
它们是gtk-gui中自动生成的文件。我想我可以通过它们来查看,但是我发现搞乱自动生成的文件往往是一个坏主意。 – Razick 2012-07-18 13:02:24