Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » XML » Web Services » Downloads
 
Add your own
alternative version

Implementing WS-SecureConversation in Microsoft IssueVision

, 27 Sep 2005
Adding secure communications to the Microsoft IssueVision sample application using WSE 2.0.
issuevisionwsesmartclient.zip
Database
IssueVision
Controls
Outlook
Images
statusbar
toolbar
types
Libraries
ThreadHelper Documentation
Panes
Patterns
Web References
localhost
IssueVisionWebWseCS
Libraries
App.ico
IssueVision.csproj.user
IssueVision.snk
IssueVisionServices.disco
IssueVisionServices.wsdl
Reference.map
AppUpdater.dll
ThreadHelper.dll
About BackgroundWorker.doc
Async Windows Forms Programming with BackgroundWorker.doc
IssueVision-about-banner.png
mosaic-light.png
Signin.png
all_staffers.png
all_types.png
computer.png
environmental.png
help_desk.png
network.png
none.png
printer.png
staff.png
technicians.png
technicians_group.png
telecom.png
new_task.png
synchronize.png
work_offline.png
StatusConnected.ico
StatusDisconnected.ico
StatusSynchronizing.ico
IssueVisionWebWseCS.csproj.webinfo
IVDataSet.xsx
using System;
using System.Collections.Specialized;
using System.Configuration;
using System.IO;
using System.Runtime;
using System.Windows.Forms;

namespace IssueVision
{
	// The UserSettings class is a serializable data type used to store and retrieve the
	// client-side user-specific settings.  The SerializationHelper class contains shared 
	// methods that serialize, encrypt and write the settings to disk.
	[Serializable()]
	public class UserSettings
	{
		// internal members
		private static UserSettings m_instance = null;
		private string m_username = string.Empty;
		private string m_password = string.Empty;
		private bool m_workOffline = false;

		public UserSettings()
		{
		}
	    
	    // The Instance property exposes the data held by the UserSettings class
		public static UserSettings Instance
		{
			get
			{
				if (m_instance == null)
				{
					m_instance = Deserialize();
				}
	            
				return m_instance;
			}
		}

		public string Username
		{
			get
			{
				return m_username;
			}

			set
			{
				m_username = value;
			}
		}

		public string Password
		{
			get
			{
				return m_password;
			}

			set
			{
				m_password = value;
			}
		}

		public bool WorkOffline
		{
			get
			{
				return m_workOffline;
			}

			set
			{
				m_workOffline = value;
			}
		}

	    
		// Shared (static) method to return the user settings from disk.  The SerializationHelper
		// class reads, decrypts and deserializes the user settings for the local user.
		public static UserSettings Deserialize()
		{
			return (UserSettings)SerializationHelper.Deserialize(Application.UserAppDataPath + "\\" + ConfigurationSettings.AppSettings["SettingsFileName"]);
		}

		// Stores the client-side user settings to disk
		public void Serialize()
		{
			SerializationHelper.Serialize(this, Application.UserAppDataPath + "\\" + ConfigurationSettings.AppSettings["SettingsFileName"]);
		}

		// Deletes the offline settings file. This permits the user to log in with different credentials
		public static void Delete()
		{
			try
			{
				File.Delete(Application.UserAppDataPath + "\\" + ConfigurationSettings.AppSettings["SettingsFileName"]);
			}
			catch (Exception)
			{
				// Eat exception if this fails.
			}
		}

		public static bool CanWorkOffline()
		{
			if (UserSettings.Instance != null && 
				Instance.Username != string.Empty && 
				Instance.Password != string.Empty && 
				IssueSubject.GetOfflineData() != null)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		public static void Initialize()
		{
			m_instance = new UserSettings();
		}
	}
}

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

Share

About the Author

Weidong Shen
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

| Advertise | Privacy | Mobile
Web04 | 2.8.140902.1 | Last Updated 27 Sep 2005
Article Copyright 2005 by Weidong Shen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid