예제 #1
0
        private async Task <bool> ProjectTransferAsync(DownlinkManager dlm, UplinkManager ulm)
        {
            AbstractProject[] projects = await dlm.GenerateAbstractProjectAsync();

            if (projects.Length != 0)
            {
                StatsHelper.AddProjectStats(projects, link);
                await ulm.GenerateUplinkProjectAsync(projects);

                return(true);
            }
            else
            {
                Log.AddLog("No project found.", ErrorLevels.Information);
                return(false);
            }
        }
예제 #2
0
        internal async Task <bool> ProcessSyncAsync()
        {
            try
            {
                link = new Link(linkID);
                DownlinkManager dlm = new DownlinkManager(link);
                UplinkManager   ulm = new UplinkManager(link);

                await ProjectTransferAsync(dlm, ulm);

                syncSuccess  = true;
                syncFinished = DateTime.Now;
                return(true);
            }
            catch (Exception ex)
            {
                Log.AddLog("Synchronization error: " + ex.Message, ErrorLevels.Error);
                return(false);
            }
        }