/// <summary> /// Adds a new property row. /// </summary> /// <param name="label">Property name.</param> /// <param name="prop">Property control.</param> /// <param name="value">Initial value.</param> /// <returns>Newly created row.</returns> public PropertyRow Add(String label, Property.Base prop, String value = "") { PropertyRow row = new PropertyRow(this, prop); row.Dock = Pos.Top; row.Label = label; row.ValueChanged += OnRowValueChanged; prop.SetValue(value, true); m_SplitterBar.BringToFront(); return(row); }
/*public Base Add(string label, object value) * { * switch (value.GetType()) { * //case typeof() * } * PropertyRow<T> row = new PropertyRow<T>(this, prop); * row.Dock = Pos.Top; * row.Label = label; * row.ValueChanged += OnRowValueChanged; * * prop.SetValue(value, true); * * // m_SplitterBar.BringToFront(); * return row; * }*/ /// <summary> /// Adds a new property row. /// </summary> /// <param name="label">Property name.</param> /// <param name="prop">Property control.</param> /// <param name="value">Initial value.</param> /// <returns>Newly created row.</returns> public PropertyRow <T> Add <T>(string label, Property.Base <T> prop, T value = default(T)) { PropertyRow <T> row = new PropertyRow <T>(this, prop); row.Dock = Pos.Top; row.Label = label; row.ValueChanged += OnRowValueChanged; prop.SetValue(value, true); // m_SplitterBar.BringToFront(); return(row); }