public UpdateDialog(ApplicationUpdate update, string applicationName, string applicationVersion) { InitializeComponent(); UpdateData = update; ApplicationName = applicationName; ApplicationVersion = applicationVersion; }
public UpdatePresenter(Action<Exception> exceptionLogger, ApplicationUpdate updateData, IWebProxy proxy, string applicationName, string applicationVersion) { _exceptionLogger = exceptionLogger; _updateData = updateData; _proxy = proxy; _updateView = new UpdateDialog(updateData, applicationName, applicationVersion); _saveFileView = new SaveFileDialogView(); _updateView.AttachPresenter(this); }
public UpdatePresenter(Action<Exception> exceptionLogger, ApplicationUpdate updateData, IWebProxy proxy, IUpdateView updateView, ISaveFileDialogView saveFileView, IWebOperation webOperation) { _exceptionLogger = exceptionLogger; _updateData = updateData; _proxy = proxy; _updateView = updateView; _saveFileView = saveFileView; _webOperation = webOperation; _updateView.AttachPresenter(this); }
private void ShowUpdate(ApplicationUpdate update) { if (Owner.InvokeRequired) { Owner.Invoke(new Action(() => ShowUpdate(update)), null); return; } var updatePresenter = new UpdatePresenter(ExceptionLogger, update, _proxy, Application.Name, Application.VersionWithRevision); updatePresenter.Show(Owner); HandleUpdatePresenterResults(updatePresenter); }
public static void SerializeToXml(ApplicationUpdate update, string filePath) { using (TextWriter stream = new StreamWriter(filePath, false, Encoding.UTF8)) { var s = new XmlSerializer(typeof(ApplicationUpdate)); s.Serialize(stream, update); } }