Exemplo n.º 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));
        }
Exemplo n.º 2
0
        protected virtual Type GetDialogTypeFor(string itemType)
        {
            if (itemType == GetItemType())
            {
                return(GetDialogType());
            }

            return(DialogTypeRegistry.Get(itemType));
        }
Exemplo n.º 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);
        }