示例#1
0
        protected virtual void CreateEditDialog(Action <IEditDialog> callback)
        {
            var dialogTypeKey = GetDialogTypeKey();
            var dialogType    = DialogTypeRegistry.Get(dialogTypeKey);

            Widget.CreateOfType(dialogType, options: new { }, init: dlg => callback((IEditDialog)dlg));
        }
示例#2
0
        protected virtual Type GetDialogTypeFor(string itemType)
        {
            if (itemType == GetItemType())
            {
                return(GetDialogType());
            }

            return(DialogTypeRegistry.Get(itemType));
        }
示例#3
0
        protected virtual Type GetDialogType()
        {
            if (dialogType == null)
            {
                var attributes = this.GetType().GetCustomAttributes(typeof(DialogTypeAttribute), true);
                if (attributes.Length >= 1)
                {
                    dialogType = attributes[0].As <DialogTypeAttribute>().Value;
                }
                else
                {
                    dialogType = DialogTypeRegistry.Get(GetEntityType());
                }
            }

            return(dialogType);
        }