Ejemplo n.º 1
0
        private void PhoneNumberPanelOnClickCountry()
        {
            var data = LocalCore.GetDataFromJsonFromPath <CountryModel>("CountryCode", "CountryCode").ToList();

            _countryPanel.gameObject.SetActive(true);
            _countryPanel.InitData(data);
            _countryPanel.Init(data);
        }
Ejemplo n.º 2
0
        private void InitContacts()
        {
            var data = LocalCore.GetDataFromJsonFromPath <ContactModel>("Contacts", "Contacts").ToList();

            _contactPanel.gameObject.SetActive(true);
            _contactPanel.InitData(data);
            _contactPanel.Init(data);
        }
Ejemplo n.º 3
0
        private void PartAppOnClick(ESettingsType type)
        {
            DestroyElmnt();

            var data = LocalCore.GetDataFromJsonFromPath <ParamModel>(type.ToString(), "Settings").ToList();

            _container.SetActive(true);
            InitParams(data, type);
        }
Ejemplo n.º 4
0
        protected void RebuildContextMenuItems(LibRetroCoreItem item, LocalCore core)
        {
            _contextMenuItems.Clear();
            string   name        = item.Downloaded ? "[Emulators.CoreUpdater.Update]" : "[Emulators.CoreUpdater.Download]";
            ListItem contextItem = new ListItem(Consts.KEY_NAME, name);

            contextItem.Command = new MethodDelegateCommand(() => DownloadCoreAsync(item, core));
            _contextMenuItems.Add(contextItem);
            _contextMenuItems.FireChange();
        }
Ejemplo n.º 5
0
        protected void DownloadCoreAsync(LibRetroCoreItem item, LocalCore core)
        {
            var  sm       = ServiceRegistration.Get <IScreenManager>();
            Guid?dialogId = null;

            ServiceRegistration.Get <IThreadPool>().Add(() =>
            {
                ProgressLabel = LocalizationHelper.Translate("[Emulators.CoreUpdater.Downloading]", core.CoreName);
                dialogId      = sm.ShowDialog(DIALOG_CORE_UPDATE_PROGRESS);
                DownloadCore(item, core);
            },
                                                        e =>
            {
                if (dialogId.HasValue)
                {
                    sm.CloseDialog(dialogId.Value);
                }
            });
        }
Ejemplo n.º 6
0
        protected ListItem CreateListItem(LocalCore core, bool downloaded, bool configured)
        {
            LibRetroCoreItem item = new LibRetroCoreItem();

            item.SetLabel(LABEL_CORE_NAME, core.CoreName);
            item.AdditionalProperties[KEY_CORE] = core;
            item.Downloaded = downloaded;
            item.Configured = configured;
            item.Command    = new MethodDelegateCommand(() => ShowContextMenu(item, core));

            if (core.Info != null)
            {
                item.SetLabel(Consts.KEY_NAME, core.Info.DisplayName);
                item.AdditionalProperties[KEY_CORE_INFO] = core.Info;
            }
            else
            {
                item.SetLabel(Consts.KEY_NAME, Path.GetFileNameWithoutExtension(core.CoreName));
            }
            return(item);
        }
Ejemplo n.º 7
0
        protected void DownloadCore(LibRetroCoreItem item, LocalCore core)
        {
            lock (_downloadSync)
            {
                if (_downloadingUrls.Contains(core.Url))
                {
                    return;
                }
                _downloadingUrls.Add(core.Url);
            }

            try
            {
                if (_coreHandler.DownloadCore(core))
                {
                    item.Downloaded = true;
                }
            }
            finally
            {
                lock (_downloadSync)
                    _downloadingUrls.Remove(core.Url);
            }
        }
Ejemplo n.º 8
0
 protected void ShowContextMenu(LibRetroCoreItem item, LocalCore core)
 {
     RebuildContextMenuItems(item, core);
     DialogHeader = item.Label(Consts.KEY_NAME, core.CoreName).Evaluate();
     ServiceRegistration.Get <IScreenManager>().ShowDialog(DIALOG_CONTEXT_MENU);
 }