public void CreateMessage(ProgressMessage Msg) { FileStream FileStr = null; StreamWriter StrWri = null; string sTxt = null; //--- Check message time is enabled if (MessageTimer.Enabled) { throw new Exception(ErrMsg_MsgTimeEnab); } //--- Wait for the next message MessageWatch.Wait(Itv_CreMsg, true); //--- Read the file text FileStr = OpenMessageFile(FileAccess.Write); StrWri = new StreamWriter(FileStr); //--- Set the start position and write the file with the message text FileStr.Position = 0; StrWri.Write(sTxt = Msg.ToText()); //--- Set the json length and flush the stream writer FileStr.SetLength(sTxt.Length); StrWri.Flush(); //--- Close the file StrWri.Dispose(); FileStr.Dispose(); }
public TaskProgressEventArgs(ProgressMessage Msg) { Message = Msg; }