コード例 #1
0
ファイル: Program.cs プロジェクト: nikitazu/AppDomainReloader
        static void Main(string[] args)
        {
            var stop = false;
            using (var host = new AppDomainReloader.DomainHost("foo"))
            {
                do
                {
                    if (host.IsDomainLoaded)
                    {
                        var domainEntry = host.CreateDynamicEntryPoint("TestApp.Library", "TestApp.Library.EntryPoint");
                        object answer = domainEntry.Execute(new YoMessage());
                        Console.WriteLine("data from domain: {0}", answer);
                    }

                    Console.WriteLine("Press <q> to quit, <r> to reload, <u> to unload, or any other key to continue");

                    var key = Console.ReadKey();
                    switch (key.Key)
                    {
                        case ConsoleKey.Q: stop = true; break;
                        case ConsoleKey.R: host.ReloadDomain(); break;
                        case ConsoleKey.U: host.UnloadDomain(); break;
                    }
                }
                while (!stop);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: forki/AppDomainReloader
        static void Main(string[] args)
        {
            var stop = false;

            using (var host = new AppDomainReloader.DomainHost("foo"))
            {
                do
                {
                    if (host.IsDomainLoaded)
                    {
                        var    domainEntry = host.CreateDynamicEntryPoint("TestApp.Library", "TestApp.Library.EntryPoint");
                        object answer      = domainEntry.Execute(new YoMessage());
                        Console.WriteLine("data from domain: {0}", answer);
                    }

                    Console.WriteLine("Press <q> to quit, <r> to reload, <u> to unload, or any other key to continue");

                    var key = Console.ReadKey();
                    switch (key.Key)
                    {
                    case ConsoleKey.Q: stop = true; break;

                    case ConsoleKey.R: host.ReloadDomain(); break;

                    case ConsoleKey.U: host.UnloadDomain(); break;
                    }
                }while (!stop);
            }
        }