private void Stop()
    {
        // if LogList is populated and we have a connection
        if (LogList.Count > 0 && DataAnalytics.GetConnectedState())
        {
            // For each element in LogList, send a request to DataAnalytics for Log Sending
            foreach (string temp in LogList)
            {
                DataAnalytics.AddLog(temp);
            }
        }

        // Else if LogList is populated and we do not have a connection
        else if (LogList.Count > 0 && DataAnalyticsStructure.GetConnectedState())
        {
            // For each element in LogList, send a request to LogLoader for Local Saving
            foreach (string temp in LogList)
            {
                LogLoader.WriteLogLocal(filePath, temp);
            }

            // Clear LogList
            LogList.Clear();
        }
    }
Esempio n. 2
0
    // In the event where connection is false, we save the log onto the list and send it back.
    public static List <string> SendLog(List <string> LogList, string log)
    {
        if (DataAnalytics.GetConnectedState())
        {
            DataAnalytics.AddLog(log);
        }

        else
        {
            LogList.Add(log);
        }

        return(LogList);
    }