Ketarin.Updater.CheckForOnlineUpdates C# (CSharp) Method

CheckForOnlineUpdates() private method

Checks for which of the given applications updates are available. Fires an event when finished.
private CheckForOnlineUpdates ( object argument ) : void
argument object
return void
        private void CheckForOnlineUpdates(object argument)
        {
            ApplicationJob[] jobs = argument as ApplicationJob[];

            // Build an array containing all GUIDs and dates
            List<RpcAppGuidAndDate> sendInfo = new List<RpcAppGuidAndDate>();
            foreach (ApplicationJob job in jobs)
            {
                if (!job.CanBeShared)
                {
                    sendInfo.Add(new RpcAppGuidAndDate(job.Guid, job.DownloadDate));
                }
            }

            if (sendInfo.Count == 0)
            {
                // Nothing to do
                return;
            }

            try
            {
                IKetarinRpc proxy = XmlRpcProxyGen.Create<IKetarinRpc>();
                string[] updatedApps = proxy.GetUpdatedApplications(sendInfo.ToArray());
                OnUpdatesFound(updatedApps);
            }
            catch (Exception ex)
            {
                // If updating fails, it does not hurt and should not annoy anyone.
                // Just write a log entry, just in case
                LogDialog.Log("Failed checking for online database updates", ex);
            }
        }