private IEnumerable <ImportLanguage> GetLanguages(Workbook workbook) { Sheet[] sheets = workbook.getSheets(); if (sheets.Length <= 0) { return(null); } var sheet = sheets[0]; var cells = sheet.getRow(0); var result = new List <ImportLanguage>(); // Пропускаем первый столбец, т.к. он зарезервирован под ключ локализации. for (var i = 1; i < cells.Length; ++i) { var cell = cells[i]; var value = cell.getContents(); if (string.IsNullOrWhiteSpace(value)) { value = string.Format("[Empty-{0}]", i); } if (!string.IsNullOrEmpty(value)) { var importLanguage = new ImportLanguage(value); result.Add(importLanguage); } } return(result); }
private void OnGuiLanguage(ImportLanguage language) { EditorGUILayout.BeginHorizontal(); var currentValue = language.IsUsed; currentValue = EditorGUILayout.Toggle(currentValue, GUILayout.Width(30)); if (currentValue != language.IsUsed) { language.IsUsed = currentValue; } GUI.enabled = language.IsUsed; GUILayout.Label(language.Value); GUI.enabled = true; EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); }