Provices a component Container implementation, and specifically handles interactions with the MainForm. This decouples platform-specific code from the user interaction code. This will make it easier to port to other GUI platforms.
Наследование: ICommandTarget, DecompilerHost, IStatusBarService
Пример #1
0
		public static void Main(string [] args)
		{
            var services = new ServiceContainer();
            if (args.Length == 0)
			{
                services.AddService(typeof(IServiceFactory), new ServiceFactory(services));
                services.AddService(typeof(IDialogFactory), new WindowsFormsDialogFactory(services));
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(ISettingsService), new WindowsFormsSettingsService(services));
                var interactor = new MainFormInteractor(services);
                interactor.Run();
            }
			else
			{
                var host = NullDecompilerHost.Instance;
                var listener = NullDecompilerEventListener.Instance;

                services.AddService(typeof (DecompilerEventListener), listener);
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(IConfigurationService), new DecompilerConfiguration());
                var ldr = new Loader(services);
				var dec = new DecompilerDriver(ldr, services);
				dec.Decompile(args[0]);
			}
		}
Пример #2
0
 public static void Main(string[] args)
 {
     var services = new ServiceContainer();
     services.AddService(typeof(IServiceFactory), new ServiceFactory(services));
     services.AddService(typeof(IDialogFactory), new WindowsFormsDialogFactory(services));
     services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
     services.AddService(typeof(ISettingsService), new WindowsFormsSettingsService(services));
     var interactor = new MainFormInteractor(services);
     interactor.Run();
 }