Beispiel #1
0
        //窗口载入事件
        public AndLua(string projectpath)
        {
            InitializeComponent();
            //接收参数
            this.NowLuaFile = projectpath + "/main.lua";
            ProjectConfig   = projectpath + "/init.config";
            ProjectPath     = projectpath;
            RefreshTitle();
            //把当前窗口赋值
            form1 = this;
            //行号
            LuaEditor.ShowLineNumbers = true;
            //边距
            LuaEditor.Padding = new System.Windows.Thickness(0);
            //字体
            LuaEditor.FontFamily = new System.Windows.Media.FontFamily("Console");
            LuaEditor.FontSize   = 14;
            //Lua语法高亮
            LuaEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("Lua");
            //将Editor作为ElemetnHost的组件
            Editor.Child = LuaEditor;
            //实例化Lua核心库
            LuaFun luafun = new LuaFun();

            //注册核心库方法到Lua
            lua.RegisterFunction("print", luafun, luafun.GetType().GetMethod("print"));
        }
Beispiel #2
0
        //双击打开工程
        private void ProjectList_DoubleClick(object sender, EventArgs e)
        {
            AndLua andlua = new AndLua(this.ProjectList.SelectSubItem.PersonalMsg);

            this.Hide();
            andlua.ShowDialog();
            Application.ExitThread();
        }
Beispiel #3
0
 //接收参数
 public AddFile(AndLua andlua, string file) : this()
 {
     _andlua     = andlua;
     ProjectPath = file;
 }