private void InspectCategory(StratusLabeledObject category) { this.Log($"Now inspecting {category.label}"); dataCategoryLayout.elements[dataCategoryNavigator.previousIndex].Highlight(false); dataCategoryLayout.elements[dataCategoryNavigator.currentIndex].Highlight(true); runtimeInspector.Inspect(category.target); runtimeInspector.Select(); }
private void GenerateCategories() { dataCategories = GetDataCategories(prefs.data); if (dataCategories == null) { dataCategories = new StratusLabeledObject[] { new StratusLabeledObject(prefs.dataTypeName, prefs.data) }; } dataCategoryNavigator = new StratusArrayNavigator <StratusLabeledObject>(dataCategories, lastDataCategoryIndex); dataCategoryNavigator.onIndexChanged += this.OnDataCategoryChanged; List <StratusLayoutTextElementEntry> entries = new List <StratusLayoutTextElementEntry>(); for (int i = 0; i < dataCategories.Length; i++) { StratusLabeledObject category = dataCategories[i]; entries.Add(new StratusLayoutTextElementEntry(category.label, () => { dataCategoryNavigator.NavigateToElement(category); } )); } dataCategoryLayout.Set(entries); }
//------------------------------------------------------------------------/ // Procedures //------------------------------------------------------------------------/ private void OnDataCategoryChanged(StratusLabeledObject arg1, int arg2) { this.Log($"Category changed to {arg1.label}"); InspectCategory(arg1); }