Exemple #1
0
        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();
        }
Exemple #2
0
 public TaskProgressEventArgs(ProgressMessage Msg)
 {
     Message = Msg;
 }