Exemple #1
0
        static AppContextManager()
        {
            FullPath = Path.GetFullPath(SettingsManager.XmlSettings.Launcher.Files.AppInfo);
            Logger   = LogManager.CreateLogger("AppContextManager");

            Context = Bindable.Variable(DefaultAppInfo);

            Context.HasChanged += delegate(IBindable <AppInfo> bindable)
            {
                if (bindable.Value != null && bindable.Value != DefaultAppInfo)
                {
                    Logger.Debug("Context changed. Trying to set client icon.");
                    LaunchManager.SetClientIcon();
                }
            };
        }
        public LaunchManager()
        {
            this.Initialize();

            State = Bindable.Variable(LaunchManagerState.Idle);

            // TODO: is this needed on windows?
            // the following is needed on linux... the current directory must be the Mono executable, which is bad.
            string assemblyLocation = Assembly.GetExecutingAssembly().Location;
            string assemblyFolder   = Path.GetDirectoryName(assemblyLocation);

            Environment.CurrentDirectory = assemblyFolder;

            // also sets up AppContextManager
            PatchManager.Initialize();

            // TODO: could just Thread.Sleep instead of calling it again, but LiteDB migration is on roadmap, so whatever
            AppContextManager.Setup();
        }