Ejemplo n.º 1
0
        public UpdateDialog(ApplicationUpdate update, string applicationName, string applicationVersion)
        {
            InitializeComponent();

             UpdateData = update;
             ApplicationName = applicationName;
             ApplicationVersion = applicationVersion;
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
      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);
      }
Ejemplo n.º 5
0
 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);
      }
 }