static void Main(string[] args) { ObjectBase.Container = MEFLoader.Initialize(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm form = new MainForm(); MainController controller = new MainController(form); using (SingletonController singletonController = new SingletonController("TVShowRename", form)) { if (singletonController.IsFirstInstance) { Application.Run((MainForm)singletonController.Enforcer); } else { singletonController.SendMessageToFirstInstance(args); } } }