public object GetStyleValue(EditStyling.Style style) { switch (style) { case EditStyling.Style.FontName: { return(PlatformLabel.Editable_GetFontName( )); } case EditStyling.Style.FontSize: { return(PlatformLabel.Editable_GetFontSize( )); } //case EditStyling.Style.Underline: //{ // return PlatformLabel.Editable_HasUnderline( ); //} case EditStyling.Style.RevealBox: { // here, we're basically saying "YES, we ARE a reveal box" so the system // knows to downgrade us. return(true); } case EditStyling.Style.BoldParagraph: { // for bolding the paragraph, forward this to the parent to see if it supports it return(ParentControl.GetStyleValue(style)); } case EditStyling.Style.UnderlineParagraph: { // for underlining the paragraph, forward this to the parent to see if it supports it return(ParentControl.GetStyleValue(style)); } case EditStyling.Style.BulletParagraph: { return(ParentControl.GetStyleValue(style)); } case EditStyling.Style.BoldItalicizeParagraph: { return(ParentControl.GetStyleValue(style)); } case EditStyling.Style.ItalicizeParagraph: { return(ParentControl.GetStyleValue(style)); } } return(null); }
public string Export(RectangleF parentPadding, float currYPos) { // only export if there's valid text. If we're simply a blank space, or a URL glyph, we don't need to be saved. if (string.IsNullOrWhiteSpace(PlatformLabel.Text) == false && PlatformLabel.Text != PrivateNoteConfig.CitationUrl_Icon) { // first get the text itself string encodedText = HttpUtility.HtmlEncode(PlatformLabel.Text).Trim(new char[] { ' ' }); // setup note attributes string attributeStrings = string.Format("FontName=\"{0}\" FontSize=\"{1}\"", PlatformLabel.Editable_GetFontName( ), PlatformLabel.Editable_GetFontSize( )); if (PlatformLabel.Editable_HasUnderline( )) { attributeStrings += " Underlined=\"True\""; } // build the final string return("<NT " + attributeStrings + ">" + encodedText + "</NT>"); } else { return(string.Empty); } }
public string Export(RectangleF parentPadding, float currYPos) { // only export if there's valid text. If we're simply a blank space, we don't need to be saved. if (string.IsNullOrWhiteSpace(PlatformLabel.Text) == false) { string encodedText = HttpUtility.HtmlEncode(PlatformLabel.Text); // setup note attributes string attributeStrings = string.Format("FontName=\"{0}\" FontSize=\"{1}\"", PlatformLabel.Editable_GetFontName(), PlatformLabel.Editable_GetFontSize()); return("<RB " + attributeStrings + ">" + encodedText.Trim(new char[] { ' ' }) + "</RB>"); } else { return(string.Empty); } }