Ejemplo n.º 1
0
        public DictionaryEditControl()
        {
            InitializeComponent();
            var commonEditController = new CommonObjectEditController();

            commonEditController.StartEditObject(null);
            this.ColumnObject.ColumnEdit = commonEditController.CreateRepositoryItem();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 编辑对象(允许新增和删除)
        /// </summary>
        /// <param name="objectType">对象类型</param>
        /// <param name="obj">待编辑的对象</param>
        /// <returns>DialogReturn</returns>
        public static DialogReturn ShowEditObjectDialog(Type objectType, object obj)
        {
            var commonObjectEditController = new CommonObjectEditController();

            commonObjectEditController.StartEditObject(objectType);
            var objectEditControl = commonObjectEditController.CreateEditControl(objectType) as BaseObjectEditControl;

            objectEditControl.EditValue = obj;
            return(WinFormPublic.ShowDialog(objectEditControl));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 编辑对象(不允许新增和删除)
        /// </summary>
        /// <param name="obj">待编辑的对象</param>
        /// <returns>DialogReturn</returns>
        public static DialogReturn ShowEditObjectDialog(object obj)
        {
            obj.CheckNotNull("待编辑对象不能为空");
            var commonObjectEditController = new CommonObjectEditController();
            var objType = obj.GetType();

            commonObjectEditController.StartEditObject(null);
            var objectEditControl = commonObjectEditController.CreateEditControl(obj.GetType()) as BaseObjectEditControl;

            objectEditControl.EditValue = obj;
            return(WinFormPublic.ShowDialog(objectEditControl));
        }