internal void InitProperties(string abi = "")
 {
     try
     {
         string vmIdFromVmName = Utils.GetVmIdFromVmName(this.VmName);
         string empty          = string.Empty;
         this.Abi             = string.IsNullOrEmpty(abi) ? Utils.GetValueInBootParams("abivalue", this.VmName, string.Empty, this.OEM) : abi;
         this.mAppPlayerModel = InstalledOem.GetAppPlayerModel(this.OEM, this.Abi);
         string suffix = this.mAppPlayerModel.Suffix;
         if (RegistryManager.RegistryManagers.ContainsKey(this.OEM) && ((IEnumerable <string>)RegistryManager.RegistryManagers[this.OEM].VmList).Contains <string>(this.VmName))
         {
             if (string.IsNullOrEmpty(RegistryManager.RegistryManagers[this.OEM].Guest[this.VmName].DisplayName) && string.IsNullOrEmpty(this.InstanceDisplayName))
             {
                 if (string.Equals(this.VmName, "Android", StringComparison.InvariantCultureIgnoreCase))
                 {
                     this.InstanceDisplayName = BlueStacks.Common.Strings.ProductDisplayName + " " + suffix;
                 }
                 else
                 {
                     this.InstanceDisplayName = BlueStacks.Common.Strings.ProductDisplayName + " " + vmIdFromVmName + " " + suffix;
                 }
                 RegistryManager.RegistryManagers[this.OEM].Guest[this.VmName].DisplayName = this.InstanceDisplayName.Trim();
             }
             else if (!string.IsNullOrEmpty(this.InstanceDisplayName))
             {
                 RegistryManager.RegistryManagers[this.OEM].Guest[this.VmName].DisplayName = this.InstanceDisplayName + " " + suffix;
             }
             else
             {
                 this.InstanceDisplayName = RegistryManager.RegistryManagers[this.OEM].Guest[this.VmName].DisplayName;
             }
         }
         else if (string.IsNullOrEmpty(this.InstanceDisplayName))
         {
             if (string.Equals(this.VmName, "Android", StringComparison.InvariantCultureIgnoreCase))
             {
                 this.InstanceDisplayName = BlueStacks.Common.Strings.ProductDisplayName + " " + suffix;
             }
             else
             {
                 this.InstanceDisplayName = BlueStacks.Common.Strings.ProductDisplayName + " " + vmIdFromVmName + " " + suffix;
             }
         }
         this.InstanceCheckBoxChecked = false;
         this.InitInstanceState();
     }
     catch (Exception ex)
     {
         Logger.Error("Error in setting properties of instance" + ex?.ToString() + this.InstanceDisplayName + this.OEM + this.VmName + this.VmNameWithSuffix);
     }
 }
 public void SetEngineName()
 {
     try
     {
         if (this.mAppPlayerModel == null)
         {
             this.mAppPlayerModel = InstalledOem.GetAppPlayerModel(this.OEM, this.Abi);
         }
         this.EngineName = this.mAppPlayerModel.AppPlayerOemDisplayName;
     }
     catch (Exception ex)
     {
         Logger.Error("Error in setting vmname" + ex?.ToString() + InstalledOem.CoexistingOemList.ToString());
     }
 }
        private void OnCreateNewInstance(NewInstanceType instanceType)
        {
            Window window = (Window)null;

            if (this.View is Window view)
            {
                window = view.Owner;
            }
            this.CloseCurrentWindow();
            string str = "bgp".Equals("bgp", StringComparison.InvariantCultureIgnoreCase) ? "" : "_bgp";

            if (instanceType == NewInstanceType.Clone)
            {
                AppPlayerModel appPlayerModel = InstalledOem.GetAppPlayerModel("bgp", Utils.GetValueInBootParams("abivalue", "Android", string.Empty, "bgp"));
                Stats.SendMultiInstanceStatsAsync("clone_instance_clicked", "", "", "", 0, "", 0, "bgp", "", "", "", "", RegistryManager.Instance.CampaignMD5, true, "");
                Messenger.Default.Send <InstanceCreationMessage>(new InstanceCreationMessage()
                {
                    AppPlayerModel = appPlayerModel,
                    InstanceType   = instanceType,
                    CloneFromVm    = instanceType == NewInstanceType.Clone ? "Android" + str : (string)null
                });
            }
            else
            {
                Stats.SendMultiInstanceStatsAsync("fresh_instance_clicked", "", "", "", 0, "", 0, "bgp", "", "", "", "", RegistryManager.Instance.CampaignMD5, true, "");
                Messenger.Default.Send <ControlVisibilityMessage>(new ControlVisibilityMessage()
                {
                    IsVisible = true
                });
                SimpleIoc.Default.Unregister <NewEngineSelectorViewModel>();
                SimpleIoc.Default.Register <NewEngineSelectorViewModel>();
                NewEngineSelectorView engineSelectorView1 = new NewEngineSelectorView();
                engineSelectorView1.Owner = window;
                engineSelectorView1.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                NewEngineSelectorView engineSelectorView2 = engineSelectorView1;
                SimpleIoc.Default.GetInstance <NewEngineSelectorViewModel>().View = (IView)engineSelectorView2;
                SimpleIoc.Default.GetInstance <NewEngineSelectorViewModel>().SetOemData(InstalledOem.GetAppPlayerModel("bgp", Utils.GetValueInBootParams("abivalue", "Android", string.Empty, "bgp")));
                if (InstalledOem.CoexistingOemList.Count < 2)
                {
                    SimpleIoc.Default.GetInstance <NewEngineSelectorViewModel>().OemInstalledCheckABI();
                }
                else
                {
                    engineSelectorView2.ShowDialog();
                }
            }
        }
        public AboutSettingsControl(MainWindow window, SettingsWindow _)
        {
            this.ParentWindow = window;
            this.InitializeComponent();
            this.Visibility = Visibility.Hidden;
            this.Loaded    += new RoutedEventHandler(this.AboutSettingsControl_Loaded);
            AppPlayerModel appPlayerModel = InstalledOem.GetAppPlayerModel("bgp", Utils.GetValueInBootParams("abivalue", "Android", string.Empty, "bgp"));

            this.mVersionLabel.Content = (object)("v" + RegistryManager.Instance.Version);
            BlueStacksUIBinding.Bind(this.mSupportLabel, "STRING_SUPPORT");
            this.mSupportLabel.ContentStringFormat = "{0} - ";
            BlueStacksUIBinding.Bind(this.mWebsiteLabel, "STRING_WEBSITE");
            this.mWebsiteLabel.ContentStringFormat = "{0} - ";
            BlueStacksUIBinding.Bind(this.mSupportMailLabel, "STRING_SUPPORT_EMAIL");
            this.mSupportMailLabel.ContentStringFormat = "{0} - ";
            if (Oem.Instance.IsProductBeta)
            {
                Label mVersionLabel = this.mVersionLabel;
                mVersionLabel.Content = (object)(mVersionLabel.Content?.ToString() + LocaleStrings.GetLocalizedString("STRING_BETA", ""));
            }
            if (appPlayerModel != null && appPlayerModel.AppPlayerOsArch != null)
            {
                Label mVersionLabel = this.mVersionLabel;
                mVersionLabel.Content = (object)(mVersionLabel.Content?.ToString() + ", " + appPlayerModel.AppPlayerOsArch);
            }
            else if (Oem.Instance.IsAndroid64Bit)
            {
                Label mVersionLabel = this.mVersionLabel;
                mVersionLabel.Content = (object)(mVersionLabel.Content?.ToString() + ", " + LocaleStrings.GetLocalizedString("STRING_64BIT_ANDROID", ""));
            }
            else
            {
                Label mVersionLabel = this.mVersionLabel;
                mVersionLabel.Content = (object)(mVersionLabel.Content?.ToString() + ", " + LocaleStrings.GetLocalizedString("STRING_32BIT_ANDROID", ""));
            }
            this.mTermsOfUseLink.NavigateUri = new Uri(WebHelper.GetUrlWithParams(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}/{1}", (object)WebHelper.GetServerHost(), (object)"help_articles"), (string)null, (string)null, (string)null) + "&article=" + "terms_of_use");
            this.mDetailedChangeLogs.Inlines.Clear();
            this.mDetailedChangeLogs.Inlines.Add(LocaleStrings.GetLocalizedString("STRING_LEARN_WHATS_NEW", "Learn What's New"));
        }