Exemple #1
0
 public SearchResult(string text, string pic, VLCItemType itemType, int? id = null)
 {
     Picture = pic;
     Text = text;
     SearchItemType = itemType;
     if (id != null) 
         Id = id.Value;
 }
Exemple #2
0
 public SearchResult(string text, string pic, VLCItemType itemType, int?id = null)
 {
     Picture        = pic;
     Text           = text;
     SearchItemType = itemType;
     if (id != null)
     {
         Id = id.Value;
     }
 }
Exemple #3
0
        public static async Task <bool> CreateOrReplaceSecondaryTile(VLCItemType type, int id, string title)
        {
            string tileId = "SecondaryTile-" + type.ToString() + "-" + id;

            if (!SecondaryTile.Exists(tileId))
            {
                var tileData = new SecondaryTile()
                {
                    TileId      = tileId,
                    DisplayName = title,
                    Arguments   = tileId
                };
                string subfolder = null;
                switch (type)
                {
                case VLCItemType.Album:
                    subfolder = "albumPic";
                    break;

                case VLCItemType.Artist:
                    subfolder = "artistPic";
                    break;
                }
                tileData.VisualElements.ShowNameOnSquare150x150Logo = true;
                tileData.DisplayName = title;
                tileData.VisualElements.Square150x150Logo =
                    new Uri("ms-appdata:///local/" + subfolder + "/" + id + ".jpg");
                bool success = await tileData.RequestCreateAsync();

                return(success);
            }
            else
            {
                SecondaryTile secondaryTile = new SecondaryTile(tileId);
                await secondaryTile.RequestDeleteForSelectionAsync(Window.Current.Bounds, Placement.Default);

                ToastHelper.Basic(Strings.TileRemoved);
                return(false);
            }
        }
        public static bool SecondaryTileExists(VLCItemType type, int id, string title)
        {
            string tileId = "SecondaryTile-" + type.ToString() + "-" + id;

            return(SecondaryTile.Exists(tileId));
        }
 public static bool SecondaryTileExists(VLCItemType type, int id, string title)
 {
     string tileId = "SecondaryTile-" + type.ToString() + "-" + id;
     return SecondaryTile.Exists(tileId);
 }
 public static async void CreateOrReplaceSecondaryTile(VLCItemType type, int id, string title)
 {
     string tileId = "SecondaryTile-" + type.ToString() + "-" + id;
     if (!SecondaryTile.Exists(tileId))
     {
         var tileData = new SecondaryTile()
         {
             TileId = tileId,
             DisplayName = title,
             Arguments = tileId
         };
         string subfolder = null;
         switch (type)
         {
             case VLCItemType.Album:
                 subfolder = "albumPic";
                 break;
             case VLCItemType.Artist:
                 subfolder = "artistPic";
                 break;
         }
         tileData.VisualElements.ShowNameOnSquare150x150Logo = true;
         tileData.DisplayName = title;
         tileData.VisualElements.Square150x150Logo =
             new Uri("ms-appdata:///local/" + subfolder + "/" + id + ".jpg");
         await tileData.RequestCreateAsync();
     }
     else
     {
         SecondaryTile secondaryTile = new SecondaryTile(tileId);
         await secondaryTile.RequestDeleteForSelectionAsync(Window.Current.Bounds, Placement.Default);
         ToastHelper.Basic("Tile removed !");
     }
 }