/// <summary> /// Writes a <see cref="TextLayoutCommandType.Custom"/> command to the current position in the stream. /// </summary> /// <param name="command">The command to write to the stream.</param> public void WriteCustomCommand(TextLayoutCustomCommand command) { stream.Reserve(sizeof(TextLayoutCustomCommand)); *(TextLayoutCustomCommand *)stream.Data = command; *(TextLayoutCommandType *)stream.Data = TextLayoutCommandType.Custom; stream.FinalizeObject(sizeof(TextLayoutCustomCommand)); }
/// <summary> /// Handles a |delay| command. /// </summary> private Boolean HandleDelayCommand(TextLayoutCustomCommand cmd) { delay = (cmd.Value == 0) ? DefaultDelay : cmd.Value; charsVisible = (Int32)charsVisible; return false; }
/// <summary> /// Handles a |speed| command. /// </summary> private Boolean HandleSpeedCommand(TextLayoutCustomCommand cmd) { charsPerSecond = (cmd.Value == 0) ? DefaultSpeed : cmd.Value; charsVisible = (Int32)charsVisible; return false; }
/// <summary> /// Writes a <see cref="TextLayoutCommandType.Custom"/> command to the current position in the stream. /// </summary> /// <param name="command">The command to write to the stream.</param> public void WriteCustomCommand(TextLayoutCustomCommand command) { stream.Reserve(sizeof(TextLayoutCustomCommand)); *(TextLayoutCustomCommand*)stream.Data = command; *(TextLayoutCommandType*)stream.Data = TextLayoutCommandType.Custom; stream.FinalizeObject(sizeof(TextLayoutCustomCommand)); }