Exemple #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

            using (var application = new ButlerWinApplication
            {
                ConnectionString = connectionString,
                ApplicationName = "TheButler",
            })
            {
                application.CreateCustomObjectSpaceProvider += (s, e) =>
                {
                    e.ObjectSpaceProvider = new XPObjectSpaceProvider(new ConnectionStringDataStoreProvider(e.ConnectionString));
                };

                application.DatabaseUpdateMode       = DatabaseUpdateMode.UpdateOldDatabase;
                application.DatabaseVersionMismatch += (s, e) =>
                {
                    if (Debugger.IsAttached)
                    {
                        e.Updater.Update();
                        e.Handled = true;
                    }
                };


                application.Setup();
                application.Start();
            }
        }
Exemple #2
0
        public void Ctor_WithNoArguments_DoesntThrow()
        {
            ButlerWinApplication sut = new ButlerWinApplication();

            sut.Should().BeAssignableTo <WinApplication>();
        }