/// <summary> /// Gets a media value from the specified <paramref name="control"/>. /// </summary> /// <param name="control">The parent control.</param> public static GridControlDtgeValue Parse(GridControl control) { if (control == null) { return(null); } GridControlDtgeValue value = new GridControlDtgeValue(control); if (value.Element == null) { return(value); } // Get the generic type that we wish to instantiate Type type = typeof(GridControlDtgeValue <>).MakeGenericType(value.Element.GetType()); // Create a generic DTGE value instance return((GridControlDtgeValue)Activator.CreateInstance(type, value, control)); }
/// <summary> /// Initializes a new instance based on the specified DTGE <paramref name="value"/>. /// </summary> /// <param name="value">An instance of <see cref="GridControlDtgeValue"/> representing the value to wrap.</param> /// <param name="control">An instance of <see cref="GridControl"/> representing the control.</param> protected GridControlDtgeValue(GridControlDtgeValue value, GridControl control) : base(control, control.JObject) { Id = value.Id; DtgeContentTypeAlias = value.DtgeContentTypeAlias; Element = value.Element; }
/// <summary> /// Initializes a new instance based on the specified DTGE <paramref name="value"/>. /// </summary> /// <param name="value">An instance of <see cref="GridControlDtgeValue"/> representing the value to wrap.</param> /// <param name="control">An instance of <see cref="GridControl"/> representing the control.</param> public GridControlDtgeValue(GridControlDtgeValue value, GridControl control) : base(value, control) { Element = (T)value.Element; }