当前位置: 首页>>代码示例>>C#>>正文


C# Loader.LoadAndExecute方法代码示例

本文整理汇总了C#中Loader.LoadAndExecute方法的典型用法代码示例。如果您正苦于以下问题:C# Loader.LoadAndExecute方法的具体用法?C# Loader.LoadAndExecute怎么用?C# Loader.LoadAndExecute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Loader的用法示例。


在下文中一共展示了Loader.LoadAndExecute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadFileOutToolStripMenuItem_Click

        private void loadFileOutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.openDialog.ShowDialog() != DialogResult.OK)
                return;

            string filename = this.openDialog.FileName;

            Loader loader = new Loader(filename, new VmCompiler());
            loader.LoadAndExecute(this.machine);
            this.SetMachine(this.machine);
        }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:11,代码来源:Browser.cs

示例2: Main

        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Machine machine = new Machine();

            if (File.Exists(BootFile))
            {
                Loader loader = new Loader(BootFile, new VmCompiler());
                loader.LoadAndExecute(machine);
            }

            Application.Run(new Browser(machine));
        }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:14,代码来源:Program.cs

示例3: CreateRemotingAndClientServerAndExportClass

 public void CreateRemotingAndClientServerAndExportClass()
 {
     Loader loader = new Loader(@"DefineRectangleWithNewAndInitialize.st", new SimpleCompiler());
     Machine machine = new Machine(true);
     RemotingHostServer server = new RemotingHostServer(machine, 10004, "Server4");
     Machine machine2 = new Machine(true);
     loader.LoadAndExecute(machine2);
     BaseClass rect = (BaseClass)machine2.GetGlobalObject("Rectangle");
     RemotingHostClient client = new RemotingHostClient("localhost", 10004, "Server4");
     client.Execute(rect.ToOutputString());
     object result = machine.GetGlobalObject("Rectangle");
     Assert.IsNotNull(result);
     Assert.IsInstanceOfType(result, typeof(BaseClass));
     object newresult = client.Evaluate("Rectangle new");
     Assert.IsNotNull(newresult);
     Assert.IsInstanceOfType(newresult, typeof(IObject));
     IObject newrect = (IObject)newresult;
     Assert.AreSame(rect, newrect.Behavior);
     Assert.AreEqual(10, newrect[0]);
     Assert.AreEqual(20, newrect[1]);
     server.Stop();
 }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:22,代码来源:RemotingTests.cs

示例4: LoadFile

 private void LoadFile(string filename)
 {
     Loader loader = new Loader(filename, new VmCompiler());
     loader.LoadAndExecute(this.machine);
 }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:5,代码来源:LibTests.cs

示例5: LoadFile

 private static void LoadFile(Machine machine, string filename)
 {
     Loader loader = new Loader(filename, new VmCompiler());
     loader.LoadAndExecute(machine);
 }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:5,代码来源:ImageSerializerTests.cs

示例6: Execute

        public void Execute(string command)
        {
            Machine current = Machine.Current;
            Loader loader = new Loader(new StringReader(command), new SimpleCompiler());

            try
            {
                this.machine.SetCurrent();
                loader.LoadAndExecute(this.machine);
            }
            finally
            {
                Machine.SetCurrent(current);
            }
        }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:15,代码来源:Host.cs

示例7: LoadMachine

 private Machine LoadMachine(string filename)
 {
     Machine machine = new Machine();
     Loader loader = new Loader(filename, new SimpleCompiler());
     loader.LoadAndExecute(machine);
     return machine;
 }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:7,代码来源:HostMachineTests.cs


注:本文中的Loader.LoadAndExecute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。