예제 #1
0
        public UpdateDialog(ApplicationUpdate update, string applicationName, string applicationVersion)
        {
            InitializeComponent();

             UpdateData = update;
             ApplicationName = applicationName;
             ApplicationVersion = applicationVersion;
        }
예제 #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);
 }
예제 #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);
 }
예제 #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);
      }
예제 #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);
      }
 }