Click here to Skip to main content
15,867,704 members
Articles / Web Development / HTML

Implementing WS-SecureConversation in Microsoft IssueVision

Rate me:
Please Sign up or sign in to vote.
4.61/5 (12 votes)
27 Sep 20056 min read 73K   776   38  
Adding secure communications to the Microsoft IssueVision sample application using WSE 2.0.
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Resources;
using System.Windows.Forms;

namespace IssueVision
{
	public class AboutForm : Form
	{
		private class Consts
		{
			public const string CompanyLink = "http://www.vertigosoftware.com?ref=issuevision";
		}

		private LinkLabel linkCompany;
		private ListBox listAssemblies;
		private PictureBox pictLogo;
		private Button butOK;
		private Timer fadeTimer;
		private IContainer components;
		private bool m_showing = true;
		private Label labelVersion;
		private Label label3;

		#region Windows Form Designer generated code
		public AboutForm()
		{
			InitializeComponent();
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AboutForm));
			this.labelVersion = new System.Windows.Forms.Label();
			this.butOK = new System.Windows.Forms.Button();
			this.pictLogo = new System.Windows.Forms.PictureBox();
			this.label3 = new System.Windows.Forms.Label();
			this.listAssemblies = new System.Windows.Forms.ListBox();
			this.linkCompany = new System.Windows.Forms.LinkLabel();
			this.fadeTimer = new System.Windows.Forms.Timer(this.components);
			this.SuspendLayout();
			// 
			// labelVersion
			// 
			this.labelVersion.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.labelVersion.Location = new System.Drawing.Point(8, 72);
			this.labelVersion.Name = "labelVersion";
			this.labelVersion.Size = new System.Drawing.Size(182, 16);
			this.labelVersion.TabIndex = 2;
			this.labelVersion.Text = "< version >";
			// 
			// butOK
			// 
			this.butOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.butOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.butOK.Location = new System.Drawing.Point(242, 208);
			this.butOK.Name = "butOK";
			this.butOK.Size = new System.Drawing.Size(56, 23);
			this.butOK.TabIndex = 0;
			this.butOK.Text = "OK";
			// 
			// pictLogo
			// 
			this.pictLogo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.pictLogo.Image = ((System.Drawing.Image)(resources.GetObject("pictLogo.Image")));
			this.pictLogo.Location = new System.Drawing.Point(8, 8);
			this.pictLogo.Name = "pictLogo";
			this.pictLogo.Size = new System.Drawing.Size(289, 41);
			this.pictLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
			this.pictLogo.TabIndex = 3;
			this.pictLogo.TabStop = false;
			// 
			// label3
			// 
			this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.label3.Location = new System.Drawing.Point(8, 96);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(64, 16);
			this.label3.TabIndex = 3;
			this.label3.Text = "Assemblies:";
			// 
			// listAssemblies
			// 
			this.listAssemblies.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
			this.listAssemblies.Location = new System.Drawing.Point(8, 112);
			this.listAssemblies.Name = "listAssemblies";
			this.listAssemblies.Size = new System.Drawing.Size(290, 82);
			this.listAssemblies.TabIndex = 4;
			// 
			// linkCompany
			// 
			this.linkCompany.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
			this.linkCompany.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.linkCompany.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
			this.linkCompany.LinkColor = System.Drawing.SystemColors.ActiveCaption;
			this.linkCompany.Location = new System.Drawing.Point(6, 56);
			this.linkCompany.Name = "linkCompany";
			this.linkCompany.Size = new System.Drawing.Size(184, 16);
			this.linkCompany.TabIndex = 1;
			this.linkCompany.TabStop = true;
			this.linkCompany.Text = "Developed by Vertigo Software, Inc.";
			this.linkCompany.VisitedLinkColor = System.Drawing.SystemColors.ControlText;
			this.linkCompany.Click += new System.EventHandler(this.linkCompany_Click);
			// 
			// fadeTimer
			// 
			this.fadeTimer.Interval = 50;
			this.fadeTimer.Tick += new System.EventHandler(this.fadeTimer_Tick);
			// 
			// AboutForm
			// 
			this.AcceptButton = this.butOK;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
			this.CancelButton = this.butOK;
			this.ClientSize = new System.Drawing.Size(306, 240);
			this.Controls.Add(this.linkCompany);
			this.Controls.Add(this.listAssemblies);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.pictLogo);
			this.Controls.Add(this.butOK);
			this.Controls.Add(this.labelVersion);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "AboutForm";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			base.Closing += new CancelEventHandler(this.AboutForm_Closing);
			this.Text = "About IssueVision";
			this.ResumeLayout(false);

		}
		#endregion

		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			labelVersion.Text = String.Format("Version {0}", Application.ProductVersion);
			AssemblyName[] other = Assembly.GetExecutingAssembly().GetReferencedAssemblies();
	        
			foreach (AssemblyName a in other)
			{
				listAssemblies.Items.Add(string.Format("{0} ({1})", a.Name, a.Version));
			}
	        
			this.Opacity = 0.0;
			this.Activate();
			this.Refresh();
			fadeTimer.Start();
		}

		private void butOK_Click(object sender, EventArgs e)
		{
			Close();
		}

		private void linkCompany_Click(object sender, EventArgs e)
		{
			try
			{
				Process.Start(Consts.CompanyLink);
			}
			catch
			{
				// could not display the website, don't display the error
			}
		}

		private void AboutForm_Closing(object sender, CancelEventArgs e)
		{
			Owner.Activate();
			m_showing = false;
			fadeTimer.Start();
		}

		private void fadeTimer_Tick(object sender, EventArgs e)
		{
			if (m_showing)
			{
				double d = 1000.0 / fadeTimer.Interval / 100.0;
				if (Opacity + d >= 1.0)
				{
					Opacity = 1.0;
					fadeTimer.Stop();
				}
				else
				{
					Opacity = Opacity + d;
				}
			}
			else
			{
				double d = 1000.0 / fadeTimer.Interval / 100.0;
				if (Opacity - d <= 0.0)
				{
					Opacity = 0.0;
					fadeTimer.Stop();
				}
				else
				{
					Opacity = Opacity - d;
				}
			}
		}
	}
}

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
Weidong has been an information system professional since 1990. He has a Master's degree in Computer Science, and is currently a MCSD .NET

Comments and Discussions