Ejemplo n.º 1
0
 public INavigationItem MapDomainModelToUi(INavigationItemDomain domainObject)
 {
     var downCast = (StandardNavigationItemDomain)domainObject;
     return new StandardNavigationItemModel()
     {
         Action = downCast.Action,
         ClassOverride = downCast.ClassOverride,
         DisplayText = downCast.DisplayText,
         Id = downCast.Id
     };
 }
Ejemplo n.º 2
0
        public INavigationMapper GetMapperForType(INavigationItemDomain objectToMap)
        {
            if (objectToMap == null) throw new ArgumentNullException();

            if (objectToMap is StandardNavigationItemDomain)
            {
                return new StandardNavigationMapper();
            }

            if (objectToMap is DropdownNavigationItemDomain)
            {
                return new DropdownNavigationMapper();
            }

            throw new NotImplementedException();
        }
Ejemplo n.º 3
0
        public INavigationItem MapDomainModelToUi(INavigationItemDomain domainObject)
        {
            var downCast = (DropdownNavigationItemDomain)domainObject;

            var p = new DropdownNavigationItem()
            {
                DisplayText = downCast.DisplayText,
                Id = downCast.Id,
                ItemCollection = new List<DropdownItem>()
            };

            foreach (var y in downCast.ItemCollection)
            {
                p.ItemCollection.Add(new DropdownItem()
                {
                    Action = y.Action,
                    DisplayText = y.DisplayText
                });
            }

            return p;
        }