/// <summary> /// Writes some descriptive text into the /// referenced TextBox. /// </summary> protected void Verbose(string text) { if (null == text) { return; } FormDogDemo.WriteToTextbox(textHistory, " " + text + "\r\n"); }
/// <summary> /// Writes the Demo header into the referenced TextBox. /// </summary> protected virtual void Header() { if (textHistory != null && 0xFFFF < textHistory.TextLength) { textHistory.Clear(); } FormDogDemo.WriteToTextbox(textHistory, "____________________________________________________________\r\n" + string.Format("API Demo started ({0})\r\n\r\n", DateTime.Now.ToString())); }
/// <summary> /// Prints the header into the /// referenced TextBox /// </summary> protected override void Header() { if (textHistory != null && 0xFFFF < textHistory.TextLength) { textHistory.Clear(); } FormDogDemo.WriteToTextbox(textHistory, "____________________________________________________________\r\n" + string.Format("Generation of Status Information started ({0})\r\n\r\n", DateTime.Now.ToString())); }
/// <summary> /// Dumps an operation status into the /// referenced TextBox. /// </summary> protected void ReportStatus(DogStatus status) { FormDogDemo.WriteToTextbox(textHistory, string.Format(" Result: {0} (DogStatus::{1})\r\n", stringCollection[(int)status], status.ToString())); if (textHistory != null) { if (DogStatus.StatusOk == status) { textHistory.Refresh(); } else { textHistory.Parent.Refresh(); } } }
/// <summary> /// Dumps a bunch of bytes into the referenced TextBox. /// </summary> protected void DumpBytes(byte[] bytes) { Verbose("Dumping data (max. 64 Bytes):"); for (int index = 0; index < bytes.Length; index++) { if (0 == (index % 8)) { FormDogDemo.WriteToTextbox(textHistory, (0 == index) ? " " : "\r\n "); } FormDogDemo.WriteToTextbox(textHistory, "0x" + bytes[index].ToString("X2") + " "); // for performance reason we only dump 64 bytes if (63 <= index) { FormDogDemo.WriteToTextbox(textHistory, "\r\n ..."); break; } } Verbose(""); }
/// <summary> /// Prints the footer message into the /// referenced TextBox /// </summary> protected override void Footer() { FormDogDemo.WriteToTextbox(textHistory, "Generation of Status Information completed\r\n"); }
/// <summary> /// Prints the footer message into the /// referenced TextBox /// </summary> protected override void Footer() { FormDogDemo.WriteToTextbox(textHistory, "SuperDog Update completed\r\n"); }
/// <summary> /// Prints the footer into the referenced TextBox. /// </summary> protected virtual void Footer() { FormDogDemo.WriteToTextbox(textHistory, "API Demo completed\r\n"); }