Пример #1
0
        public void Post(string msg, params object[] args)
        {
            status = string.Format(msg, args);

            MsgDispatcher.Post(new Message {
                MessageType = MessageType.STATUS_CHANGED, Data = status
            });
        }
Пример #2
0
        public async Task <string> GetUpdatesInformation()
        {
            string result = "";

            try
            {
                var updatesInfo = await VersionChecker.GetUpdatesInformation(true);

                if (!updatesInfo.HasNewVersion)
                {
                    result = "Версія програми є найновішою.";
                }
                else
                {
                    var sb = new StringBuilder();

                    foreach (var updateVersion in updatesInfo.ChangesByVersions.Keys)
                    {
                        sb.AppendLine(updateVersion.ToString());
                        sb.AppendLine(updatesInfo.ChangesByVersions[updateVersion]);
                        sb.AppendLine();
                    }
                    result = sb.ToString();

                    MsgDispatcher.Post(MessageType.UPDATES_AVAILABLE);
                }
            }
            catch (WebException ex)
            {
                logger.Error("Error occured during update download");
                logger.Error(ex.Message);
            }
            return(result);
        }