|
// Copyright � 2006 by Christoph Richner. All rights are reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// website http://www.raccoom.net, email support@raccoom.net, msn chrisdarebell@msn.com
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Raccoom.Windows.Forms
{
/// <summary>
/// RssGeneratorPublishDialog let you specifiy your credentials to publish the rss channel on the net.
/// </summary>
public class FormPublish : System.Windows.Forms.Form
{
#region fields
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button _pbCancel;
private System.Windows.Forms.Button _pbOK;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox _textUrl;
private System.Windows.Forms.TextBox _textDomain;
private System.Windows.Forms.TextBox _textUser;
private System.Windows.Forms.TextBox _textPassword;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
#endregion
public FormPublish()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
public Uri Uri
{
get
{
return new Uri(_textUrl.Text);
}
set
{
this._textUrl.Text = value.ToString();
}
}
public System.Net.NetworkCredential NetworkCredential
{
get
{
return new System.Net.NetworkCredential(_textUser.Text, _textPassword.Text,_textDomain.Text);
}
set
{
if(value==null) return;
this._textUser.Text = value.UserName;
this._textPassword.Text = value.Password;
this._textDomain.Text = value.Domain;
}
}
#region Windows Form Designer generated code
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this._textUrl = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this._pbCancel = new System.Windows.Forms.Button();
this._pbOK = new System.Windows.Forms.Button();
this._textDomain = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this._textUser = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this._textPassword = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// _textUrl
//
this._textUrl.Location = new System.Drawing.Point(81, 8);
this._textUrl.Name = "_textUrl";
this._textUrl.Size = new System.Drawing.Size(246, 20);
this._textUrl.TabIndex = 0;
this._textUrl.Text = "";
this._textUrl.TextChanged += new System.EventHandler(this._textUrl_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 25);
this.label1.TabIndex = 16;
this.label1.Text = "Url:";
//
// _pbCancel
//
this._pbCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._pbCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this._pbCancel.Location = new System.Drawing.Point(256, 136);
this._pbCancel.Name = "_pbCancel";
this._pbCancel.TabIndex = 5;
this._pbCancel.Text = "&Cancel";
//
// _pbOK
//
this._pbOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this._pbOK.Enabled = false;
this._pbOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this._pbOK.Location = new System.Drawing.Point(176, 136);
this._pbOK.Name = "_pbOK";
this._pbOK.TabIndex = 4;
this._pbOK.Text = "&OK";
//
// _textDomain
//
this._textDomain.Location = new System.Drawing.Point(81, 40);
this._textDomain.Name = "_textDomain";
this._textDomain.Size = new System.Drawing.Size(246, 20);
this._textDomain.TabIndex = 1;
this._textDomain.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(9, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 25);
this.label2.TabIndex = 18;
this.label2.Text = "Domain:";
//
// _textUser
//
this._textUser.Location = new System.Drawing.Point(81, 72);
this._textUser.Name = "_textUser";
this._textUser.Size = new System.Drawing.Size(246, 20);
this._textUser.TabIndex = 2;
this._textUser.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(9, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 25);
this.label3.TabIndex = 20;
this.label3.Text = "User:";
//
// _textPassword
//
this._textPassword.Location = new System.Drawing.Point(81, 104);
this._textPassword.Name = "_textPassword";
this._textPassword.PasswordChar = '*';
this._textPassword.Size = new System.Drawing.Size(246, 20);
this._textPassword.TabIndex = 3;
this._textPassword.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(9, 104);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 25);
this.label4.TabIndex = 22;
this.label4.Text = "Password:";
//
// FormPublish
//
this.AcceptButton = this._pbOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this._pbCancel;
this.ClientSize = new System.Drawing.Size(336, 164);
this.Controls.Add(this._textPassword);
this.Controls.Add(this.label4);
this.Controls.Add(this._textUser);
this.Controls.Add(this.label3);
this.Controls.Add(this._textDomain);
this.Controls.Add(this.label2);
this.Controls.Add(this._textUrl);
this.Controls.Add(this.label1);
this.Controls.Add(this._pbCancel);
this.Controls.Add(this._pbOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormPublish";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Publish your channel";
this.ResumeLayout(false);
}
#endregion
private void _textUrl_TextChanged(object sender, System.EventArgs e)
{
this._pbOK.Enabled = this._textUrl.Text.Length>0;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.