/// <summary> /// Set the style according to text level /// </summary> /// <param name="style"></param> /// <param name="level"></param> public static void StyleAs(this ExcelStyle style, TextLevel level) { switch (level) { case TextLevel.Title: style.StyleAsTitle(); break; case TextLevel.Heading1: style.StyleAsHeading1(); break; case TextLevel.Heading2: style.StyleAsHeading2(); break; case TextLevel.Heading3: style.StyleAsHeading3(); break; case TextLevel.Normal: style.StyleAsNormal(); break; } }
/// <summary> /// Initializes a new instance of <see cref="TextBuilder"/>. /// </summary> /// <param name="textLevel">The level of the text file representatives.</param> /// <param name="textLocation">The location of the text file representatives.</param> /// <param name="textPathFind">The regex used to find a part of the image path to replace.</param> /// <param name="textPathReplace">The replace value that results in the correct text path.</param> public TextBuilder(TextLevel textLevel, TextLocation textLocation, Regex textPathFind, string textPathReplace) { this.fileLevel = textLevel; this.fileLocation = textLocation; this.pathFind = textPathFind; this.pathReplace = textPathReplace; }
private void TextLevel_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key != Key.Enter) { return; } var player = _players[_playerIndex]; try { var level = byte.Parse(TextLevel.Text); player.Level = level; TextLevel.SelectAll(); Data.Blitzball.SetPlayerInfo(_playerIndex, player); } catch { Error.Show("Please enter a value between 0 and 255"); } RefreshCurrentPlayer(); }
/// <summary> /// Inserts text into the defined cell, and format to match text level /// </summary> /// <param name="ws">Worksheet in wich the text is inserted</param> /// <param name="row">Row of the cell</param> /// <param name="col">Column of the cell</param> /// <param name="text">Text to insert</param> /// <param name="level">Level of text</param> public static void InsertText(this ExcelWorksheet ws, int row, int col, string text, TextLevel level = TextLevel.Normal) { ws.Cells[row, col].Value = text; ws.Cells[row, col].Style.StyleAs(level); }
public int GetLevel(TextLevel level) { return(TextLevels[level]); }