4
// Michael Hutchinson <mhutchinson@novell.com>
6
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
8
// Permission is hereby granted, free of charge, to any person obtaining
9
// a copy of this software and associated documentation files (the
10
// "Software"), to deal in the Software without restriction, including
11
// without limitation the rights to use, copy, modify, merge, publish,
12
// distribute, sublicense, and/or sell copies of the Software, and to
13
// permit persons to whom the Software is furnished to do so, subject to
14
// the following conditions:
16
// The above copyright notice and this permission notice shall be
17
// included in all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
using System.Collections.Generic;
29
using System.Threading;
32
using MonoDevelop.Ide.Gui;
33
using MonoDevelop.Deployment;
34
using MonoDevelop.Core;
35
using MonoDevelop.Core.ProgressMonitoring;
38
namespace MonoDevelop.AspNet.Deployment
41
public partial class WebDeployWindow : Gtk.Dialog//, IProgressMonitor, IAsyncOperation
43
IList<WebDeployTarget> targets;
44
AspNetAppProject project;
45
DeployFileCollection deployFiles;
47
public WebDeployWindow (AspNetAppProject project, IList<WebDeployTarget> targets)
50
this.targets = targets;
51
this.project = project;
52
deployFiles = project.GetDeployFiles ();
55
protected override void OnRealized ()
60
void LaunchDeployThread ()
62
Thread deployThread = new Thread (DeployThread);
63
deployThread.Start ();
68
IFileReplacePolicy replacePolicy = new MonoDevelop.Deployment.Gui.DialogFileReplacePolicy ();
70
foreach (WebDeployTarget target in targets) {
71
FileCopyHandler handler = target.FileCopier.Handler;
72
//handler.CopyFiles (this, replacePolicy, target.FileCopier, deployFiles);
75
#region IProgressMonitor
77
ProgressTracker progressTracker = new ProgressTracker ();
79
public void IProgressMonitor.ReportError (string message, System.Exception exception)
83
public void IProgressMonitor.ReportSuccess (string message)
87
public void IProgressMonitor.ReportWarning (string message)
91
public void IProgressMonitor.Step (int work)
93
progressTracker.Step (work);
96
public void IProgressMonitor.EndTask ()
98
progressTracker.EndTask ();
101
public void IProgressMonitor.BeginStepTask (string name, int totalWork, int stepSize)
103
progressTracker.BeginStepTask (name, totalWork, stepSize);
106
public void IProgressMonitor.BeginTask (string name, int totalWork)
108
progressTracker.BeginTask (name, totalWork);
111
public System.IO.TextWriter IProgressMonitor.Log {
115
MonitorHandler IProgressMonitor_cancelRequested;
116
event MonitorHandler IProgressMonitor.CancelRequested {
119
IProgressMonitor_cancelRequested += value;
123
IProgressMonitor_cancelRequested -= value;
127
bool IProgressMonitor_cancelRequested = false;
128
bool IProgressMonitor.IsCancelRequested {
130
get { return false; }
133
IAsyncOperation IProgressMonitor.AsyncOperation {
134
get { return (IAsyncOperation) this; }
137
object privateLock = new object ();
138
object IProgressMonitor.SyncRoot {
139
get { return privateLock; }
144
#region IAsyncOperation
145
void IAsyncOperation.WaitForCompleted ()
149
void IAsyncOperation.Cancel ()
153
event MonoDevelop.Core.OperationHandler IAsyncOperation.Completed;
155
bool IAsyncOperation.IsCompleted {
160
bool IAsyncOperation.Success {