Esempio n. 1
0
        private void OnSelectedInstallChanged(InstallLocation install)
        {
            Options.Clear();

            if (install == null)
            {
                return;
            }

            Task.Run(() =>
            {
                try
                {
                    var categories = SettingsController.GetDcsCategoryOptionForInstall(install, false);
                    var category   = categories.FirstOrDefault(c => c.Id == _categoryId);

                    if (category == null)
                    {
                        return;
                    }

                    var models = OptionModelFactory.CreateAll(category.Options);

                    foreach (var model in models)
                    {
                        model.ValueChangeObservable.Subscribe(value => OnValueChanged(model, value));
                        Options.AddOnScheduler(model);
                    }
                }
                catch (Exception e)
                {
                    GeneralExceptionHandler.Instance.OnError(e);
                }
            });
        }