예제 #1
0
        public async Task AddItemsToList(IEnumerable <ShellNewEntry> itemTypes)
        {
            AddItemsList.Clear();

            AddItemsList.Add(new AddItemDialogListItemViewModel
            {
                Header        = "Folder".ToLocalized(),
                SubHeader     = "AddDialogListFolderSubHeader".ToLocalized(),
                Glyph         = "\xE838",
                IsItemEnabled = true,
                ItemResult    = new AddItemDialogResultModel()
                {
                    ItemType = AddItemDialogItemType.Folder
                }
            });

            foreach (var itemType in itemTypes)
            {
                ImageModel?imageModel = null;
                if (!string.IsNullOrEmpty(itemType.IconBase64))
                {
                    byte[] bitmapData = Convert.FromBase64String(itemType.IconBase64);
                    imageModel = await ImagingService.GetImageModelFromDataAsync(bitmapData);
                }

                AddItemsList.Add(new AddItemDialogListItemViewModel
                {
                    Header        = itemType.Name,
                    SubHeader     = itemType.Extension,
                    Glyph         = imageModel != null ? null : "\xE8A5",
                    Icon          = imageModel,
                    IsItemEnabled = true,
                    ItemResult    = new AddItemDialogResultModel()
                    {
                        ItemType = AddItemDialogItemType.File,
                        ItemInfo = itemType
                    }
                });
            }

            AddItemsList.Add(new AddItemDialogListItemViewModel
            {
                Header        = "File".ToLocalized(),
                SubHeader     = "AddDialogListFileSubHeader".ToLocalized(),
                Glyph         = "\xE8A5",
                IsItemEnabled = true,
                ItemResult    = new AddItemDialogResultModel()
                {
                    ItemType = AddItemDialogItemType.File,
                    ItemInfo = new ShellNewEntry() // TODO(i): Make ItemInfo nullable and pass null there?
                }
            });
        }
예제 #2
0
 public ImagingModule(ImagingService imaging, ActivityMonitorService activityMonitor)
 {
     _imaging         = imaging;
     _activityMonitor = activityMonitor;
 }
예제 #3
0
        public static ImagingService GetImagingSdk()
        {
            ImagingService c = new ImagingService(APP_SID, APP_KEY);

            return(c);
        }