Exemple #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);
        }
Exemple #2
0
        public virtual void UpdateVM(IDbActionSet entry)
        {
            model = actionSetsDataProvider.GetActionSet(entry.Id);

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

                foreach (var item in model.Items)
                {
                    Items.Add(new ActionVM(item));
                }
            });

            SelectedIndex = 0;
        }
Exemple #3
0
        private void DrawAction(ActionSetModel actionSet, int id, float x, float y, int tileSize)
        {
            if (id >= actionSet.Items.Count)
            {
                return;
            }

            var action = actionSet.Items[id];

            if (!action.Visibility)
            {
                return;
            }

            var image = action.Icon;

            Target.DrawImage(image, x, y, tileSize, tileSize);
        }