Exemple #1
0
 public static ItemViewModel Create(string internalName, int index)
 {
     ItemViewModel item = null;
     if (internalName.StartsWith("{"))
     {
         var info = new ApplicationApi.ApplicationInfo(internalName);
         if (info.IsValid())
         {
             item = new ItemViewModel(info);
         }
     }
     else
     {
         item = SpecialItemRepository.GetByName(internalName);
         if (item == null)
             item = new SpecialItemViewModel(internalName, index);
     }
     return item;
 }
Exemple #2
0
        public static ItemViewModel Create(string internalName, int index)
        {
            ItemViewModel item = null;

            if (internalName.StartsWith("{"))
            {
                var info = new ApplicationApi.ApplicationInfo(internalName);
                if (info.IsValid())
                {
                    item = new ItemViewModel(info);
                }
            }
            else
            {
                item = SpecialItemRepository.GetByName(internalName);
                if (item == null)
                {
                    item = new SpecialItemViewModel(internalName, index);
                }
            }
            return(item);
        }