| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | using Aitex.Core.RT.Log;using Aitex.Core.Util;using Prism.Ioc;using Prism.Modularity;using Prism.Unity;using System;using System.Threading;using System.Windows;using System.Windows.Media.Animation;using Venus_UI.Views;using WPF.Themes.UserControls;using System.Configuration;namespace Venus_UI{    /// <summary>    /// App.xaml 的交互逻辑    /// </summary>    public partial class App : PrismApplication    {        protected override void OnStartup(StartupEventArgs e)        {            Mutex mutex;            bool ret;            mutex = new Mutex(true, "Venus_UI", out ret);            if (!ret)            {                WPFMessageBox.ShowError("Only One Venus_UI is allowed");                Environment.Exit(0);            }            FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;            DispatcherUnhandledException += App_DispatcherUnhandledException;            Singleton<LogManager>.Instance.Initialize();            var TimelineDesiredFrameRate =Convert.ToInt32( ConfigurationManager.AppSettings["TimelineDesiredFrameRate"]);            Timeline.DesiredFrameRateProperty.OverrideMetadata(               typeof(Timeline),               new FrameworkPropertyMetadata { DefaultValue = TimelineDesiredFrameRate }               );            base.OnStartup(e);        }        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)        {            LOG.Info("UI程序异常." +  e.Exception.Message);            e.Handled = true;        }        protected override Window CreateShell()        {            return Container.Resolve<ShellView>();        }        protected override void RegisterTypes(IContainerRegistry containerRegistry)        {        }        protected override IModuleCatalog CreateModuleCatalog()        {            return new ConfigurationModuleCatalog();        }    }}
 |