1

我正在拼命地尝试制作一个非常简单的 C# 程序,利用混乱(在 MonoDevelop IDE 中)来证明功能,但我不熟悉 C# 约定。我需要构造一个杂乱对象然后引用它吗?我是否在我的图书馆中错误地声明了它?Clutter 应该是我的命名空间而不是 HelloWorld 吗?任何帮助将不胜感激。

using System;
using Clutter;

namespace HelloWorld {
    public class HelloWorld {
        public int Main () {            

            // Init declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            Clutter.Init ();

            Stage stage = Stage.Default;
            stage.Color = new Clutter.Color (0, 0, 0, 255);
            stage.SetSize (512, 512);

            stage.Show ();

            // Main declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            Clutter.Main ();

            return 0;
        }
    }
}
4

1 回答 1

0

我假设ClutterClutter命名空间中的一个类

using System;
using Clutter;

namespace HelloWorld {
    public class HelloWorld {
        public int Main () {            

            // Init declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            Clutter c = new Clutter();
            c.Init();

            Stage stage = Stage.Default;
            stage.Color = new Clutter.Color (0, 0, 0, 255);
            stage.SetSize (512, 512);

            stage.Show();

            // Main declaration produces error: 
            // Expression denotes a 'type', where a 'method group' was expected
            c.Main();

            return 0;
        }
    }
}
于 2011-10-18T01:55:24.273 回答