Ejemplo n.º 1
0
        public static ActionSetModel FromEmbeddedData(IModelsProvider provider, IDbActionSet entry)
        {
            var model = new ActionSetModel();

            foreach (var actionEntry in entry.Actions)
            {
                var newAction = new ActionModel();
                newAction.Name        = actionEntry.Name;
                newAction.Id          = actionEntry.Id;
                newAction.Visibility  = actionEntry.Presentation.Visibility;
                newAction.Description = actionEntry.Description;
                FromEntry(newAction, actionEntry.Presentation);
                model.Items.Add(newAction);
            }


            //Items.UpdateAfter(() =>
            //{
            //    Items.Clear();

            //    foreach (var item in entry.Actions)
            //    {
            //        var newAction = NewItem();
            //        newAction.FromModel(item);
            //        Items.Add(newAction);
            //    }
            //});

            return(model);
        }
Ejemplo n.º 2
0
        public override void Load(IDbEntry entry)
        {
            _entry = entry as IDbActionSet ?? throw new InvalidOperationException($"Expected {nameof(IDbActionSet)}");

            base.Load(entry);
        }
Ejemplo n.º 3
0
 private ActionSetModel GetModelImpl(IDbActionSet entry)
 {
     return(ActionSetsDataHelper.FromEmbeddedData(Provider, entry));
 }