/// <summary> /// Creates a new module detail object. /// </summary> /// <param name="moduleObjectDetailType">Type of the module object detail.</param> /// <param name="editObject">The edit object.</param> /// <param name="focus">if set to <c>true</c> [focus].</param> /// <param name="tag">The tag.</param> /// <returns></returns> ModuleObjectDetailBase CreateNewModuleObjectDetail(Type moduleObjectDetailType, EditableObject editObject, bool focus, object tag) { ModuleObjectDetailBase moduleObjectDetail; if (editObject == null) { moduleObjectDetail = (ModuleObjectDetailBase)GetModuleObjectDetailContructorWithTagOnly(moduleObjectDetailType).Invoke(new object[] { tag }); } else { if (tag == null) { moduleObjectDetail = (ModuleObjectDetail)GetModuleObjectDetailContructor(moduleObjectDetailType, editObject.GetType()).Invoke(new object[] { editObject }); } else { moduleObjectDetail = (ModuleObjectDetail)GetModuleObjectDetailContructorWithTag(moduleObjectDetailType, editObject.GetType()).Invoke(new object[] { editObject, tag }); } } moduleObjectDetail.AfterDispose += OnModuleObjectDetailAfterDispose; AddModuleObjectDetail(moduleObjectDetail); if (focus) { moduleObjectDetail.Focus(); } return(moduleObjectDetail); }
public ModuleObjectDetailBase OpenModuleObjectDetail(EditableObject editObject, bool focus, object tag) { return(OpenModuleObjectDetail(editObject.Key, _moduleObjectDetailTypes[editObject.GetType()], editObject, focus, tag)); }