protected virtual void FrametimeServerDataReceived(object sender, FrametimeDataEventArgs e)
        {
            if (ServerState != ServerState.Stop &&
                LogState != ServerState.Stop &&
                Settings.UseFrametimeMode == true)
            {
                FrametimeData.Properties.Clear();
                FrametimeData.Properties.AddRange(MASMData.Properties);

                FrametimeData.Properties.Add(new MAHM_SHARED_MEMORY_ENTRY
                {
                    szSrcName = "RTSS Current frame",
                    data      = currentFrame
                });

                FrametimeData.Properties.Add(new MAHM_SHARED_MEMORY_ENTRY
                {
                    szSrcName = "RTSS Frame time",
                    data      = currentFrametime
                });

                FrametimeData.Properties.Add(new MAHM_SHARED_MEMORY_ENTRY
                {
                    szSrcName = "RTSS Frame duration",
                    data      = e.frametime
                });

                currentFrame++;
                currentFrametime += e.frametime;

                LogServer.Append(Settings.DataFormatter.Format(FrametimeData));
            }
        }
        public virtual bool BeginLog()
        {
            if (Settings.UseFrametimeMode == true &&
                ServerState != ServerState.Connected ||
                ServerState == ServerState.Stop)
            {
                return(false);
            }

            if (LogState != ServerState.Stop)
            {
                StopLog();
            }

            string targetLogName = null;

            try
            {
                targetLogName = Settings.UseFrametimeMode == true
                    ? Path.GetFileNameWithoutExtension(FrametimeServer.ConnectedApp)
                    : LogName;
            }
            catch { }

            if (LogServer.Open(LogDirectory, targetLogName, Settings.LogFileFormat))
            {
                LogServer.Append(Regex.Unescape(Settings.StartText));
                currentFrame     = 0;
                currentFrametime = 0;
                LogState         = ServerState.Begin;
            }

            return(LogState != ServerState.Stop);
        }
 public virtual void StopLog()
 {
     if (LogState != ServerState.Stop)
     {
         LogState = ServerState.Stop;
         LogServer.Append(Regex.Unescape(Settings.FinalText));
         LogServer.Close();
     }
 }
        protected virtual void MASMTimerTicked(object state)
        {
            MASMData.Update();

            if (ServerState != ServerState.Stop &&
                LogState != ServerState.Stop &&
                Settings.UseFrametimeMode == false)
            {
                LogServer.Append(Settings.DataFormatter.Format(MASMData));
            }
        }