internal static StylePropertyID[] GetPropertyIDs(StyleSheet sheet, int ruleIndex) { StyleSheetCache.SheetHandleKey key = new StyleSheetCache.SheetHandleKey(sheet, ruleIndex); StylePropertyID[] array; if (!StyleSheetCache.s_RulePropertyIDsCache.TryGetValue(key, out array)) { StyleRule styleRule = sheet.rules[ruleIndex]; array = new StylePropertyID[styleRule.properties.Length]; for (int i = 0; i < array.Length; i++) { array[i] = StyleSheetCache.GetPropertyID(styleRule.properties[i].name); } StyleSheetCache.s_RulePropertyIDsCache.Add(key, array); } return(array); }
internal static int GetEnumValue <T>(StyleSheet sheet, StyleValueHandle handle) { Debug.Assert(handle.valueType == StyleValueType.Enum); StyleSheetCache.SheetHandleKey key = new StyleSheetCache.SheetHandleKey(sheet, handle.valueIndex); int num; if (!StyleSheetCache.s_EnumToIntCache.TryGetValue(key, out num)) { string value = sheet.ReadEnum(handle).Replace("-", string.Empty); object obj = Enum.Parse(typeof(T), value, true); num = (int)obj; StyleSheetCache.s_EnumToIntCache.Add(key, num); } Debug.Assert(Enum.GetName(typeof(T), num) != null); return(num); }