public void UpdateTile() { var news = AllGroups.FirstOrDefault(c => c.UniqueId == "1").Items.ToList(); var xml = new XmlDocument(); xml.LoadXml( string.Format( @"<?xml version=""1.0"" encoding=""utf-8"" ?> <tile> <visual branding=""none""> <binding template=""TileSquarePeekImageAndText03""> <image id=""1"" src=""ms-appx:///Assets/Logo.png"" alt=""alt text""/> <text id=""1"">{0}</text> <text id=""2"">{1}</text> <text id=""3"">{2}</text> <text id=""4"">{3}</text> </binding> <binding template=""TileWidePeekImageAndText02""> <image id=""1"" src=""ms-appx:///Assets/WideLogo.png"" alt=""alt text""/> <text id=""1"">{0}</text> <text id=""2"">{1}</text> <text id=""3"">{2}</text> <text id=""4"">{3}</text> </binding> </visual> </tile>", news.Count > 0 ? System.Net.WebUtility.HtmlEncode(news[0].Title) : "", news.Count > 1 ? System.Net.WebUtility.HtmlEncode(news[1].Title) : "", news.Count > 2 ? System.Net.WebUtility.HtmlEncode(news[2].Title) : "", news.Count > 3 ? System.Net.WebUtility.HtmlEncode(news[3].Title) : "")); TileUpdateManager.CreateTileUpdaterForApplication().Update(new TileNotification(xml)); }
/// <summary> /// Gets the HAProxy instance with the given name, null if it doesn't exist /// </summary> public static HAProxyGroup GetGroup(string name) { return(AllGroups.FirstOrDefault(e => string.Equals(e.Name, Environment.MachineName + ":" + name, StringComparison.InvariantCultureIgnoreCase)) ?? AllGroups.FirstOrDefault(e => string.Equals(e.Name, name, StringComparison.InvariantCultureIgnoreCase))); }
public TextGroupInfo GetGroup(string name) { return(AllGroups.FirstOrDefault(n => (n.Name ?? "") == (name ?? ""))); }
/// <summary> /// Returns the specified group by id. /// </summary> /// <param name="id">Id to search for</param> /// <returns>Matching group or null</returns> public SampleDataGroupViewModel GetGroup(string id) { return(AllGroups.FirstOrDefault(group => group.Id.Equals(id))); }