GetLauncherPathFromRegistry() public method

public GetLauncherPathFromRegistry ( IConfiguration config ) : string
config IConfiguration
return string
Beispiel #1
0
        public Profile CreateProfile()
        {
            var pNew = new Profile()
            {
                Name = "NewProfile",
                Id   = PendingProfiles.Count > 0 ? PendingProfiles.Max(p => p.Id) + 1 : 1
            };

            IConfiguration config = ConfigurationManager.FirstOrDefault();

            if (config != null)
            {
                pNew.GameModel.Type = config.GameType;

                ConfigurationManager CM = ConfigurationManager as ConfigurationManager;
                // we should not provide this api as public
                pNew.GameModel.GamePath     = CM.GetGamePathFromRegistry(config);
                pNew.GameModel.LauncherPath = CM.GetLauncherPathFromRegistry(config);
                if (config.IsWebAvailable)
                {
                    Server serv = config.ServersProvider.ServerList.FirstOrDefault();
                    if (serv != null)
                    {
                        pNew.Rotation.ServerId = serv.Identifier;
                    }
                }
            }
            pNew.News.TwitterUser = Utils.GetDefaultTwitter();
            pNew.LaunchMode       = App.Kernel.Get <LauncherManager>().Default.Mnemonic;

            PendingProfiles.Add(pNew);
            OnCollectionChanged();
            return(pNew);
        }