コード例 #1
0
ファイル: FtpProject.cs プロジェクト: ikvm/webmatrix
 public FtpProject(IProjectFactory factory, IServiceProvider serviceProvider, FtpConnection connection)
     : base(factory, serviceProvider)
 {
     this._connection = connection;
     this._rootItem = new FtpConnectionProjectItem(this);
     ((IServiceContainer) base.GetService(typeof(IServiceContainer))).AddService(typeof(IWebDocumentRunService), this);
 }
コード例 #2
0
ファイル: FtpConnection.cs プロジェクト: ikvm/webmatrix
 public FtpNetworkStream(FtpConnection owner, Socket socket, FileAccess access)
     : base(socket, access, true)
 {
     this._owner = owner;
 }
コード例 #3
0
ファイル: FtpConnectionDialog.cs プロジェクト: ikvm/webmatrix
 protected override void PerformTask()
 {
     try
     {
         this._connection.Open();
     }
     catch (Exception exception)
     {
         this._connection = null;
         this._error = exception.Message;
     }
     base.PostResults(this._connection, 100, true);
 }
コード例 #4
0
ファイル: FtpConnectionDialog.cs プロジェクト: ikvm/webmatrix
 public ConnectionAsyncTask(string remoteHost, int port, string userName, string password)
 {
     this._connection = new FtpConnection(remoteHost, port, userName, password);
 }
コード例 #5
0
ファイル: FtpConnectionDialog.cs プロジェクト: ikvm/webmatrix
 private void OnConnectionComplete(object sender, AsyncTaskResultPostedEventArgs e)
 {
     this._gradientBand.Stop();
     this._gradientBand.Visible = false;
     this._okButton.Enabled = true;
     this._connectionTask = null;
     this._connection = (FtpConnection) e.Data;
     if (this._connection != null)
     {
         this._httpUrl = this._httpUrlTextBox.Text.Trim();
         if (this._httpUrl.EndsWith("/"))
         {
             this._httpUrl = this._httpUrl.Substring(0, this._httpUrl.Length - 1);
         }
         base.DialogResult = DialogResult.OK;
         base.Close();
     }
     else
     {
         ((IMxUIService) this.GetService(typeof(IMxUIService))).ReportError("Could not connect to the specified FTP site.\r\nCheck the site address and user information before trying again.", this.Text, false);
     }
 }
コード例 #6
0
ファイル: FtpProjectFactory.cs プロジェクト: ikvm/webmatrix
 private FtpProject CreateProject(FtpConnection connection, string httpRoot, string httpUrl)
 {
     FtpProject project = new FtpProject(this, this._serviceProvider, connection);
     project.HttpRoot = httpRoot;
     project.HttpUrl = httpUrl;
     return project;
 }
コード例 #7
0
ファイル: FtpProject.cs プロジェクト: ikvm/webmatrix
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         IServiceContainer service = (IServiceContainer) base.GetService(typeof(IServiceContainer));
         if (service != null)
         {
             service.RemoveService(typeof(IWebDocumentRunService));
         }
         if (this._connection != null)
         {
             this._connection.Dispose();
             this._connection = null;
         }
         this._rootItem = null;
     }
     base.Dispose(disposing);
 }