public object GetParameter(string name) { string result; if (DictionaryParameters.TryGetValue(name, out result)) { return(result); // returns string, not object! } WidgetParameterIndex index = WidgetManager.GetParameterIndexByName(name); if (index != WidgetParameterIndex.None) { object objectResult; if (ObjectParameters.TryGetValue((int)index, out objectResult)) { return(objectResult); } } if (Parent != null) { return(Parent.GetParameter(name)); } return(null); }
internal void SetProperty <T>(WidgetStyleType style, WidgetParameterIndex index, T value) { if (!HasStyle(style)) { throw new ArgumentException("Widget doesn't have style " + style + " assigned!"); } m_styles[(int)style].Set(m_styles, index, value); }
internal T GetProperty <T>(WidgetStyleType style, WidgetParameterIndex index, T defaultValue) { if (!HasStyle(style)) { style = m_styleType; } return(m_styles[(int)style].Get(index, defaultValue)); }
internal void Set(object instance, WidgetParameterIndex index, object value) { if (instance != null) { MakeWritable(instance); } m_data.ObjectParameters[(int)index] = value; }
internal void SetProperty <T>(WidgetParameterIndex index, T value) { for (int i = 0; i < m_styles.Length; i++) { if (!m_styles[i].IsEmpty) { m_styles[i].Set(m_styles, index, value); } } }
internal T Get <T>(WidgetParameterIndex index, T defaultValue) { object result = m_data.GetParameter(index); if (result == null) { return(defaultValue); } return((T)result); }
public object GetParameter(WidgetParameterIndex index) { object result; #if MEMORY_PRIORITY ObjectParameters.TryGetValue((int)index, out result); #else result = ObjectParameters[(int)index]; #endif if (result == null && Parent != null) { result = Parent.GetParameter(index); } return(result); }
internal T GetProperty <T>(WidgetParameterIndex index, T defaultValue) { return(m_styles[(int)m_styleType].Get(index, defaultValue)); }