/// <summary> /// Set how the tile notification should display the application branding. /// </summary> /// <param name="branding">How branding should appear on the tile</param> /// <param name="size">The tile size that the <paramref name="branding"/> parameter should be applied to. Default to all currently supported tile size.</param> /// <returns>The current instance of <see cref="TileContentBuilder"/></returns> public TileContentBuilder SetBranding(TileBranding branding, TileSize size = AllSize) { if (size == AllSize) { // Set on visual. Visual.Branding = branding; } else { if (size.HasFlag(TileSize.Small) && SmallTile != null) { SmallTile.Branding = branding; } if (size.HasFlag(TileSize.Medium) && MediumTile != null) { MediumTile.Branding = branding; } if (size.HasFlag(TileSize.Wide) && WideTile != null) { WideTile.Branding = branding; } if (size.HasFlag(TileSize.Large) && LargeTile != null) { LargeTile.Branding = branding; } } return(this); }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder bindingNode = new StringBuilder(String.Empty); bindingNode.AppendFormat("<binding template='{0}'", TemplateName); if (!String.IsNullOrWhiteSpace(Lang) && !Lang.Equals(globalLang)) { bindingNode.AppendFormat(" lang='{0}'", Util.HttpEncode(Lang)); globalLang = Lang; } if (Branding != TileBranding.Logo && Branding != globalBranding) { bindingNode.AppendFormat(" branding='{0}'", Branding.ToString().ToLowerInvariant()); } if (!String.IsNullOrWhiteSpace(BaseUri) && !BaseUri.Equals(globalBaseUri)) { bindingNode.AppendFormat(" baseUri='{0}'", Util.HttpEncode(BaseUri)); globalBaseUri = BaseUri; } if (AddImageQueryNullable != null && AddImageQueryNullable != globalAddImageQuery) { bindingNode.AppendFormat(" addImageQuery='{0}'", AddImageQuery.ToString().ToLowerInvariant()); globalAddImageQuery = AddImageQuery; } bindingNode.AppendFormat(">{0}</binding>", SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery)); return bindingNode.ToString(); }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder bindingNode = new StringBuilder(String.Empty); bindingNode.AppendFormat("<binding template='{0}'", this.TemplateName); if (!String.IsNullOrWhiteSpace(this.Lang) && !this.Lang.Equals(globalLang)) { bindingNode.AppendFormat(" lang='{0}'", Util.HttpEncode(this.Lang)); globalLang = this.Lang; } if (this.Branding != TileBranding.Logo && this.Branding != globalBranding) { bindingNode.AppendFormat(" branding='{0}'", this.Branding.ToString().ToLowerInvariant()); } if (!String.IsNullOrWhiteSpace(this.BaseUri) && !this.BaseUri.Equals(globalBaseUri)) { bindingNode.AppendFormat(" baseUri='{0}'", Util.HttpEncode(this.BaseUri)); globalBaseUri = this.BaseUri; } if (this.AddImageQueryNullable != null && this.AddImageQueryNullable != globalAddImageQuery) { bindingNode.AppendFormat(" addImageQuery='{0}'", this.AddImageQuery.ToString().ToLowerInvariant()); globalAddImageQuery = this.AddImageQuery; } bindingNode.AppendFormat(">{0}</binding>", this.SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery)); return(bindingNode.ToString()); }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder builder = new StringBuilder(string.Empty); builder.AppendFormat("<binding template='{0}'", (object[]) new object[] { base.TemplateName }); if (!string.IsNullOrWhiteSpace(base.FallbackName)) { builder.AppendFormat(" fallback='{0}'", (object[]) new object[] { base.FallbackName }); } if (!string.IsNullOrWhiteSpace(base.Lang) && !base.Lang.Equals(globalLang)) { builder.AppendFormat(" lang='{0}'", (object[]) new object[] { Util.HttpEncode(base.Lang) }); globalLang = base.Lang; } if ((base.Branding != TileBranding.Logo) && (base.Branding != globalBranding)) { builder.AppendFormat(" branding='{0}'", (object[]) new object[] { base.Branding.ToString().ToLowerInvariant() }); } if (!string.IsNullOrWhiteSpace(base.BaseUri) && !base.BaseUri.Equals(globalBaseUri)) { builder.AppendFormat(" baseUri='{0}'", (object[]) new object[] { Util.HttpEncode(base.BaseUri) }); globalBaseUri = base.BaseUri; } if (base.AddImageQueryNullable.HasValue) { bool? addImageQueryNullable = base.AddImageQueryNullable; bool flag = globalAddImageQuery; if ((addImageQueryNullable.GetValueOrDefault() != flag) || !addImageQueryNullable.HasValue) { builder.AppendFormat(" addImageQuery='{0}'", (object[]) new object[] { base.AddImageQuery.ToString().ToLowerInvariant() }); globalAddImageQuery = base.AddImageQuery; } } builder.AppendFormat(">{0}</binding>", (object[]) new object[] { base.SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery) }); return builder.ToString(); }
public Tile(string caption, string message1, string message2, TileBranding branding, string displayName) : this() { Caption = caption; Message1 = message1; Message2 = message2; Branding = branding; DisplayName = displayName; }
private static ITileSquare150x150PeekImageAndText04 CreateMainTile(string uri, TileBranding branding) { var mainSquareContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText04(); mainSquareContent.Image.Src = uri; mainSquareContent.Branding = branding; var smallSquare = TileContentFactory.CreateTileSquare71x71IconWithBadge(); smallSquare.ImageIcon.Src = uri; mainSquareContent.Square71x71Content = smallSquare; return mainSquareContent; }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder builder = new StringBuilder(string.Empty); if (this.Square71x71Content != null) { ISquare71x71TileInternal internal2 = this.Square71x71Content as ISquare71x71TileInternal; if (internal2 == null) { throw new NotificationContentValidationException("The provided small tile content class is unsupported."); } builder.Append(internal2.SerializeBinding(base.Lang, base.BaseUri, base.Branding, base.AddImageQuery)); } builder.AppendFormat("<binding template='{0}'", (object[])new object[] { base.TemplateName }); if (!string.IsNullOrWhiteSpace(base.FallbackName)) { builder.AppendFormat(" fallback='{0}'", (object[])new object[] { base.FallbackName }); } if (!string.IsNullOrWhiteSpace(base.Lang) && !base.Lang.Equals(globalLang)) { builder.AppendFormat(" lang='{0}'", (object[])new object[] { Util.HttpEncode(base.Lang) }); globalLang = base.Lang; } if ((base.Branding != TileBranding.Logo) && (base.Branding != globalBranding)) { builder.AppendFormat(" branding='{0}'", (object[])new object[] { base.Branding.ToString().ToLowerInvariant() }); } if (!string.IsNullOrWhiteSpace(base.BaseUri) && !base.BaseUri.Equals(globalBaseUri)) { builder.AppendFormat(" baseUri='{0}'", (object[])new object[] { Util.HttpEncode(base.BaseUri) }); globalBaseUri = base.BaseUri; } if (base.AddImageQueryNullable.HasValue) { bool?addImageQueryNullable = base.AddImageQueryNullable; bool flag = globalAddImageQuery; if ((addImageQueryNullable.GetValueOrDefault() != flag) || !addImageQueryNullable.HasValue) { builder.AppendFormat(" addImageQuery='{0}'", (object[])new object[] { base.AddImageQuery.ToString().ToLowerInvariant() }); globalAddImageQuery = base.AddImageQuery; } } if (!string.IsNullOrWhiteSpace(base.ContentId)) { builder.AppendFormat(" contentId='{0}'", (object[])new object[] { base.ContentId.ToLowerInvariant() }); } builder.AppendFormat(">{0}</binding>", (object[])new object[] { base.SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery) }); return(builder.ToString()); }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder builder = new StringBuilder(string.Empty); if (this.Square71x71Content != null) { ISquare71x71TileInternal internal2 = this.Square71x71Content as ISquare71x71TileInternal; if (internal2 == null) { throw new NotificationContentValidationException("The provided small tile content class is unsupported."); } builder.Append(internal2.SerializeBinding(base.Lang, base.BaseUri, base.Branding, base.AddImageQuery)); } builder.AppendFormat("<binding template='{0}'", (object[]) new object[] { base.TemplateName }); if (!string.IsNullOrWhiteSpace(base.FallbackName)) { builder.AppendFormat(" fallback='{0}'", (object[]) new object[] { base.FallbackName }); } if (!string.IsNullOrWhiteSpace(base.Lang) && !base.Lang.Equals(globalLang)) { builder.AppendFormat(" lang='{0}'", (object[]) new object[] { Util.HttpEncode(base.Lang) }); globalLang = base.Lang; } if ((base.Branding != TileBranding.Logo) && (base.Branding != globalBranding)) { builder.AppendFormat(" branding='{0}'", (object[]) new object[] { base.Branding.ToString().ToLowerInvariant() }); } if (!string.IsNullOrWhiteSpace(base.BaseUri) && !base.BaseUri.Equals(globalBaseUri)) { builder.AppendFormat(" baseUri='{0}'", (object[]) new object[] { Util.HttpEncode(base.BaseUri) }); globalBaseUri = base.BaseUri; } if (base.AddImageQueryNullable.HasValue) { bool? addImageQueryNullable = base.AddImageQueryNullable; bool flag = globalAddImageQuery; if ((addImageQueryNullable.GetValueOrDefault() != flag) || !addImageQueryNullable.HasValue) { builder.AppendFormat(" addImageQuery='{0}'", (object[]) new object[] { base.AddImageQuery.ToString().ToLowerInvariant() }); globalAddImageQuery = base.AddImageQuery; } } if (!string.IsNullOrWhiteSpace(base.ContentId)) { builder.AppendFormat(" contentId='{0}'", (object[]) new object[] { base.ContentId.ToLowerInvariant() }); } builder.AppendFormat(">{0}</binding>", (object[]) new object[] { base.SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery) }); return builder.ToString(); }
public string SerializeBinding(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder builder = new StringBuilder(string.Empty); builder.AppendFormat("<binding template='{0}'", (object[])new object[] { base.TemplateName }); if (!string.IsNullOrWhiteSpace(base.FallbackName)) { builder.AppendFormat(" fallback='{0}'", (object[])new object[] { base.FallbackName }); } if (!string.IsNullOrWhiteSpace(base.Lang) && !base.Lang.Equals(globalLang)) { builder.AppendFormat(" lang='{0}'", (object[])new object[] { Util.HttpEncode(base.Lang) }); globalLang = base.Lang; } if ((base.Branding != TileBranding.Logo) && (base.Branding != globalBranding)) { builder.AppendFormat(" branding='{0}'", (object[])new object[] { base.Branding.ToString().ToLowerInvariant() }); } if (!string.IsNullOrWhiteSpace(base.BaseUri) && !base.BaseUri.Equals(globalBaseUri)) { builder.AppendFormat(" baseUri='{0}'", (object[])new object[] { Util.HttpEncode(base.BaseUri) }); globalBaseUri = base.BaseUri; } if (base.AddImageQueryNullable.HasValue) { bool?addImageQueryNullable = base.AddImageQueryNullable; bool flag = globalAddImageQuery; if ((addImageQueryNullable.GetValueOrDefault() != flag) || !addImageQueryNullable.HasValue) { builder.AppendFormat(" addImageQuery='{0}'", (object[])new object[] { base.AddImageQuery.ToString().ToLowerInvariant() }); globalAddImageQuery = base.AddImageQuery; } } builder.AppendFormat(">{0}</binding>", (object[])new object[] { base.SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery) }); return(builder.ToString()); }
public TileNotificationBase(string templateName, string fallbackName, int imageCount, int textCount) : base(templateName, fallbackName, imageCount, textCount) { this.m_Branding = TileBranding.Logo; }
public string SerializeBindings(string globalLang, string globalBaseUri, TileBranding globalBranding, bool globalAddImageQuery) { StringBuilder bindingNode = new StringBuilder(String.Empty); if (Square150x150Content != null) { ISquare150x150TileInternal squareBase = Square150x150Content as ISquare150x150TileInternal; if (squareBase == null) { throw new NotificationContentValidationException("The provided square tile content class is unsupported."); } bindingNode.Append(squareBase.SerializeBinding(Lang, BaseUri, Branding, AddImageQuery)); } bindingNode.AppendFormat("<binding template='{0}'", TemplateName); if (!String.IsNullOrWhiteSpace(FallbackName)) { bindingNode.AppendFormat(" fallback='{0}'", FallbackName); } if (!String.IsNullOrWhiteSpace(Lang) && !Lang.Equals(globalLang)) { bindingNode.AppendFormat(" lang='{0}'", Util.HttpEncode(Lang)); globalLang = Lang; } if (Branding != TileBranding.Logo && Branding != globalBranding) { bindingNode.AppendFormat(" branding='{0}'", Branding.ToString().ToLowerInvariant()); } if (!String.IsNullOrWhiteSpace(BaseUri) && !BaseUri.Equals(globalBaseUri)) { bindingNode.AppendFormat(" baseUri='{0}'", Util.HttpEncode(BaseUri)); globalBaseUri = BaseUri; } if (AddImageQueryNullable != null && AddImageQueryNullable != globalAddImageQuery) { bindingNode.AppendFormat(" addImageQuery='{0}'", AddImageQuery.ToString().ToLowerInvariant()); globalAddImageQuery = AddImageQuery; } if (!String.IsNullOrWhiteSpace(ContentId)) { bindingNode.AppendFormat(" contentId='{0}'", ContentId.ToLowerInvariant()); } bindingNode.AppendFormat(">{0}</binding>", SerializeProperties(globalLang, globalBaseUri, globalAddImageQuery)); return bindingNode.ToString(); }
private static ITileSquare150x150PeekImageAndText04 CreateMainTile(string uri, TileBranding branding) { var mainSquareContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText04(); mainSquareContent.Image.Src = uri; mainSquareContent.Branding = branding; var smallSquare = TileContentFactory.CreateTileSquare71x71IconWithBadge(); smallSquare.ImageIcon.Src = uri; mainSquareContent.Square71x71Content = smallSquare; return(mainSquareContent); }